StellarMCP
StellarMCP is a comprehensive MCP server for interacting with the Stellar blockchain and Soroban smart contract ecosystem, designed for agents and IDE integrations.
Accounts & Payments
Fetch account details (balances, signers, flags), transaction history, and fund testnet accounts via Friendbot
Generate test wallets, modify account options (signers, weights, thresholds, flags)
Submit payments (XLM or custom assets) and fee-bump transactions
Retrieve current network fee statistics
Assets & AMM Liquidity
Create trustlines for non-native assets
Deposit and withdraw liquidity from classic AMM pools
XDR Encoding & Decoding
List XDR types, get Draft-7 JSON schemas, guess XDR types from base64
Encode JSON to XDR and decode XDR to human-readable JSON
Historical Metadata
Fetch closed ledger header/metadata and transaction metadata (envelope, result, fee-meta) with optional caching and XDR size bounding
SEP Anchor Protocols
Fetch anchor
stellar.toml, perform SEP-10 authentication (JWT)SEP-6 programmatic transfers, SEP-12 KYC management, SEP-24 interactive flows, SEP-31 remittances, SEP-38 quote fetching
Soroban Smart Contracts
Simulate, invoke, and deploy contracts; fetch historical contract events; read contract ledger state directly
Development Scaffolding & Guides
Generate Rust Soroban contract workspaces, Next.js wallet scaffolds (Freighter), and x402 integration scaffolds
Guide on Stellar/Soroban ZK proof primitives and patterns
Generate standalone MCP servers for individual Soroban contracts from their WASM or spec JSON
Deployment & Security
Supports
stdioandhttp-ssetransport modes, configurable via environment variablesAuto-signing policies, secret key management, and host allowlisting
Provides tools for interacting with the Stellar network, including account management, payments, XDR parsing, Horizon/Soroban RPC queries, AMM liquidity, SEP anchors, and Soroban smart contract operations (simulate, invoke, deploy, events, state retrieval).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@StellarMCPget account details for GBQ7M6A5UBS2"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
StellarMCP
MCP server for Stellar: accounts, payments, XDR, Horizon/Soroban RPC, AMM liquidity, SEP anchors, and Soroban (simulate, invoke, events, deploy, contract state). Intended for agents and IDE integrations (Cursor, Claude Desktop, etc.) with strict validation, normalized errors, and redacted _debug fields.
All tools (names, descriptions, parameters): docs/TOOLS.md — auto-generated from the same tools/list your MCP client sees; attach or paste it when asking an agent how to use this server.
Requirements: Node.js ≥ 20. · Source: github.com/JulioMCruz/Stellar-mcp
Table of contents
Related MCP server: verdigraph
Quick start
From a clone (this repository)
git clone https://github.com/JulioMCruz/Stellar-mcp.git
cd Stellar-mcp
npm install
npm run buildRun the server (see Run the server), then connect your MCP client.
From npm
Package on npm: @juliomcruz/stellarmcp (scoped package, when published).
The published tarball includes build/src, templates/, generator inputs (src/lib/errors.ts, redact.ts), .env.example, and docs — enough to run the server and stellarmcp-generate without cloning.
npm install @juliomcruz/stellarmcp
npx stellarmcp
# or: npx @juliomcruz/stellarmcpEnv template:
node_modules/@juliomcruz/stellarmcp/.env.example→ copy to your project as.envif needed.MCP stdio when the package is a dependency (example):
"args": ["${workspaceFolder}/node_modules/@juliomcruz/stellarmcp/build/src/index.js"].
Prefer GitHub if you are developing or patching this repository (clone).
Sanity check (first call)
Use this to confirm wiring before deeper integration:
HTTP mode: with
MCP_TRANSPORT=http-sserunning, openGET /health(expect JSON withnetwork,horizonReachable,rpcReachable).Any MCP host: call tool
stellar_get_fee_statswith{}. Expect fields likebaseFee,p99,recommendedFee(see Example tool calls).
If that works, Horizon is reachable and the server is usable for read-only tools without a secret key.
For every tool name and argument shape, use docs/TOOLS.md (or your host’s MCP tool picker).
Run the server
Mode | Command | Notes |
stdio (default) |
| Best for Claude Desktop, Cursor stdio, local agents. |
Streamable HTTP |
| MCP endpoint: |
After npm run build, the entrypoint is build/src/index.js.
Connect your MCP client
stdio (recommended locally)
Point your host at Node and the built entrypoint. Example shape (paths must be absolute or use your editor’s variable such as ${workspaceFolder}):
{
"mcpServers": {
"stellarmcp": {
"type": "stdio",
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/stellarmcp/build/src/index.js"],
"env": {
"MCP_TRANSPORT": "stdio",
"STELLAR_NETWORK": "testnet"
}
}
}
}Cursor: project config
~/.cursor/mcp.jsonor.cursor/mcp.json— see Cursor MCP docs (interpolation:${workspaceFolder},${env:VAR}).Claude Desktop:
claude_desktop_config.jsonunder the samemcpServerspattern.Optional: set
"envFile": "${workspaceFolder}/.env"(stdio only in Cursor) to load secrets from a local.envwithout committing it.
Never commit real STELLAR_SECRET_KEY or anchor tokens.
HTTP / SSE
Start the server with
MCP_TRANSPORT=http-sseand choosePORT.In the client, register the remote server, for example:
{
"mcpServers": {
"stellarmcp": {
"url": "http://localhost:3000/mcp"
}
}
}Verify
GET http://localhost:3000/healthbefore debugging MCP calls.
When binding HTTP/SSE to anything other than loopback, set
MCP_HTTP_AUTH_TOKEN and send MCP requests with
Authorization: Bearer <token>. The server refuses non-loopback HTTP/SSE
startup without that token.
Environment variables
Authoritative template: copy [.env.example](./.env.example) to .env and edit.
Variable | Required | Purpose |
| No |
|
| No |
|
| No | Horizon base URL (https; host must be default-allowed or listed in |
| No | Soroban RPC URL (same rules as Horizon). |
| No | Anchor SEP-38 endpoint for quotes. |
| No | Comma-separated extra hostnames allowed for the three URL vars above. |
| No | Comma-separated domains allowed for anchor/TOML and SEP flows. |
| No | Signing key; omit for read-only / unsigned-XDR-only operation. |
| No |
|
| No | Legacy if policy unset. |
| No | Legacy / used with |
| No | USDC issuer for valuation in guarded signing (default is network USDC). |
| No | HTTP server port (default |
| No | Upstream request timeout (max 30000). |
| No | Bind host, auth token, rate limit, concurrency, max POST body, |
| No | Disk cache + XDR size limits for meta tools — see |
Custom Horizon/RPC/SEP-38 URLs must use https and non-private hosts; unknown hosts require STELLAR_ALLOWED_HOSTS.
Security
Secrets: Treat
STELLAR_SECRET_KEYlike production key material. Prefer env orenvFile; never commit secrets; restrict file permissions on.env.Auto-sign policy (write tools: payments, trustlines, liquidity,
set_options, fee bump, Soroban invoke/deploy, relevant SEP flows):safe(recommended): unsigned mode — write tools return unsigned XDR for external signing when applicable.guarded: auto-sign enabled only withSTELLAR_AUTO_SIGN_LIMIT> 0 and USDC-based valuation rules; fails closed when value cannot be bounded.expert: unlimited auto-sign — use only with full awareness of risk.
Network exposure: Keep HTTP/SSE bound to
127.0.0.1unless you have a reason to expose it. If you expose HTTP/SSE, setMCP_HTTP_AUTH_TOKEN, use TLS in front, sane firewall rules, and reviewMCP_HTTP_*.MCP_HTTP_TRUST_PROXY=trueonly behind a trusted proxy that setsX-Forwarded-Forcorrectly.Allowlists: Use
STELLAR_ALLOWED_HOSTSandSTELLAR_TRUSTED_ANCHOR_DOMAINSwhen pointing at non-default infrastructure or anchors.Read-only deployments: Omit
STELLAR_SECRET_KEY; read and simulate tools still work; writes yield unsigned payloads or explicit errors.
Tools reference
Full detail for agents (every tool, descriptions, parameter tables from live tools/list): docs/TOOLS.md — auto-generated; refresh with npm run docs:tools after you change tools.
Summary below: Read = no transaction submission by this server; Write = may build/submit transactions, call Friendbot, or initiate anchor flows.
Accounts & history
Tool | Type | Description |
| Read | Balances, signers, flags, subentries, minimum balance. |
| Read | Paginated transaction history ( |
| Write | Testnet only — funds via Friendbot HTTP (10k test XLM). |
| Write | Generate a testnet wallet and optionally fund it with Friendbot. |
| Write | Account options (signers, weights, flags); unsigned unless policy allows signing. |
Payments & fees
Tool | Type | Description |
| Write | Payment; hash or unsigned XDR per policy. |
| Write | Fee-bump an existing transaction (sponsor pays fee). |
Assets & AMM
Tool | Type | Description |
| Write | Create trustline for non-native asset. |
| Write | Deposit into classic AMM pool. |
| Write | Withdraw from classic AMM pool. |
Network
Tool | Type | Description |
| Read | Fee stats + recommended fee (stroops). |
XDR
Tool | Type | Description |
| Read | List XDR type names (optional |
| Read | Draft-7 JSON Schema for a type. |
| Read | Candidate types for a base64 XDR blob. |
| Read | JSON → base64 XDR for a named type. |
| Read | Classic transaction XDR → JSON (uses configured network passphrase). |
Historical meta (Horizon-first, Soroban RPC fallback, bounded XDR)
Tool | Type | Description |
| Read | Closed ledger header/metadata XDR (+ optional cache metadata). |
| Read | Tx envelope/result/result-meta/fee-meta; optional |
SEP / anchors
Tool | Type | Description |
| Read | Fetch/parse |
| Write | SEP-10 challenge → JWT (requires signer / secret where applicable). |
| Write | SEP-6 deposit/withdraw initiation. |
| Mixed | GET/PUT KYC against anchor SEP-12 server. |
| Write | SEP-24 interactive URL for deposit/withdraw. |
| Write | SEP-31 remittance initiation. |
| Read | SEP-38 indicative quote / rate metadata. |
Soroban
Tool | Type | Description |
| Read | Simulate contract call (footprint, fees, events); does not submit. |
| Write | Simulate, assemble, sign/submit per policy. |
| Read | Contract events from RPC ( |
| Write | Deploy WASM from disk path; submit per policy. |
| Read | Direct |
Scaffolds
Tool | Type | Description |
| Write | Create a Rust Soroban contract workspace with tests and CLI docs. |
| Write | Create Next.js Freighter wallet hook/component/env starter files. |
| Read | Return PerkOS/OpenZeppelin Stellar x402 architecture and rules. |
| Write | Create a Next.js paid route and x402/Freighter payment client. |
| Write | Create OpenZeppelin Relayer x402 facilitator config templates. |
| Read | Return Stellar/Soroban ZK proof primitives, patterns, and safety rules. |
Example tool calls
JSON shapes are illustrative; your MCP host sends tools/call with name + arguments.
Fee stats (testnet)
{ "name": "stellar_get_fee_stats", "arguments": {} }XDR: list types → schema → encode
{ "name": "stellar_xdr_types", "arguments": { "prefix": "Transaction" } }{ "name": "stellar_xdr_json_schema", "arguments": { "type": "TransactionEnvelope" } }{ "name": "stellar_xdr_encode", "arguments": { "type": "TransactionEnvelope", "json": "<JSON string>" } }{ "name": "stellar_xdr_guess", "arguments": { "xdr": "<base64>" } }{ "name": "stellar_decode_xdr", "arguments": { "xdr": "<base64 classic transaction XDR>" } }Historical meta
{ "name": "stellar_get_ledger_meta", "arguments": { "ledgerSequence": 123456, "maxXdrCharsPerField": 8192 } }{
"name": "stellar_get_transaction_meta",
"arguments": {
"transactionHash": "<64-char hex>",
"operationIndex": 0,
"maxXdrCharsPerField": 8192
}
}For full argument schemas, use your client’s tool list / schema UI or inspect Zod definitions under src/tools/.
PerkOS Stellar x402
This MCP understands the PerkOS Stellar x402 pattern from:
PerkOS-xyz/Stellar-x402-DemoPerkOS-xyz/Stellar-x402-Relayer
The core flow is:
A client calls a paid API route.
The server returns HTTP 402 payment requirements.
The browser signs a Stellar auth entry through Freighter.
@x402/fetchretries with theX-PAYMENTheader.PerkOS Stellar Relayer verifies and settles through the OpenZeppelin Relayer x402 facilitator plugin.
Stellar USDC defaults:
Pubnet:
stellar:pubnet,CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75Testnet:
stellar:testnet,CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA
Guide: docs/PERKOS_STELLAR_X402_GUIDE.md.
Example:
{ "name": "stellar_x402_perkos_guide", "arguments": {} }{
"name": "stellar_x402_nextjs_scaffold",
"arguments": {
"outputDir": "./web",
"appName": "quest_board"
}
}{
"name": "stellar_x402_oz_facilitator_scaffold",
"arguments": {
"outputDir": "./relayer"
}
}Stellar ZK proofs
This MCP includes a read-only ZK guide for agents building with Stellar/Soroban.
Stellar's Protocol 25 / X-Ray work adds ZK-friendly host primitives for verifier contracts:
BN254:
g1_add,g1_mul,pairing_checkPoseidon/Poseidon2:
poseidon,poseidon2
These are verifier building blocks, not a complete privacy protocol. Agents should generate proofs off-chain with systems such as Noir, RISC Zero, Circom, or Reclaim/zkFetch-style services, then verify public inputs/proofs through Soroban contracts.
Example:
{ "name": "stellar_zkproof_guide", "arguments": {} }Agent rules:
Keep witnesses/private inputs off-chain.
Never invent proof bytes, verifying keys, trusted setup material, or private witness data.
Bind proofs to network, contract id, statement version, domain, and public inputs.
Test verifier contracts with known valid and invalid proof fixtures before UI wiring.
Explain clearly in UI what remains private and what becomes public on-chain.
Primary references:
Stellar docs: https://developers.stellar.org/docs/build/apps/zk
DoraHacks Stellar Hacks ZK resources: https://dorahacks.io/hackathon/stellar-hacks-zk/resources
Reclaim zkFetch Stellar example: https://github.com/reclaimprotocol/zkfetch-stellar-example
Soroban and Next.js scaffolds
Two write tools turn this MCP server into a starter-kit assistant for Stellar apps:
stellar_soroban_scaffold_contractcreates a Rustsoroban-sdkcontract workspace using the currentwasm32v1-nonetarget flow and Stellar CLI build/deploy/bindings commands.stellar_nextjs_wallet_scaffoldcreates Next.js client-side wallet files for Freighter:useStellarWallet,WalletButton, network/contract env helpers, test-wallet script, HTTPS local dev notes, and binding-generation instructions.
For local test wallets, use stellar_generate_test_wallet or the generated scripts/create-test-wallet.mjs --fund. Test wallet seeds belong only in .env.local or a secret manager. Never commit them, and never expose them through NEXT_PUBLIC_*.
This follows the official Stellar flow: build Soroban contracts in Rust, deploy with Stellar CLI, generate TypeScript bindings with stellar contract bindings typescript, then call those bindings from the frontend. Freighter local testing should run in a secure context, so the scaffold documents next dev --experimental-https.
Research notes and source links: docs/STELLAR_NEXTJS_SOROBAN_RESEARCH.md.
Agent coding instructions: docs/AGENT_SOROBAN_CODING_GUIDE.md. Repository-level rules for coding agents are in AGENTS.md.
Example:
{
"name": "stellar_soroban_scaffold_contract",
"arguments": {
"outputDir": "./stellar-contracts",
"contractName": "quest_board"
}
}{
"name": "stellar_nextjs_wallet_scaffold",
"arguments": {
"outputDir": "./web",
"appName": "quest_board"
}
}Soroban contract MCP generator
Generate a standalone Node MCP package (stdio) from a deployed contract’s WASM (contractspecv0) or from a spec JSON manifest.
Inputs
WASM —
Spec.fromWasmreads the custom section (same idea as@stellar/stellar-sdkcontract specs).Spec JSON — format
stellarmcp-contract-spec-v1withentries[]of base64ScSpecEntryXDR values.
CLI (from this repo after npm run build)
node build/src/generator/cli.js --input path/to/contract.wasm --out ./my-contract-mcp --name my-contract-mcp --alias mytoken
# or
node build/src/generator/cli.js --input path/to/spec.json --out ./my-contract-mcp --name my-contract-mcp --alias mytokenPublished installs: stellarmcp-generate (same flags).
Then in the output directory:
npm install && npm run build
STELLAR_CONTRACT_ID=C... STELLAR_NETWORK=testnet node build/src/index.jsNon-goals (current generator)
No generated HTTP/SSE transport in the scaffold (stdio only).
Exotic spec shapes may emit loose Zod at the edges; simulation on RPC remains authoritative.
Multi-contract workspaces / auto-publish are out of scope for the generator CLI.
Versioning artifacts in generated code: GENERATOR_ARTIFACT_VERSION, SPEC_FINGERPRINT, etc. — regenerate when upgrading stellarmcp or changing the contract interface.
Troubleshooting
Issue | What to check |
Client cannot start server |
|
Tools error on Horizon/RPC |
|
Signing / “unsigned only” |
|
HTTP mode |
|
Meta cache | Writable |
Development & testing
npm run typecheck
npm run test # build + unit tests + docs/TOOLS.md drift check
npm run docs:tools # regenerate docs/TOOLS.md after changing MCP tools
npm run verify:phase:c # full maintainer gate (see package.json)Useful smokes:
npm run smoke:phase1— config + stdio + HTTP wiring.npm run smoke:testnet:readonly— real testnet reads + Soroban via MCP stdio (no secret key).npm run smoke:tier1:friendbot— Friendbot-funded flows on testnet.
Inspired by stellarskills
Knowledge layer: stellarskills. Execution layer: StellarMCP.
License: MIT (see repository).
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JulioMCruz/Stellar-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server