@molpha/sdk for gateway and on-chain operations. Package: @molpha/mcp. Source: Molpha/mcp.
Tool reference
EVM and Starknet execution is not performed by the MCP server. It returns verifier addresses and contract-ready arguments for those chains. Solana is the only leg this server settles — via
molpha_execute or molpha_fetch_verified with autoSubmit: true. There is no standalone Solana verify-simulation path; submit, then read with molpha_get_latest.molpha_fetch_verified payment
Set
autoSubmit: true and include "solana" in chains to settle the Solana leg in the same call. encryptSecrets is not yet supported on the x402 path — use payment: "subscription" for feeds with encrypted secrets.
Call molpha_agent_status before x402 spend to inspect escrow balance, committed amount, and the quoted next price for a given quorum.
Architecture
The MCP server is an adapter and policy boundary. The signedDataUpdate remains the trust anchor:
- An MCP client invokes a typed tool over stdio.
- The selected wallet signs gateway authentication messages and owner transactions.
- Nodes independently fetch the feed’s committed API configuration and aggregate a signature after reaching quorum.
- The server returns the signed artifact and chain-specific verifier arguments.
- A consumer verifies the payload against its registry version before using the value.
Setup
Prerequisites
- Node.js 24 or later
- An MCP client such as Cursor, Claude Desktop, or Codex
- A Solana wallet funded with Devnet SOL
- Devnet USDC for subscription or x402 operations — use Circle’s faucet (select USDC on Solana Devnet)
1
Clone and build
@molpha/mcp and point your client at its molpha-mcp binary.2
Choose a signer
Local keypair (simplest for development):Leave
GATEWAY_ENDPOINTS empty to use the SDK default (https://dev-gateway.molpha.io). See the Gateway HTTP API and Gateways guide.Hosted signers — set SIGNER_BACKEND=keychain and one of:The same wallet must be used for provisioning and MCP runtime operations. Feeds are wallet-owned.
3
Validate the setup
4
Bootstrap a subscription
Preview the transaction first, then subscribe with an explicit maximum USDC price:
20000000 is 20 USDC at 6 decimals. This is a safety cap; the transaction aborts if the on-chain price is higher.Skip this step if you only plan to use payment: "x402" or "auto" without a subscription.5
Connect your MCP client
Point the client to the compiled stdio entry point, or install the Claude Desktop MCPB (see below).Restart the client after saving the configuration. Then ask it to call
- Cursor / Claude Desktop
- Codex
- Claude Desktop (MCPB)
molpha_get_capabilities. If tool names look stale, restart or reload the MCP server so the client refreshes its tool list.Example prompts
Inspect the networkUse Molpha to inspect the current oracle capabilities. Summarize the registry version, node count, supported chains, gateway endpoints, and verifier addresses. Do not make any writes.Derive a feed
Derive a Molpha feedId forUse an endpoint whose response is stable enough for independent nodes to reproduce. Fast-moving ticker APIs can return different values to different nodes and fail to reach quorum. Fetch and verifyhttps://api.example.com/v1/finalized/priceusing the JSON path$.priceand 3 required signatures. Show me the API config hash, the derived feedId, and any determinism warnings. Do not send a transaction.
For that same feed, fetch a signed result with payment: "auto" and a maximum age of 60 seconds, for the EVM chain. Summarize the signed value, timestamp, registry version, quorum, and EVM verifier call, and tell me whether it was paid for via subscription or x402. Treat the signed artifact as the trust anchor; do not trust the value by itself.
Check x402 spend before paying
Call molpha_agent_status for 3 required signatures. Tell me the escrow’s USDC balance, committed amount, and quoted next price before I authorize any x402 spend.
Preview a Solana update
Read the latest value for Molpha feed<FEED_ID>. If I provide a newer signed result, previewmolpha_executewithdryRun: true, explain the fee-paying wallet and exact write, and wait for my confirmation before submitting it to Solana.
Guardrails
The counters reset when the MCP server restarts. Use durable policy and wallet controls in addition to these guardrails for higher-risk environments.
Troubleshooting
The server appears to hang
The server appears to hang
node dist/src/server.js waits for JSON-RPC on stdin and normally prints nothing. Launch it through an MCP client, then call molpha_get_capabilities.The MCP client cannot find the server
The MCP client cannot find the server
Run
npm run build, use an absolute path to dist/src/server.js, and restart the client. npm run doctor prints a resolved configuration snippet.The client still lists job tools like molpha_create_job
The client still lists job tools like molpha_create_job
The running server is feed-based (
derive_feed, describe_feed, agent_status). Restart or reload the MCP server so the client refreshes its tool descriptors.A subscription-backed fetch reports an inactive subscription
A subscription-backed fetch reports an inactive subscription
Run the provisioning CLI with the same signer used by the MCP server, or use
payment: "x402" / "auto" for a self-funded round.Nodes do not reach quorum
Nodes do not reach quorum
Check that the endpoint returns deterministic, settled data. Every selected node must derive a byte-identical normalized value for the round to aggregate successfully.
Next steps
Agent quickstart
Derive a feed, fetch verified data, and optionally submit to Solana.
How Molpha works
Follow a value from an HTTP response to a cross-chain aggregate signature.
Feeds
Learn how API configurations are committed and feeds are identified.
Verifier overview
Understand verification across Solana, EVM, and Starknet.