Solana去中心化金融
STDIOAI代理与索拉纳区块链交互的MCP服务器
AI代理与索拉纳区块链交互的MCP服务器
A powerful Model Context Protocol (MCP) server for AI agents to interact with the Solana blockchain and DeFi protocols.
Solana MCP provides a standardized interface for AI agents (like Claude, ChatGPT, etc.) to perform DeFi operations on the Solana blockchain. It bridges the gap between artificial intelligence and decentralized finance, allowing AI systems to:
Built on top of the Solana Agent Kit and the Model Context Protocol (MCP), this tool provides a secure, efficient, and standardized interface for automated DeFi operations.
git clone https://github.com/caiovicentino/Solana-MCP.git cd Solana-MCP
npm install
.env
file in the root directory with the following variables:SOLANA_PRIVATE_KEY=your_private_key_here
RPC_URL=your_rpc_url_here
OPENAI_API_KEY=optional_if_using_openai
⚠️ Security Warning: Never commit your
.env
file or expose your private key. Add.env
to your.gitignore
file.
npm run build
Start the MCP server:
npm start
When successfully started, you should see:
✅ Connected to Solana
🔗 Using RPC: [your-rpc-endpoint]
👛 Wallet configured: [your-wallet-address]
🚀 Starting Yield AI MCP Server...
📊 Available DeFi actions: 8
✨ Yield AI MCP Server started. Ready to perform DeFi operations on Solana!
The following DeFi actions are available through the MCP server:
Action | Description |
---|---|
get_wallet | Get the current wallet address |
check_balance | Check SOL balance of the wallet |
transfer_sol | Transfer SOL to another wallet |
list_tokens | List all tokens in the wallet |
fetch_price | Fetch current price of a token |
trade_tokens | Execute a trade between tokens |
get_tps | Get current Solana network TPS |
swap_tokens | Swap tokens via liquidity pools |
This MCP server is designed to be used with AI models that support the Model Context Protocol. The server uses standard input/output for communication, making it compatible with various AI integration frameworks.
Example of using with Claude:
// Example code for integrating with Claude API // (Placeholder - actual integration depends on your specific AI framework)
For more advanced configurations, you can modify the following files:
src/index.ts
: Main entry point.env
: Environment configurationThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)