stellar-mcp-server
Provides tools for querying Stellar Testnet accounts (balances, sequence, signers), simulating Soroban smart contract function calls, and generating Rust Soroban contract boilerplate.
Click on "Deploy 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., "@stellar-mcp-serverget account details for GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN"
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.
stellar-mcp-server
A Model Context Protocol (MCP) server that exposes Stellar blockchain tools directly inside any MCP-compatible AI IDE (Windsurf, Antigravity, Claude Desktop, Cursor, etc.).
Built with the official MCP TypeScript SDK and the Stellar JavaScript SDK.
✨ Exposed Tools
Tool | Description |
| Fetches live balances, sequence number, thresholds, signers, and data entries for any Stellar Testnet account |
| Simulates a Soroban smart contract function call on the Testnet RPC — no real transaction, just fee estimates + decoded return value |
| Generates a complete Rust Soroban contract scaffold (Cargo.toml + lib.rs + .cargo/config.toml + test module) |
Related MCP server: StellarMCP
📋 Prerequisites
Requirement | Version |
Node.js | ≥ 18.0.0 |
npm | ≥ 8.0.0 |
🛠 Installation
# 1. Clone the repository
git clone https://github.com/Alhaji-naira/stellar-mcp-server.git
cd stellar-mcp-server
# 2. Install dependencies
npm install
# 3. Build the TypeScript source
npm run buildThe compiled server will be at dist/index.js.
▶️ Running Locally (manual test)
You can pipe a raw JSON-RPC tools/list call to verify the server responds correctly:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
| node dist/index.jsYou should see a JSON response listing all three tools. The server emits diagnostics to stderr only (MCP requirement), keeping stdout clean for the protocol.
🤖 Registering in Your AI IDE
Windsurf
Add the following to your ~/.codeium/windsurf/mcp_config.json (create it if it doesn't exist):
{
"mcpServers": {
"stellar-mcp-server": {
"command": "node",
"args": ["/absolute/path/to/stellar-mcp-server/dist/index.js"],
"transport": "stdio"
}
}
}Reload Windsurf. The Stellar tools will appear in Cascade's tool palette.
Antigravity (Gemini AI)
Open your Antigravity settings panel, go to MCP Servers, and add a new entry:
{
"name": "stellar-mcp-server",
"command": "node",
"args": ["/absolute/path/to/stellar-mcp-server/dist/index.js"],
"transport": "stdio"
}Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"stellar-mcp-server": {
"command": "node",
"args": ["/absolute/path/to/stellar-mcp-server/dist/index.js"]
}
}
}Restart Claude Desktop.
🔧 Tool Reference
1. get_account_details
Queries the Stellar Testnet Horizon API for a given account.
Input:
Parameter | Type | Required | Description |
|
| ✅ | The |
Example prompt to your AI:
"Check the balance of account
GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWNon Stellar Testnet."
Example output (abbreviated):
{
"account_id": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN",
"network": "Testnet",
"sequence": "123456789",
"balances": [
{ "asset": "XLM (native)", "balance": "9999.9999900" }
],
"thresholds": { "low_threshold": 0, "med_threshold": 0, "high_threshold": 0 },
"signers": [{ "key": "GAAZI4...", "weight": 1, "type": "ed25519_public_key" }]
}2. simulate_soroban_contract
Invokes a Soroban contract function via the Testnet RPC simulation endpoint — no fee is charged, no transaction is broadcast.
Input:
Parameter | Type | Required | Default | Description |
|
| ✅ | — |
|
|
| ✅ | — | Function to call, e.g. |
|
| ❌ |
| Arguments (strings, numbers, booleans auto-converted to XDR) |
|
| ❌ | Funded Testnet account |
|
Example prompt:
"Simulate calling
hellowith argWorldon Soroban contractCABC…on the Testnet."
Example output (abbreviated):
{
"contract_id": "CABC...",
"function_name": "hello",
"simulation": {
"min_resource_fee": "71652",
"return_value": ["Hello", "World"],
"footprint": {
"read_only": ["AAAA..."],
"read_write": []
}
}
}3. generate_soroban_boilerplate
Returns a complete, compilable Rust Soroban contract scaffold.
Input:
Parameter | Type | Required | Default | Description |
|
| ✅ | — | CamelCase struct name, e.g. |
|
| ❌ |
| Function signatures to scaffold |
|
| ❌ |
| soroban-sdk version to pin |
Example prompt:
"Generate a Soroban boilerplate for a contract called
AetherSwapwith functionsswap(env: Env, amount: i64) -> i64andget_price(env: Env) -> i64."
The tool returns formatted Cargo.toml, src/lib.rs, and .cargo/config.toml content ready to paste or write to disk.
🗂 Project Structure
stellar-mcp-server/
├── src/
│ ├── index.ts # MCP server bootstrap + dispatcher
│ └── tools/
│ ├── registry.ts # All tool definitions (JSON schemas)
│ ├── getAccountDetails.ts # Tool 1: Account queries
│ ├── simulateSoroban.ts # Tool 2: Soroban simulation
│ └── generateBoilerplate.ts # Tool 3: Rust contract scaffold
├── dist/ # Compiled JS output (git-ignored)
├── package.json
├── tsconfig.json
└── README.md🌐 Network Configuration
All tools target the Stellar Testnet by default:
Service | URL |
Horizon API |
|
Soroban RPC |
|
Friendbot (faucet) |
|
To get a funded Testnet account for testing, visit:
https://friendbot.stellar.org/?addr=<YOUR_PUBLIC_KEY>🔒 Security Notes
This server operates entirely over local stdio — it does not open any network ports.
No private keys are stored or required. All operations are read-only or simulation-only.
The Horizon and Soroban RPC connections use TLS (
allowHttp: false).
🧑💻 Development
# Type-check without emitting
npm run type-check
# Run directly with ts-node (no build step)
npm run dev
# Rebuild after changes
npm run build📄 License
MIT © Alhaji-naira
This server cannot be deployed
Maintenance
Related MCP Connectors
The OpenZeppelin Stellar Contracts MCP server generates secure smart contracts for the Stellar blockchain based on OpenZeppelin templates. It integrates with AI assistants to automatically enforce OpenZeppelin's security best practices, style rules, and standards at every prompt, enabling developers to create production-ready Fungible Token, Non-Fungible Token, and Stablecoin contracts through AI-driven workflows.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
The OpenZeppelin Solidity Contracts MCP server integrates OpenZeppelin's security and style rules into AI-driven development workflows, enabling AI assistants to generate safe, correct, and production-ready smart contracts. It automatically validates generated code against OpenZeppelin standards (including imports, modifiers, naming conventions, and security checks) and supports various contract types including ERC-20, ERC-721, ERC-1155, Stablecoins, RWA, Governor, and Account contracts through prompt-driven workflows.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server for integrating AI assistants like Claude Desktop with the Stellar blockchain, enabling wallet connections, token listings, balance queries, and fund transfers.48 npmJavaScriptMIT
- AlicenseAqualityCmaintenanceMCP server for Stellar that provides tools for accounts, payments, XDR, Horizon/Soroban RPC, AMM liquidity, SEP anchors, and Soroban contract operations.294 npmMIT
- AlicenseBqualityDmaintenanceMCP server giving AI agents access to Stellar blockchain data with monetized tool calls via x402 micropayments.175 npmMIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server for AI agents to purchase resources via Stellar testnet USDC, handling quotes, purchase URLs, and merchant receipts.-