ST

Stellar MCP Server: LLM Access to Accounts, Transactions

Enable LLMs to access Stellar via an MCP server to create accounts, check balances, analyze transactions, mint assets and call smart contracts.

Quick Install
npx -y @syronlabs/stellar-mcp

Overview

The Stellar MCP Server exposes Stellar blockchain functionality to language models via the Model Context Protocol (MCP). It implements a set of MCP-compatible tools that let an LLM inspect accounts and transactions, create and fund accounts, mint/issue assets, and invoke smart contracts or Soroban-based contracts. By surface-mapping Stellar operations to MCP tool calls, the server enables agents and assistant models to reason about on-chain state and take guarded actions without hardcoding RPC calls into the model prompts.

This is useful for developers building AI assistants that need contextual, verifiable access to Stellar data and transaction execution. Instead of embedding private keys or custom integrations in every agent, the MCP server centralizes access control, transaction construction, and validation logic while exposing a stable, tool-based interface that LLMs can call during generation.

Features

  • Exposes Stellar operations as MCP tools that models can call
  • Read-only queries: account balances, transaction history, ledgers
  • Writable operations: create and fund accounts, submit payments, mint/issue assets
  • Support for smart contracts (Soroban) invocation where available
  • Safety controls: dry-run / simulation modes, configurable whitelists
  • Designed for integration with LLM orchestration platforms and tool-augmented assistants
  • Configurable for testnet and mainnet environments

Installation / Configuration

Prerequisites: Node.js (>=16), npm or yarn, and access to a Stellar Horizon node (public Horizon or self-hosted).

  1. Clone the repo and install dependencies:
git clone https://github.com/syronlabs/stellar-mcp.git
cd stellar-mcp
npm install
# or
yarn install
  1. Set environment variables. Minimum required variables:
# .env
HORIZON_URL=https://horizon-testnet.stellar.org
NETWORK_PASSPHRASE=Test SDF Network ; September 2015
SERVER_PORT=3000
# Private key of the server-controlled account for signing transactions
SIGNING_KEY=SXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Optional: enable simulation-only mode for safe experimentation
SIMULATE_ONLY=true
  1. Start the server:
npm run start
# or for development
npm run dev

Alternatively, run via Docker (if provided in the repo):

docker build -t stellar-mcp .
docker run -p 3000:3000 --env-file .env stellar-mcp

After startup, the server will expose MCP-compatible endpoints (see Available Resources) and log available tool names for integration.

Security note: keep the signing key secure (use a secrets manager). Use testnet during development.

Available Tools / Resources

The server maps common Stellar actions into MCP tools. Each tool exposes a small JSON input schema and returns structured JSON output.

Tool namePurposeInput (example)
stellar.get_balanceQuery balances for an account{ “account”: “G…” }
stellar.list_transactionsFetch recent transactions{ “account”: “G…”, “limit”: 10 }
stellar.create_accountCreate & fund a new account{ “starting_balance”: “2.5”, “destination”: “G…” }
stellar.send_paymentSubmit a payment operation{ “from”: “G…”, “to”: “G…”, “asset”: “XLM”, “amount”: “10” }
stellar.mint_assetIssue a new asset (issuer account required){ “asset_code”: “MYTOK”, “amount”: “1000”, “issuer”: “G…” }
stellar.call_contractInvoke Soroban smart contract{ “contract_id”: “…”, “function”: “name”, “args”:[…] }

These resources are intended to be called by an LLM through the MCP runtime. Each call will return a structured result and, for transactional operations, include transaction hashes and simulation/submit outcomes.

Example MCP-style request (illustrative):

{
  "tool": "stellar.get_balance",
  "args": { "account": "GABC..." }
}

Use Cases

  • LLM-powered finance assistant: An agent can answer “What’s my XLM balance and recent inflows?” by calling stellar.get_balance and stellar.list_transactions, then composing a natural-language summary.
  • Account creation flow: A chatbot onboarding new users can call stellar.create_account to provision a funded test account, returning keys or account IDs to the user (with appropriate security practices).
  • Asset issuance & management: A token-issuing assistant can automate minting steps—creating trustlines, issuing tokens, and recording metadata—by chaining stellar.mint_asset and related calls.
  • Transaction analysis and alerts: Integrate with an agent that periodically calls list_transactions, analyzes patterns (via LLM reasoning), and flags suspicious activity or summarises large transfers.
  • Smart contract interaction: Agents can invoke Soroban contracts (read or write) for decentralized applications, simulate calls to preview results, and submit signed transactions when approved.

Best practices

  • Use testnet for development and only enable mainnet after auditing keys and policies.
  • Run the MCP server behind authentication and restrict model/tool access with whitelists.
  • Prefer simulation mode for model-driven exploratory workflows; require human approval for submitting on-chain transactions.

For the latest code, configuration examples, and detailed API docs, see the project repository: https://github.com/syronlabs/stellar-mcp/