Skip to main content
Glama

solana-mcp-server

npm version License: MIT Node Tools

功能完整的 Solana 区块链 MCP 服务器。 提供 25 种工具,涵盖钱包管理、SPL 代币操作、DeFi、质押和网络查询。基于 @solana/web3.js 和 @solana/spl-token 构建,并支持 Anchor。

这是目前维护最活跃的 Solana MCP。它涵盖了竞争对手所忽略的完整 SPL 代币生命周期(创建、铸造、销毁、冻结、解冻、授权、权限管理)。

安装

npx solana-mcp-server

或全局安装:

npm install -g solana-mcp-server
solana-mcp-server

Related MCP server: SolanaBot

配置

添加到您的 MCP 配置文件(claude_desktop_config.json 或 ~/.mcp.json):

{
  "mcpServers": {
    "solana": {
      "command": "npx",
      "args": ["-y", "solana-mcp-server"],
      "env": {
        "SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com"
      }
    }
  }
}

工具 (25)

钱包管理 (4)

工具

描述

关键参数

create_wallet

创建一个新的 Solana 密钥对(仅在内存中)

--

import_wallet

从 base58 编码的私钥导入

privateKey

list_wallets

列出当前会话中的所有钱包

--

get_balance

获取任意地址的 SOL 余额

address

SPL 代币操作 (10)

工具

描述

关键参数

create_spl_token

创建具有自定义小数位的新 SPL 代币

walletName, decimals

mint_tokens

向任意地址铸造代币

walletName, tokenMint, amount

burn_tokens

从账户中销毁代币

walletName, tokenMint, amount

freeze_account

冻结代币账户

walletName, tokenMint, accountAddress

thaw_account

解冻代币账户

walletName, tokenMint, accountAddress

set_token_authority

更改代币权限(铸造、冻结、所有者、关闭)

walletName, tokenMint, authorityType

get_token_supply

代币的总供应量和元数据

tokenMint

close_token_account

关闭账户并收回租金

walletName, tokenAccount

approve_delegate

批准代币转账的代理人

walletName, tokenAccount, delegate, amount

revoke_delegate

撤销代理人批准

walletName, tokenAccount

转账 (3)

工具

描述

关键参数

transfer_sol

在钱包之间转账 SOL

from, to, amount

transfer_tokens

转账 SPL 代币

from, to, tokenMint, amount

airdrop_sol

请求 SOL 空投(仅限 devnet/testnet)

address, amount

账户查询 (4)

工具

描述

关键参数

get_account_info

详细的账户信息

address

get_transaction

通过签名获取交易详情

signature

create_token_account

创建关联代币账户

walletName, tokenMint

get_token_accounts

列出钱包的所有代币账户

address

代币数据 (1)

工具

描述

关键参数

get_token_balance

特定账户的 SPL 代币余额

address, tokenMint

网络 (3)

工具

描述

关键参数

switch_network

在主网、开发网、测试网、本地主机之间切换

network

get_network_info

当前网络状态和信息

--

get_recent_blockhash

用于构建交易的最近区块哈希

--

为什么选择这个?

  • 完整的 SPL 代币生命周期。 创建、铸造、销毁、冻结、解冻、设置权限、代理、关闭——10 个代币工具涵盖了所有操作。竞争对手通常只支持创建/转账。

  • 生产就绪的基础设施。 延迟连接初始化(无启动超时)、10 秒网络调用超时、全面的错误处理以及 Smithery 部署支持。

  • Anchor 集成。 内置对 @coral-xyz/anchor 的支持,可与 Anchor 程序以及原始 SPL 代币操作进行交互。

网络

网络

端点

mainnet

https://api.mainnet-beta.solana.com

devnet

https://api.devnet.solana.com

testnet

https://api.testnet.solana.com

localhost

http://127.0.0.1:8899

安全性

  • 私钥仅存储在内存中——绝不持久化到磁盘

  • 进程退出时清除密钥

  • 所有输入均通过 Zod 模式进行验证

