A Model Context Protocol (MCP) server providing comprehensive access to the Solana blockchain via the OpenSVM API.
The OpenSVM MCP server enables AI assistants and applications to interact with the Solana blockchain through 33 specialized tools and direct RPC access to 90+ standard Solana methods.
Key Features:
- 🔍 Account Analytics - Query balances, token holdings, transaction history
- 💸 Transaction Analysis - Detailed transaction parsing with AI-powered insights
- 📊 DeFi Data - Real-time TVL, volume, and protocol analytics
- 🪙 Token Information - Metadata, supply, holders, and price data
- ⛓️ Block Explorer - Block data, validator analytics, and network statistics
- 🔌 Direct RPC Access - Call any of 90+ Solana RPC methods via
solana_rpc_call
# Clone the repository
git clone https://github.com/openSVM/osvm-mcp.git
cd osvm-mcp
# Install dependencies
npm install
# Build the server
npm run buildAdd to your Claude Desktop configuration:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"osvm-mcp": {
"command": "node",
"args": ["/path/to/osvm-mcp/build/index.js"],
"env": {
"OPENSVM_API_KEY": "your-api-key-here"
}
}
}
}# Already configured if you're using osvm CLI
osvm mcp list
# Test a tool
osvm mcp call osvm-mcp get_account_stats --args '{"address":"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"}'| Tool | Purpose |
|---|---|
get_account_stats |
Transaction statistics (total transactions, token transfers) |
get_account_portfolio |
Complete portfolio with SOL balance, tokens, prices, total value |
get_solana_balance |
SOL balance and token holdings (same as portfolio) |
get_account_transactions |
Paginated transaction history |
get_account_token_stats |
Token-specific statistics for an account |
check_account_type |
Identify account type (wallet, program, token, etc.) |
| Tool | Purpose |
|---|---|
get_transaction |
Detailed transaction with instructions, accounts, balances, logs |
batch_transactions |
Fetch up to 20 transactions in one call |
analyze_transaction |
AI-powered transaction analysis (programs, tokens, risk) |
explain_transaction |
Natural language explanation of transaction |
| Tool | Purpose |
|---|---|
get_block |
Block data by slot number |
get_recent_blocks |
List recent blocks with pagination |
get_block_stats |
Network performance metrics (TPS, block time) |
| Tool | Purpose |
|---|---|
get_defi_overview |
DeFi ecosystem overview (TVL, volume, top protocols) |
get_dex_analytics |
DEX-specific trading analytics |
get_defi_health |
DeFi ecosystem health indicators |
get_validator_analytics |
Validator network statistics |
| Tool | Purpose |
|---|---|
get_token_info |
SPL token metadata, supply, decimals, holders |
get_token_metadata |
Batch fetch metadata for multiple tokens |
get_nft_collections |
NFT collection stats (floor price, volume) |
get_trending_nfts |
Trending NFT collections by volume |
| Tool | Purpose |
|---|---|
universal_search |
Search across accounts, transactions, tokens, programs |
search_accounts |
Advanced account search with balance/token filters |
| Tool | Purpose |
|---|---|
solana_rpc_call |
Direct access to 90+ Solana RPC methods |
verify_wallet_signature |
Verify wallet signatures for authentication |
get_program_registry |
List registered Solana programs |
get_program_info |
Program metadata and verification status |
report_error |
Report client-side errors for telemetry |
| Tool | Purpose |
|---|---|
get_balance |
SVMAI token balance for API billing (requires JWT) |
get_usage_stats |
API usage statistics (requires JWT) |
manage_api_keys |
Manage Anthropic API keys (requires JWT) |
Total: 33 tools + direct RPC access
osvm mcp call osvm-mcp get_account_portfolio --args '{
"address": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
}'Returns:
{
"address": "vines1...",
"timestamp": "2025-10-28T06:22:19.028Z",
"data": {
"native": {
"balance": 0,
"symbol": "SOL",
"price": 202.02,
"value": 0
},
"tokens": [],
"totalValue": 0
}
}osvm mcp call osvm-mcp get_transaction --args '{
"signature": "2rzXJ5ntftwV9RnrDvxxqPLAtGUphVrrWemZpkaxEuFqGNE2sckNZXSYfMg4rvayJXdx9roM7MinTtpUULbp35yG"
}'osvm mcp call osvm-mcp solana_rpc_call --args '{
"method": "getSlot"
}'Returns current slot number:
{
"jsonrpc": "2.0",
"result": 376301301,
"id": 1761543291769
}osvm mcp call osvm-mcp get_defi_overview --args '{}'Returns:
{
"totalTvl": 1385500000,
"totalVolume24h": 2703866854.95,
"activeDexes": 41,
"topProtocols": [
{"name": "raydium", "tvl": 0, "volume24h": 647361015},
{"name": "jupiter", "tvl": 950000000, "volume24h": 45000000}
]
}See EXAMPLES.md for more usage examples.
Run the comprehensive test suite:
./test-mcp-server.shCurrent Coverage: 35/35 tests passing (100% of tested tools)
The test suite validates:
- JSON response format
- Required fields presence
- Data type correctness
- Null value handling
- API endpoint connectivity
npm run buildnpm run watchUse the MCP Inspector for debugging:
npm run inspectorThe Inspector provides a web UI for testing tools and viewing requests/responses.
osvm-mcp/
├── src/
│ └── index.ts # Main MCP server implementation
├── build/ # Compiled JavaScript output
├── test-mcp-server.sh # Comprehensive test suite
├── llms.txt # Tool documentation for LLMs
└── README.md # This file
All tool names use lowercase with underscores (snake_case):
- ✅
get_account_transactions(correct) - ❌
GET_ACCOUNT_TRANSACTIONS(wrong - will fail!)
All tools return MCP-compliant responses:
{
"content": [{
"type": "text",
"text": "{...json data...}"
}]
}Errors follow MCP error codes:
InvalidParams- Invalid or missing parametersMethodNotFound- Unknown tool nameInternalError- API or network errors
Example error:
{
"error": {
"code": -32602,
"message": "Invalid Solana address format"
}
}Some tools require authentication:
export OPENSVM_API_KEY="your-api-key-here"export OPENSVM_JWT_TOKEN="your-jwt-token"Tools requiring authentication:
get_balance(SVMAI token balance)get_usage_stats(API usage tracking)manage_api_keys(API key management)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass:
./test-mcp-server.sh - Submit a pull request
- Define the tool in
getToolDefinitions() - Implement the handler in
handleToolCall() - Add validation and error handling
- Add tests in
test-mcp-server.sh - Update documentation
Cause: Tool name case mismatch
Solution: Use lowercase with underscores (e.g., get_account_transactions)
Cause: JWT required but not provided
Solution: Only affects get_balance, get_usage_stats, manage_api_keys
Cause: Network issues or API downtime Solution: Check https://osvm.ai/status
- Documentation: llms.txt - Complete tool reference
- Examples: EXAMPLES.md - Common use cases
- OpenSVM API: https://osvm.ai/api
- MCP Specification: https://modelcontextprotocol.io
- GitHub Issues: https://github.com/openSVM/osvm-mcp/issues
MIT License - see LICENSE for details
- Issues: https://github.com/openSVM/osvm-mcp/issues
- Discord: https://discord.gg/opensvm
- Docs: https://docs.osvm.ai
Built with ❤️ by the OpenSVM team