stellar-mcp-server

stellar-mcp-server

An MCP server that provides Stellar blockchain tools for account queries, Soroban contract simulation, and boilerplate generation within compatible AI IDEs.

Category
访问服务器

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 GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN on 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 hello with arg World on Soroban contract CABC… 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 AetherSwap with functions swap(env: Env, amount: i64) -> i64 and get_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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选