MCP Adapter
Create a Model Context Protocol server for the Solana Agent Kit
MCP Adapter
The @solana-agent-kit/adapter-mcp
adapter provides a framework for creating a Model Context Protocol (MCP) server to handle protocol operations on the Solana blockchain using the Solana Agent Kit.
Installation
Install the adapter alongside the core Solana Agent Kit and your desired plugins:
Features
- Supports all actions from the Solana Agent Kit
- MCP server implementation for standardized interactions with Claude Desktop
- Environment-based configuration
- Selective action exposure
Prerequisites
- Node.js (v16 or higher recommended)
- pnpm, yarn, or npm
- Solana wallet with private key
- Solana RPC URL
- Claude Desktop application
Basic Setup
Create a new project for your MCP server:
Install the required dependencies:
Create a .env
file in your project root:
Create an index.js
file with the following code:
Update your package.json
to add the type
field:
Claude Desktop Configuration
-
Open the Claude Desktop configuration file:
MacOS:
Windows:
-
Add your MCP server configuration:
Replace the path with the absolute path to your
index.js
file. -
Restart Claude Desktop after updating the configuration.
Customizing Available Actions
You can customize which actions are available to Claude by modifying the finalActions
object:
Testing the Integration
-
Start your MCP server (if running manually):
-
Open Claude Desktop and ask questions about Solana, like:
- “What’s my SOL balance?”
- “Show me my token balances”
- “What’s my wallet address?”
Claude will use your MCP server to interact with the Solana blockchain and provide responses based on the available actions.
For more detailed information, please refer to the full documentation at docs.sendai.fun.
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)
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 (Recommended for clients like Cursor/Cline)
Option 3: Build from Source
- Clone this repository:
- Install dependencies:
- Build the project:
Configuration
Environment Setup
Create a .env
file with your credentials:
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):
If you built from source (Option 2):
-
Restart Claude Desktop After making these changes, restart Claude Desktop for the configuration to take effect.
Project Structure
Available Tools
The MCP server provides all the Solana Agent Kit tools like:
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.