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.
Integrations
Uses dotenv for environment variable management to securely store configuration like private keys and API endpoints.
Can use Alchemy as an RPC endpoint provider for connecting to the Solana blockchain.
Supports integration with OpenAI models (like ChatGPT) as AI agents that can perform DeFi operations on Solana through the MCP server.
Solana MCP(模型上下文协议)
一个强大的模型上下文协议 (MCP) 服务器,用于 AI 代理与 Solana 区块链和 DeFi 协议进行交互。
🚀 概述
Solana MCP 为 AI 代理(如 Claude、ChatGPT 等)提供了标准化接口,以便在 Solana 区块链上执行 DeFi 操作。它弥合了人工智能与去中心化金融之间的差距,使 AI 系统能够:
- 查询钱包余额和代币持有量
- 转移 SOL 和 SPL 代币
- 执行代币交换
- 获取实时价格数据
- 执行高级 DeFi 操作
该工具建立在Solana Agent Kit和模型上下文协议 (MCP) 之上,为自动化 DeFi 操作提供了安全、高效和标准化的接口。
📋 先决条件
- Node.js v22.x 或更高版本
- npm 或 yarn 包管理器
- Solana 钱包(密钥对)
- Solana 的 RPC 端点(例如 Helius、Alchemy 或您自己的节点)
🔧 安装
- 克隆此存储库:
- 安装依赖项:
- 在根目录中创建一个
.env
文件,其中包含以下变量:
⚠️安全警告:切勿提交你的
.env
文件或暴露你的私钥。请将.env
添加到你的.gitignore
文件中。
- 构建项目:
🚀 使用方法
启动 MCP 服务器:
成功启动后,您应该看到:
💬 可用操作
通过 MCP 服务器可以进行以下 DeFi 操作:
行动 | 描述 |
---|---|
get_wallet | 获取当前钱包地址 |
check_balance | 检查钱包的 SOL 余额 |
transfer_sol | 将 SOL 转移到另一个钱包 |
list_tokens | 列出钱包中的所有代币 |
fetch_price | 获取代币的当前价格 |
trade_tokens | 执行代币之间的交易 |
get_tps | 获取当前 Solana 网络 TPS |
swap_tokens | 通过流动性池交换代币 |
🔌 与 AI 模型集成
该 MCP 服务器旨在与支持模型上下文协议 (MCP) 的 AI 模型配合使用。该服务器使用标准输入/输出进行通信,从而兼容各种 AI 集成框架。
与 Claude 一起使用的示例:
🔒 安全注意事项
- 执行交易前务必检查交易
- 考虑实施交易限制
- 通过适当的密钥管理实践保护您的私钥
- 使用资金有限的专用钱包进行测试
- 监视任何可疑活动
🛠️高级配置
对于更高级的配置,您可以修改以下文件:
src/index.ts
:主入口点.env
:环境配置
📚 资源
📄 许可证
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
🤝 贡献
欢迎贡献代码!欢迎提交 Pull 请求。
- 分叉项目
- 创建你的功能分支(
git checkout -b feature/amazing-feature
) - 提交您的更改(
git commit -m 'Add some amazing feature'
) - 推送到分支(
git push origin feature/amazing-feature
) - 打开拉取请求
This server cannot be installed
模型上下文协议服务器使 AI 代理能够与 Solana 区块链交互以执行 DeFi 操作,例如检查余额、转移代币、执行交换和获取价格数据。
- 🚀 Overview
- 📋 Prerequisites
- 🔧 Installation
- 🚀 Usage
- 💬 Available Actions
- 🔌 Integration with AI Models
- 🔒 Security Considerations
- 🛠️ Advanced Configuration
- 📚 Resources
- 📄 License
- 🤝 Contributing