Solana Agent Kit MCP Server
Visit ProjectA Solana Agent Kit implementation using the Model Context Protocol (MCP) for handling protocol operations on the Solana blockchain.
Visit ProjectCategory
Tags
What is Solana Agent Kit MCP Server?
Solana Agent Kit MCP Server is a Solana Agent Kit implementation that uses the Model Context Protocol (MCP) to enable Claude AI to interact with the Solana blockchain. It serves as an onchain toolkit that standardizes blockchain operations for AI agents, allowing seamless transactions, account queries, and wallet management on the Solana network.
How to use Solana Agent Kit MCP Server?
You can install and use the Solana MCP server through multiple methods:
-
Quick Install (Recommended): Use the installation script for an interactive setup
curl -fsSL https://raw.githubusercontent.com/sendaifun/solana-mcp/main/scripts/install.sh -o solana-mcp-install.sh chmod +x solana-mcp-install.sh && ./solana-mcp-install.sh --backup
-
npm Install: For direct use with CLI tools or project integration
npm install -g solana-mcp # or npm install solana-mcp
-
Building from Source: For developers who want to modify the project
git clone https://github.com/sendaifun/solana-mcp cd solana-mcp pnpm install pnpm run build
After installation, configure the environment variables in the .env
file and integrate the MCP server with Claude Desktop by modifying the configuration file:
{
"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"
},
"disabled": false,
"autoApprove": []
}
}
}
Key features of Solana Agent Kit MCP Server?
- Blockchain Integration: Allows Claude AI to interact with the Solana blockchain via standardized MCP interfaces
- Wallet Management: Seamlessly manage Solana wallets for AI agent operations
- Transaction Execution: Execute various blockchain operations including token deployments and transfers
- Account Queries: Retrieve account information such as balances and asset details
- NFT Support: Capabilities for creating and minting new NFTs
- Security Focus: Emphasizes secure handling of private keys and sensitive operations
- Multi-environment Support: Works on mainnet, testnet, and devnet for testing and production
Use cases of Solana Agent Kit MCP Server?
- Automated Blockchain Operations: AI agents can autonomously execute trades, transfers, and queries
- Token Deployment: Automate the deployment of new tokens on Solana
- Wallet Management: AI agents can manage and interact with Solana wallets securely
- NFT Operations: Create and mint NFTs programmatically
- Transaction Monitoring: Get real-time insights on blockchain transactions per second
- Development Testing: Easily request funds for testnet/development purposes
- Domain Resolution: Resolve Solana domain names automatically
FAQ about Solana Agent Kit MCP Server?
- What is the primary purpose of the MCP server?
It extends Claude AI's capabilities by providing tools to interact with the Solana blockchain and execute operations like token transfers and NFT minting.
- What are the system requirements?
Node.js (v16 or higher) and pnpm/npm/yarn are required. A Solana wallet with a private key and an RPC URL are also needed.
- How do I secure my private key?
Store your private key in environment variables and never share it. Consider using a dedicated wallet for AI operations.
- Can I test operations before mainnet deployment?
Yes, the server supports testnet and devnet environments for testing before moving to mainnet.
- What if I encounter errors during setup?
Verify your private key, check your RPC URL is correct, ensure the right network is selected, and examine Claude Desktop logs for error messages.
Solana Agent Kit MCP Server
A Model Context Protocol (MCP) server that provides onchain tools for Claude AI, allowing it to interact with the Solana blockchain through a standardized interface. This implementation is based on the Solana Agent Kit and enables AI agents to perform blockchain operations seamlessly.
Overview
This MCP server extends Claude's capabilities by providing tools to:
- Interact with Solana blockchain
- Execute transactions
- Query account information
- Manage Solana wallets
The server implements the Model Context Protocol specification to standardize blockchain interactions for AI agents.
Prerequisites
- Node.js (v16 or higher)
- pnpm (recommended), npm, or yarn
- Solana wallet with private key
- Solana RPC URL (mainnet, testnet, or devnet)
Installation
Option 1: Quick Install (Recommended)
# 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
This will start an interactive installation process that will guide you through:
- Setting up Node.js if needed
- Configuring your Solana RPC URL and private key
- Setting up the Claude Desktop integration
Option 2: Install from npm ( recommend for clients like Cursor/Cline)
# Install globally
npm install -g solana-mcp
# Or install locally in your project
npm install solana-mcp
Option 3: Build from Source
- Clone this repository:
git clone https://github.com/sendaifun/solana-mcp
cd solana-mcp
- Install dependencies:
pnpm install
- Build the project:
pnpm run build
Configuration
Environment Setup
Create a .env
file with your credentials:
# Solana Configuration
SOLANA_PRIVATE_KEY=your_private_key_here
RPC_URL=your_solana_rpc_url_here
OPENAI_API_KEY=your_openai_api_key # OPTIONAL
Integration with Claude Desktop
To add this MCP server to Claude Desktop, follow these steps:
-
Locate the Claude Desktop Configuration File
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
Add the Configuration Create or edit the configuration file and add the following JSON:
If you installed via npm (Option 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": [] } } }
If you built from source (Option 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": [] } } }
-
Restart Claude Desktop After making these changes, restart Claude Desktop for the configuration to take effect.
Project Structure
solana-agent-kit-mcp/
āāā src/
ā āāā index.ts # Main entry point
āāā package.json
āāā tsconfig.json
Available Tools
The MCP server provides the following Solana blockchain tools:
GET_ASSET
- Retrieve information about a Solana asset/tokenDEPLOY_TOKEN
- Deploy a new token on SolanaGET_PRICE
- Fetch price information for tokensWALLET_ADDRESS
- Get the wallet addressBALANCE
- Check wallet balanceTRANSFER
- Transfer tokens between walletsMINT_NFT
- Create and mint new NFTsTRADE
- Execute token tradesREQUEST_FUNDS
- Request funds (useful for testing/development)RESOLVE_DOMAIN
- Resolve Solana domain namesGET_TPS
- Get current transactions per second on Solana
Security Considerations
- Keep your private key secure and never share it
- Use environment variables for sensitive information
- Consider using a dedicated wallet for AI agent operations
- Regularly monitor and audit AI agent activities
- Test operations on devnet/testnet before mainnet
Troubleshooting
If you encounter issues:
- Verify your Solana private key is correct
- Check your RPC URL is accessible
- Ensure you're on the intended network (mainnet, testnet, or devnet)
- Check Claude Desktop logs for error messages
- Verify the build was successful
Dependencies
Key dependencies include:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License.