Skip to main content
Glama

Overview

solana-mcp-server is a Model Context Protocol server that lets MCP clients such as Claude Desktop query the Solana blockchain. An agent can check balances, list SPL token holdings, read a transaction in compact form, browse recent activity and dry-run a SOL transfer. The server is read-only by design: it never holds a private key, never signs and never broadcasts anything, so you can plug it into an agent without handing over a wallet.

Related MCP server: Solana MCP Server

Features

  • get_balance: native SOL balance in lamports and SOL, computed with exact integer math.

  • get_token_accounts: SPL Token and Token-2022 accounts, with mint, raw amount and decimals.

  • get_transaction: a compact transaction summary (status, fee, signers, programs, SOL and token balance changes, optional logs).

  • recent_activity: latest signatures for an address, with cursor-based pagination.

  • simulate_transfer: builds an unsigned SOL transfer and runs simulateTransaction, returning logs, compute units and fee.

  • Strict input validation with zod: base58 addresses and signatures are checked before any RPC call.

  • Uses devnet by default; mainnet or any custom RPC is selected with a single environment variable.

  • Readable error messages for agents instead of stack traces.

Architecture

sequenceDiagram
    participant Client as MCP client (e.g. Claude Desktop)
    participant Server as solana-mcp-server
    participant Zod as zod validation
    participant RPC as Solana JSON-RPC (devnet by default)

    Client->>Server: tools/call (stdio, JSON-RPC)
    Server->>Zod: validate address / signature / amount
    alt invalid input
        Zod-->>Server: issue list
        Server-->>Client: error result with readable message
    else valid input
        Server->>RPC: read-only request (getBalance, getParsedTransaction, simulateTransaction ...)
        RPC-->>Server: response
        Server-->>Client: compact JSON summary
    end
    Note over Server,RPC: No keypair is loaded. Nothing is signed or sent.

Quickstart

Requires Node.js 20.18 or newer.

git clone https://github.com/wonghldev/solana-mcp-server.git
cd solana-mcp-server
npm ci
npm run build
npm test

Try it interactively with the MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

Use it from Claude Desktop: copy the block from examples/claude_desktop_config.json into your claude_desktop_config.json, replace the path with the absolute path to dist/index.js and restart Claude Desktop.

Run it with a local .env file:

cp .env.example .env
npm run start:env

Configuration

All variables are optional. Empty values fall back to the defaults.

Name

Required

Default

Description

SOLANA_RPC_URL

No

https://api.devnet.solana.com

JSON-RPC endpoint. Set a mainnet or provider URL to leave devnet.

SOLANA_COMMITMENT

No

confirmed

Commitment for reads: processed, confirmed or finalized.

SOLANA_REQUEST_TIMEOUT_MS

No

30000

Timeout for each RPC request, from 1000 to 120000 ms.

Security Model

  • Read-only. All tools are annotated with readOnlyHint and only call read or simulation RPC methods.

  • No keys. The server never loads a keypair, seed phrase or wallet file, and there is no setting to add one.

  • No signing. simulate_transfer builds a transaction with empty signature slots and simulates it without verifying signatures. It cannot be broadcast.

  • Validated input. Addresses, signatures and amounts are validated before they reach the RPC node; SOL amounts use integer lamport math, never floating point.

  • Minimal logging. Diagnostics go to stderr only. Query strings in the RPC URL, where providers often put API keys, are redacted.

What it does not protect against: an RPC provider can still see the addresses you query, and data returned by a third-party RPC endpoint is trusted as-is.

Project Structure

solana-mcp-server/
├── examples/
│   └── claude_desktop_config.json
├── src/
│   ├── tools/
│   │   ├── getBalance.ts
│   │   ├── getTokenAccounts.ts
│   │   ├── getTransaction.ts
│   │   ├── recentActivity.ts
│   │   └── simulateTransfer.ts
│   ├── index.ts
│   ├── solana.ts
│   └── validation.ts
├── tests/
│   ├── transaction.test.ts
│   └── validation.test.ts
├── .env.example
├── .gitignore
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
├── tsconfig.json
└── vitest.config.ts

Roadmap

  • SOL balance, SPL / Token-2022 accounts, transaction summary, recent activity

  • Unsigned transfer simulation with fee and compute units

  • Input validation and unit tests

  • Token metadata (name, symbol) for known mints

  • Simulation of SPL token transfers

  • Streamable HTTP transport in addition to stdio

  • Response caching and rate limiting for public RPC endpoints

Status

Experimental — devnet only, not audited.

Disclaimer

This is experimental software provided as-is, without warranty. It is not financial advice. Verify any on-chain data independently before relying on it.

License

MIT

Available Tools

5 tools
get_balanceGet SOL balanceA
Read-only

Returns the native SOL balance of a Solana address (in lamports and SOL).

Inputs: address (required).

get_token_accountsGet SPL token accountsB
Read-only

Lists SPL Token and Token-2022 accounts owned by an address, with mint, raw amount and decimals.

Inputs: owner (required), includeEmpty.

get_transactionGet transactionA
Read-only

Fetches a transaction by signature and returns a compact summary: status, fee, signers, programs called, SOL and token balance changes.

Inputs: signature (required), includeLogs.

recent_activityRecent activityA
Read-only

Returns the most recent transaction signatures that touched an address, newest first.

Inputs: address (required), limit, before.

simulate_transferSimulate SOL transferA
Read-only

Simulates a native SOL transfer without signing or sending it. Returns whether it would succeed, program logs, compute units and the network fee.

Inputs: to (required), from (required), amountSol (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: balance lookup, token account listing, transaction lookup by signature, recent address activity, and transfer simulation. The closest overlap is between get_transaction and recent_activity, but one is signature-specific and the other lists recent signatures, so selection is clear.

    Naming Consistency4/5

    Four of five tools follow a snake_case verb_noun pattern (get_balance, get_token_accounts, get_transaction, simulate_transfer). recent_activity is readable but breaks the verb-first convention slightly.

    Tool Count5/5

    Five tools is well-scoped for a Solana read/simulate inspection server. Each tool covers a distinct, useful operation without redundant surface area.

    Completeness4/5

    The server covers core inspection workflows: SOL balance, token accounts, transaction details, recent activity, and transfer simulation. Minor gaps exist, such as generic account lookup or token-transfer simulation, but the core read-only use cases are covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers