Solana Agent Kit MCP Server

Apache 2.0
60
69
  • Linux
  • Apple

Integrations

  • Enables interaction with the Solana blockchain, including retrieving asset information, deploying tokens, checking balances, transferring tokens, minting NFTs, executing trades, and resolving domain names.

Solana 代理套件 MCP 服务器

模型上下文协议 (MCP) 服务器,为 Claude AI 提供链上工具,使其能够通过标准化接口与 Solana 区块链交互。此实现基于 Solana 代理套件,使 AI 代理能够无缝地执行区块链操作。

概述

该 MCP 服务器通过提供以下工具扩展了 Claude 的功能:

  • 与 Solana 区块链交互
  • 执行交易
  • 查询账户信息
  • 管理 Solana 钱包

该服务器实现了模型上下文协议规范,以标准化人工智能代理的区块链交互。

先决条件

  • Node.js(v16 或更高版本)
  • pnpm(推荐)、npm 或 yarn
  • 带有私钥的 Solana 钱包
  • Solana RPC URL(主网、测试网或开发网)

安装

选项 1:快速安装(推荐)

# Download the installation script curl -fsSL https://raw.githubusercontent.com/sendaifun/solana-mcp/main/scripts/install.sh -o solana-mcp-install.sh # Make it executable and run chmod +x solana-mcp-install.sh && ./solana-mcp-install.sh --backup

这将启动交互式安装过程,指导您完成:

  • 如果需要,设置 Node.js
  • 配置 Solana RPC URL 和私钥
  • 设置 Claude Desktop 集成

选项 2:从 npm 安装(推荐用于 Cursor/Cline 等客户端)

# Install globally npm install -g solana-mcp # Or install locally in your project npm install solana-mcp

选项 3:从源代码构建

  1. 克隆此存储库:
git clone https://github.com/sendaifun/solana-mcp cd solana-mcp
  1. 安装依赖项:
pnpm install
  1. 构建项目:
pnpm run build

配置

环境设置

使用您的凭证创建一个.env文件:

# Solana Configuration SOLANA_PRIVATE_KEY=your_private_key_here RPC_URL=your_solana_rpc_url_here OPENAI_API_KEY=your_openai_api_key # OPTIONAL

与 Claude Desktop 集成

要将此 MCP 服务器添加到 Claude Desktop,请按照以下步骤操作:

  1. 找到 Claude 桌面配置文件
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. 添加配置创建或编辑配置文件并添加以下 JSON:如果您通过 npm 安装(选项 1):
    { "mcpServers": { "solana-mcp": { "command": "npx", "args": ["solana-mcp"], "env": { "RPC_URL": "your_solana_rpc_url_here", "SOLANA_PRIVATE_KEY": "your_private_key_here", "OPENAI_API_KEY": "your_openai_api_key" // OPTIONAL }, "disabled": false, "autoApprove": [] } } }
    如果您从源代码构建(选项 2):
    { "mcpServers": { "solana-mcp": { "command": "node", "args": ["/path/to/solana-mcp/build/index.js"], "env": { "RPC_URL": "your_solana_rpc_url_here", "SOLANA_PRIVATE_KEY": "your_private_key_here", "OPENAI_API_KEY": "your_openai_api_key" // OPTIONAL }, "disabled": false, "autoApprove": [] } } }
  3. 重新启动 Claude Desktop完成这些更改后,重新启动 Claude Desktop 以使配置生效。

项目结构

solana-agent-kit-mcp/ ├── src/ │ ├── index.ts # Main entry point ├── package.json └── tsconfig.json

可用工具

MCP 服务器提供以下 Solana 区块链工具:

  • GET_ASSET - 检索有关 Solana 资产/代币的信息
  • DEPLOY_TOKEN - 在 Solana 上部署新代币
  • GET_PRICE - 获取代币价格信息
  • WALLET_ADDRESS - 获取钱包地址
  • BALANCE - 检查钱包余额
  • TRANSFER - 在钱包之间转移代币
  • MINT_NFT - 创建并铸造新的 NFT
  • TRADE - 执行代币交易
  • REQUEST_FUNDS - 请求资金(用于测试/开发)
  • RESOLVE_DOMAIN - 解析 Solana 域名
  • GET_TPS - 获取 Solana 上每秒的当前交易量

安全注意事项

  • 确保你的私钥安全,切勿与他人分享
  • 使用环境变量来获取敏感信息
  • 考虑使用专用钱包进行AI代理操作
  • 定期监控和审计AI代理活动
  • 在主网之前在 devnet/testnet 上进行测试操作

故障排除

如果您遇到问题:

  1. 验证您的 Solana 私钥是否正确
  2. 检查您的 RPC URL 是否可访问
  3. 确保您位于目标网络(主网、测试网或开发网)上
  4. 检查 Claude Desktop 日志中的错误消息
  5. 验证构建是否成功

依赖项

关键依赖项包括:

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

  1. 分叉存储库
  2. 创建你的功能分支( git checkout -b feature/amazing-feature
  3. 提交您的更改( git commit -m 'Add some amazing feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求

执照

该项目已获得 MIT 许可。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器,使 Claude AI 能够通过标准化接口与 Solana 区块链进行交互,提供交易、账户查询和钱包管理的工具。

  1. 概述
    1. 先决条件
      1. 安装
        1. 选项 1:快速安装(推荐)
        2. 选项 2:从 npm 安装(推荐用于 Cursor/Cline 等客户端)
        3. 选项 3:从源代码构建
      2. 配置
        1. 环境设置
        2. 与 Claude Desktop 集成
      3. 项目结构
        1. 可用工具
          1. 安全注意事项
            1. 故障排除
              1. 依赖项
                1. 贡献
                  1. 执照

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model-Context-Protocol server enabling users to perform basic operations on Solana and Ethereum blockchains through simple RPC endpoints.
                      Last updated -
                      10
                      51
                      TypeScript
                      Apache 2.0
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that provides Claude with comprehensive access to Solana blockchain data via the Helius API, enabling operations like checking wallet balances, retrieving blockchain information, and interacting with tokens and NFTs.
                      Last updated -
                      119
                      8
                      TypeScript
                      MIT License
                      • Apple
                      • Linux
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server enabling AI agents to interact with the Solana blockchain for DeFi operations like checking balances, transferring tokens, executing swaps, and fetching price data.
                      Last updated -
                      60
                      15
                      TypeScript
                      MIT License
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that enables AI models to interact with the Solana blockchain, providing RPC methods, wallet management, DeFi trading capabilities, and Helius API integration for enhanced Solana development.
                      Last updated -
                      TypeScript
                      MIT License

                    View all related MCP servers

                    ID: 6yukeoy0bb