Skip to content

feat: v1.2 MCP off-ramp tools + reputation contract (#226 #227 #228 #229)#379

Merged
ezedike-evan merged 4 commits into
ezedike-evan:mainfrom
Salmatcre8:feat/v12-intent-router-seeds
Jun 2, 2026
Merged

feat: v1.2 MCP off-ramp tools + reputation contract (#226 #227 #228 #229)#379
ezedike-evan merged 4 commits into
ezedike-evan:mainfrom
Salmatcre8:feat/v12-intent-router-seeds

Conversation

@Salmatcre8
Copy link
Copy Markdown
Contributor

Summary

Implements the v1.2 INTENT ROUTER + SEEDS milestone: two MCP off-ramp tools, a subprocess round-trip test, and the on-chain reputation contract seed.

Closes #226
Closes #227
Closes #228
Closes #229

What's included

MCP off-ramp tools (#226 quote, #227 prepare)

The repo is a Next.js app (no packages/ workspace), so the MCP server lives in scripts/mcp/ with a shared, framework-free core in lib/mcp/offramp.ts that reuses the existing router/anchor routing and canonical hashIntent logic.

  • intel.offramp.quote — input { from, to, amount }{ anchor, quoteId, netReceived, expiresAt }; schema-validated, BigInt decimal math (no float drift).
  • intel.offramp.prepare — input: an unsigned intent → { unsignedEnvelope: { intent, intentHash }, unsignedTx }. intentHash is the canonical SHA-256 an agent signs; unsignedTx is a real unsigned Stellar payment XDR.
  • Built on @modelcontextprotocol/sdk (added) as a proper stdio MCP server (scripts/mcp/server.ts). Server applies safe mainnet env defaults so agents don't need the web app's .env.

Subprocess round-trip test (#228)

tests/mcp-e2e.spec.ts spawns the server as a child process via the MCP stdio client and exercises both tools, asserting valid responses, error surfacing without crashing, and a clean exit.

Soroban reputation contract (#229)

contracts/reputation/ — admin-managed anchor registry: init(admin), register_anchor(admin, anchor_id), list_anchors(), plus an admin() getter. Admin authority via require_auth, typed #[contracterror] errors, duplicate protection.

Verified terminal output

TypeScript tools + e2e (vitest):

$ npx vitest run tests/mcp-offramp.spec.ts tests/mcp-e2e.spec.ts
 Test Files  2 passed (2)
      Tests  15 passed (15)

Includes the #136 acceptance check: "the returned envelope signs correctly with a provided keypair" (Keypair.sign over intentHash verifies against the sender key).

Soroban contract — unit tests + build (verified locally with cargo 1.94 + stellar-cli 25.2):

$ cargo test
running 6 tests
test register_before_init_is_rejected ... ok
test init_is_one_shot ... ok
test non_admin_cannot_register ... ok
test requires_admin_auth ... ok
test duplicate_anchor_is_rejected ... ok
test init_register_list_round_trip ... ok

$ stellar contract build
    Wasm File: target/wasm32v1-none/release/reputation.wasm (2843 bytes)
    Exported Functions: 5 found  (_, admin, init, list_anchors, register_anchor)
✅ Build Complete

Notes

  • The issues referenced packages/mcp/... and a monorepo layout that doesn't exist in this repo; I placed the server under scripts/mcp/ and the shared core under lib/mcp/ to fit the actual Next.js structure while preserving the exact tool names and I/O schemas from the issues.
  • Docs: docs/MCP.md describes running the server and both tools.
  • The full project test suite has 15 pre-existing failures on main (unrelated SEP-1/SEP-10/SEP-24/component/e2e specs); this PR adds 15 passing tests and introduces none.

Acceptance criteria

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@Salmatcre8 is attempting to deploy a commit to the ezedikeevan's projects Team on Vercel.

A member of the Team first needs to authorize it.

…ter-seeds

# Conflicts:
#	package-lock.json
#	package.json
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@Salmatcre8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

ezedike-evan added 2 commits June 1, 2026 19:30
…#226-229)

Bumps tsconfig target ES2017→ES2020 to support BigInt literals already
used in lib/router/solve.ts and lib/mcp/offramp.ts.
@ezedike-evan ezedike-evan merged commit d52da3c into ezedike-evan:main Jun 2, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants