MCP server for Solana blockchain operations.
Warning: make sure you understand what the bash script doing before executing it
curl -fsSL https://raw.githubusercontent.com/widnyana/solana-onchain-mcp/refs/heads/main/install.sh | bashThis downloads the latest release for your platform and installs to ~/.local/bin.
cargo install solana-onchain-mcpcargo install --git https://github.com/widnyana/solana-onchain-mcpRequires Rust 1.85+.
Start the server first:
SOLANA_NETWORK=devnet solana-onchain-mcp --port 3000.mcp.json:
{
"mcpServers": {
"solana": {
"url": "http://localhost:3000/mcp"
}
}
}.cursor/mcp.json:
{
"mcpServers": {
"solana": {
"url": "http://localhost:3000/mcp"
}
}
}.vscode/mcp.json (see MCP Server docs):
{
"servers": {
"solana": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}Start the server with keypair support (localhost only):
SOLANA_NETWORK=devnet SOLANA_KEYPAIR_PATH=/path/to/keypair.json \
solana-onchain-mcp --http-allow-keypair --accept-risk --host 127.0.0.1 --port 3000Then connect your client to http://localhost:3000/mcp.
| Tool | Description |
|---|---|
get_balance |
SOL balance for address |
get_account_info |
Account data and metadata |
get_multiple_accounts |
Batch fetch up to 100 accounts |
get_token_accounts_by_owner |
SPL token accounts for wallet |
get_program_accounts |
Accounts owned by program |
get_transaction |
Transaction by signature |
get_signatures_for_address |
Transaction history for address |
get_signature_status |
Transaction confirmation status |
get_slot |
Current slot/block height |
simulate_transaction |
Test transaction without signing |
inspect_transaction_raw |
Raw transaction with program names |
inspect_transaction_humanized |
Human-readable transaction summary |
get_server_info |
Server configuration and network info |
| Tool | Description |
|---|---|
transfer_sol |
Transfer SOL |
transfer_token |
Transfer SPL tokens |
create_associated_token_account |
Create token account |
approve_token |
Approve token delegate |
revoke_token |
Revoke token delegate |
close_token_account |
Close unused token account |
- Test thoroughly on devnet first
- Use a dedicated wallet with minimal funds
- Verify all transaction parameters
- Set
SOLANA_ACCEPT_RISK=trueor use--accept-riskflag
See Mainnet Usage for details.
See USAGE.md for configuration, parameters, and security.
- Rust 1.85+ (edition 2024)
- Solana RPC access
MIT
