stellar-mcp-server
An MCP server that provides Stellar blockchain tools for account queries, Soroban contract simulation, and boilerplate generation within compatible AI IDEs.
README
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 |
|---|---|
get_account_details |
Fetches live balances, sequence number, thresholds, signers, and data entries for any Stellar Testnet account |
simulate_soroban_contract |
Simulates a Soroban smart contract function call on the Testnet RPC — no real transaction, just fee estimates + decoded return value |
generate_soroban_boilerplate |
Generates a complete Rust Soroban contract scaffold (Cargo.toml + lib.rs + .cargo/config.toml + test module) |
📋 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 build
The 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.js
You 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 |
|---|---|---|---|
account_id |
string |
✅ | The G… Stellar public key to look up |
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 |
|---|---|---|---|---|
contract_id |
string |
✅ | — | C… Soroban contract address |
function_name |
string |
✅ | — | Function to call, e.g. hello |
args |
array |
❌ | [] |
Arguments (strings, numbers, booleans auto-converted to XDR) |
source_account |
string |
❌ | Funded Testnet account | G… public key used as simulation source |
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 |
|---|---|---|---|---|
contract_name |
string |
✅ | — | CamelCase struct name, e.g. TokenVault |
functions |
string[] |
❌ | ["hello(env: Env, to: Symbol) -> Vec<Symbol>"] |
Function signatures to scaffold |
soroban_sdk_version |
string |
❌ | "22.0.0" |
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 | https://horizon-testnet.stellar.org |
| Soroban RPC | https://soroban-testnet.stellar.org |
| Friendbot (faucet) | https://friendbot.stellar.org/?addr=<G...> |
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.