环境变量

变量

必需

描述

SOLANA_RPC_URL

否

Solana RPC 端点(默认:主网)

开发

git clone https://github.com/ExpertVagabond/solana-mcp-server.git
cd solana-mcp-server
npm install
npm run build
npm start
npm test              # Basic functionality tests
npm run type-check    # TypeScript type checking
npm run lint          # ESLint
npm run quality       # Full quality check (lint + types + tests)

许可证

MIT -- Purple Squirrel Media

Available Tools

25 tools
airdrop_solA

Request SOL airdrop for testing (devnet/testnet only)

Inputs: walletName (required), amount.

approve_delegateC

Approve a delegate to transfer tokens on your behalf

Inputs: amount (required), tokenMint (required), walletName (required), delegateAddress (required).

burn_tokensC

Burn tokens from a wallet

Inputs: amount (required), tokenMint (required), walletName (required).

close_token_accountC

Close a token account and reclaim rent

Inputs: tokenMint (required), walletName (required), destinationAddress (required).

create_spl_tokenC

Create a new SPL token with specified decimals

Inputs: walletName (required), decimals, freezeAuthority.

create_token_accountC

Create associated token account for SPL tokens

Inputs: tokenMint (required), walletName (required).

create_walletC

Create a new Solana wallet

Inputs: name (required).

freeze_accountB

Freeze a token account to prevent transfers

Inputs: tokenMint (required), walletName (required), accountAddress (required).

get_account_infoC

Get detailed account information

Inputs: address (required).

get_balanceC

Get SOL balance for a wallet

Inputs: walletName (required).

get_network_infoC

Get current network information

Inputs: no named parameters.

get_recent_blockhashB

Get recent blockhash for transaction building

Inputs: no named parameters.

get_token_accountsC

Get all token accounts for a wallet

Inputs: walletName (required).

get_token_balanceC

Get SPL token balance for a wallet

Inputs: tokenMint (required), walletName (required).

get_token_supplyC

Get the total supply of a token

Inputs: tokenMint (required).

get_transactionC

Get transaction details by signature

Inputs: signature (required).

import_walletC

Import an existing wallet from private key or mnemonic

Inputs: name (required), privateKey (required).

list_walletsB

List all created/imported wallets

Inputs: no named parameters.

mint_tokensC

Mint tokens to a specific account

Inputs: amount (required), tokenMint (required), walletName (required), destinationAddress (required).

revoke_delegateB

Revoke a delegate's authority to transfer tokens

Inputs: tokenMint (required), walletName (required).

set_token_authorityC

Set or change authority for a token mint or account

Inputs: tokenMint (required), walletName (required), authorityType (required), newAuthority.

switch_networkC

Switch Solana network

Inputs: network (required).

thaw_accountC

Thaw a frozen token account to allow transfers

Inputs: tokenMint (required), walletName (required), accountAddress (required).

transfer_solC

Transfer SOL between wallets

Inputs: amount (required), toAddress (required), fromWallet (required).

transfer_tokensC

Transfer SPL tokens between wallets

Inputs: amount (required), toAddress (required), tokenMint (required), fromWallet (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 25 tools

    Disambiguation4/5

    Most tools have distinct purposes, but some overlap exists, such as get_balance and get_token_balance, which could cause confusion if not carefully described. However, the descriptions generally clarify the differences, and tools like freeze_account and thaw_account are clearly complementary.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as create_wallet, transfer_sol, and get_account_info. This uniformity makes the tool set predictable and easy to navigate.

    Tool Count3/5

    With 25 tools, the count is borderline high for a focused server, potentially overwhelming for agents. While it covers many Solana operations, it might benefit from consolidation or better scoping to reduce complexity.

    Completeness5/5

    The tool set provides comprehensive coverage for Solana operations, including wallet management, token handling, transactions, and network interactions. It supports full CRUD/lifecycle actions, such as create, transfer, and burn tokens, with no obvious gaps.

    Maintenance

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    Appeared in Searches