Solana MCP Server

by PingAIFun

Integrations

  • Optional integration that can be configured through an API key, though specific capabilities with OpenAI are not detailed in the README.

  • Provides tools for Solana blockchain interaction including executing transactions, querying accounts, managing wallets, deploying tokens, minting NFTs, checking balances, transferring tokens, and resolving domain names.

使用 Ping Agent Kit 构建的 MCP 服务器

模型上下文协议 (MCP) 服务器,为 AI 提供链上工具,通过标准化接口实现与 Solana 区块链的无缝交互。该实现基于 Ping Agent Kit 构建,允许 AI 代理高效地执行区块链操作。

概述

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

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

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

先决条件

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

安装

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

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

选项 2:从源代码构建

  1. 克隆此存储库:
git clone https://github.com/PingAIFun/ping-mcp.git cd ping-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": ["ping-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/ping-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 以使配置生效。

项目结构

ping-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

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议服务器通过提供与 Solana 区块链交互的工具来扩展 AI 功能,从而实现交易、帐户查询和钱包管理等操作。

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

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that enables Claude AI to interact with the Solana blockchain through a standardized interface, providing tools for transactions, account queries, and wallet management.
                      Last updated -
                      59
                      72
                      Apache 2.0
                      • Linux
                      • Apple
                    • -
                      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 -
                      59
                      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
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A Model Context Protocol server that provides onchain tools for Claude AI, allowing it to interact with the Solana blockchain through a standardized interface for operations like managing assets, executing token operations, and retrieving network information.
                      Last updated -
                      6
                      TypeScript

                    View all related MCP servers

                    ID: 4fxpwouhvx