Adapters
MCP
Run wallet as a Model Context Protocol server.
Connect wallet to any AI agent that supports MCP.
Installation
npm install @agentic-wallet/adapters-mcp @agentic-wallet/solana @modelcontextprotocol/sdkCode
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { registerWithMcp } from "@agentic-wallet/adapters-mcp";
import { createSolanaKeypairFromSecretKey, createKeypairProvider, SolanaAgentWallet } from "@agentic-wallet/solana"
import { raydiumPlugin, jupiterPlugin, snsPlugin, pumpfunPlugin } from "@agentic-wallet/solana/plugin";
const server = new McpServer({
name: "Solana Agentic Wallet",
version: "1.0.0",
});
const wallet = new SolanaAgentWallet({
rpcUrl: process.env.SOLANA_RPC_URL!,
provider: createKeypairProvider(process.env.SOLANA_PRIVATE_KEY!),
})
.use(raydiumPlugin({
cluster: "mainnet",
}))
.use(jupiterPlugin({
apiKey: process.env.JUPITER_API_KEY,
}))
.use(snsPlugin())
.use(pumpfunPlugin())
async function main() {
registerWithMcp(server, wallet);
const transport = new StdioServerTransport();
await server.connect(transport);
}
main().catch((err) => {
console.error("Fatal error:", err);
process.exit(1);
}); Run
bun src/index.tsConfigure
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"solana-wallet": {
"command": "bun",
"args": ["/path/to/src/index.ts"],
"env": {
"SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com",
"SOLANA_PRIVATE_KEY": "your_key"
}
}
}
}Sample Prompts
"What's my wallet address?"
"What's my SOL balance?"
"Swap 0.1 SOL for USDC"