RAG-powered MCP server for Solana runtime and SIMDs
Project description
solana-mcp
RAG-powered MCP server for Solana runtime, SIMDs, and validator client source code.
What It Does
Indexes and searches across:
- Agave - Reference Rust validator (Anza)
- Jito-Solana - MEV-enabled fork
- Jito Programs - On-chain tip distribution and MEV programs
- Firedancer - Jump's C implementation
- SIMDs - Solana Improvement Documents
- Alpenglow - Future consensus protocol (not yet live)
Installation
# From PyPI
pip install sol-mcp
# From source
pip install -e .
# With Voyage API embeddings (best quality)
pip install -e ".[voyage]"
Quick Start
# Build the index (downloads repos + creates embeddings)
solana-mcp build
# Search
solana-mcp search "stake delegation"
# Check status
solana-mcp status
Features
Incremental Indexing
The v0.2.0 release introduces incremental indexing - only re-embeds changed files instead of rebuilding the entire index. This reduces update time from minutes to seconds.
# Update repos and incrementally re-index (fast!)
solana-mcp update
# Incremental index (default behavior)
solana-mcp index
# Preview what would change without indexing
solana-mcp index --dry-run
# Force full rebuild
solana-mcp index --full
How it works:
- Tracks file hashes and modification times in a manifest
- Detects which files changed since last index
- Only re-embeds the changed content
- Updates LanceDB incrementally (add/delete operations)
Configurable Embedding Models
Choose from multiple embedding models based on your quality/speed tradeoff:
# List available models
solana-mcp models
# Use a specific model
solana-mcp index --model codesage/codesage-large
| Model | Dims | Quality | Speed | Notes |
|---|---|---|---|---|
all-MiniLM-L6-v2 |
384 | Fair | Fast | Default, good for quick searches |
all-mpnet-base-v2 |
768 | Good | Medium | Better quality |
codesage/codesage-large |
1024 | Good | Medium | Code-specialized |
voyage:voyage-code-3 |
1024 | Excellent | API | Best quality, requires API key |
Configure in ~/.solana-mcp/config.yaml:
embedding:
model: "codesage/codesage-large"
batch_size: 32
chunking:
chunk_size: 1000
chunk_overlap: 200
Expert Guidance
Curated knowledge beyond what's in the code:
# Via MCP tool
sol_expert_guidance("staking")
sol_expert_guidance("jito")
sol_expert_guidance("alpenglow")
Topics include: staking, voting, slashing, towerbft, consensus, alpenglow, poh, accounts, svm, turbine, leader_schedule, epochs, mev, jito, bundles, tips
CLI Commands
# Full build pipeline
solana-mcp build # Download + compile + index
solana-mcp build --full # Force full rebuild
# Individual steps
solana-mcp download # Clone agave, jito, firedancer, SIMDs, alpenglow
solana-mcp compile # Parse Rust/C code into JSON
solana-mcp index # Build vector embeddings
solana-mcp index --dry-run # Preview changes
solana-mcp index --full # Force full rebuild
solana-mcp index --model MODEL # Use specific embedding model
# Update (git pull + incremental index)
solana-mcp update
solana-mcp update --full # Update + force rebuild
# Search
solana-mcp search "stake delegation"
solana-mcp search "tower bft" --type rust
solana-mcp search "leader schedule" --limit 10
# Lookup
solana-mcp constant LAMPORTS_PER_SOL
solana-mcp function process_vote
# Info
solana-mcp status # Index status, manifest info
solana-mcp models # List embedding models
MCP Tools
When running as an MCP server:
| Tool | Purpose |
|---|---|
sol_search |
Semantic search across all indexed content |
sol_search_runtime |
Runtime code only (no SIMDs) |
sol_search_simd |
SIMDs specifically |
sol_grep_constant |
Fast constant lookup |
sol_analyze_function |
Get function source code |
sol_get_current_version |
Current mainnet version (v2.1) |
sol_list_versions |
Version history with features |
sol_get_consensus_status |
TowerBFT (current) vs Alpenglow (future) |
sol_list_feature_gates |
Feature gate activations |
sol_list_clients |
Validator client implementations |
sol_get_client |
Details on specific client |
sol_get_client_diversity |
Stake distribution across clients |
sol_expert_guidance |
Curated guidance on topics |
Validator Clients
| Client | Language | Notes |
|---|---|---|
| Jito-Solana | Rust | MEV-enabled fork |
| Frankendancer | C+Rust | Firedancer networking + Agave runtime |
| Agave | Rust | Reference implementation (Anza) |
| Firedancer | C | Full independent implementation (Jump) |
| Sig | Zig | Zig implementation (Syndica) |
Project Structure
src/solana_mcp/
├── server.py # MCP server (FastMCP)
├── cli.py # CLI commands
├── config.py # Configuration management
├── versions.py # Version/client/consensus tracking
├── indexer/
│ ├── downloader.py # Git clone with sparse checkout
│ ├── compiler.py # Rust + C parsing (tree-sitter)
│ ├── chunker.py # Code/markdown chunking + chunk IDs
│ ├── embedder.py # Embeddings + LanceDB + incremental
│ └── manifest.py # File tracking for incremental updates
└── expert/
└── guidance.py # Curated expert knowledge
Data Location
~/.solana-mcp/
├── config.yaml # Configuration (optional)
├── manifest.json # Index state tracking
├── agave/ # Reference client source
├── jito-solana/ # MEV fork source
├── jito-programs/ # On-chain MEV programs
├── firedancer/ # Jump's C implementation
├── solana-improvement-documents/
├── alpenglow/ # Future consensus
├── compiled/ # Extracted JSON
└── lancedb/ # Vector index
Expert Guidance Topics
The sol_expert_guidance tool provides curated knowledge on:
Staking & Consensus:
staking- Delegation, warmup/cooldown, rewardsvoting- Vote accounts, TowerBFT votingslashing- Current lack of slashing, future planstowerbft- Current consensus mechanismconsensus- PoH + TowerBFT relationshipalpenglow- Future consensus (~150ms finality)poh- Proof of History (ordering, not consensus)
Runtime & Architecture:
accounts- Account model, rent, ownershipsvm- Solana Virtual Machineturbine- Block propagationleader_schedule- Slot assignmentepochs- 432,000 slots, ~2-3 days
MEV (Jito):
mev- MEV on Solana overviewjito- Jito infrastructure and architecturebundles- Atomic transaction bundlestips- Tip distribution to validators/stakers
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=solana_mcp
# Lint
ruff check src/
Running as MCP Server
# Start the server
sol-mcp
# Or with uvicorn for development
uvicorn solana_mcp.server:mcp --reload
Add to your Claude Code MCP configuration:
{
"mcpServers": {
"solana": {
"command": "sol-mcp"
}
}
}
Documentation
- Incremental Indexing - How the incremental update system works
- CLAUDE.md - Quick reference for Claude Code
Differences from Official Solana MCP
The official mcp.solana.com is documentation-focused.
This implementation:
- Indexes source code from multiple validator clients
- Parses Rust and C with tree-sitter
- Provides incremental indexing for fast updates
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sol_mcp-0.2.1.tar.gz.
File metadata
- Download URL: sol_mcp-0.2.1.tar.gz
- Upload date:
- Size: 61.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e47eb7a0708b8954bfb80a5249aad8af657120fb52d3897857e37996f356577
|
|
| MD5 |
3ad5e546b8ee10632d3ae1c9f608167e
|
|
| BLAKE2b-256 |
56177a36719f5347446a36ead8b1a9e5aac8a5e5ff01257360b61eaab1fa5cd6
|
Provenance
The following attestation bundles were made for sol_mcp-0.2.1.tar.gz:
Publisher:
release.yml on b17z/solana-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sol_mcp-0.2.1.tar.gz -
Subject digest:
4e47eb7a0708b8954bfb80a5249aad8af657120fb52d3897857e37996f356577 - Sigstore transparency entry: 937119753
- Sigstore integration time:
-
Permalink:
b17z/solana-mcp@65a022a51c721b13b8ffbcc43479eff2a0e251f9 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/b17z
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@65a022a51c721b13b8ffbcc43479eff2a0e251f9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sol_mcp-0.2.1-py3-none-any.whl.
File metadata
- Download URL: sol_mcp-0.2.1-py3-none-any.whl
- Upload date:
- Size: 54.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21e6dfe74cf3c497373c8865ec39242a8a4fa6d807a38d60ad76aee917f4138c
|
|
| MD5 |
ba9b77c9b07e24bd539d24e61c92a85e
|
|
| BLAKE2b-256 |
f76627ac107c648980eff2a52c9a2402c1182cdea334648d1dbd96958b3a57a9
|
Provenance
The following attestation bundles were made for sol_mcp-0.2.1-py3-none-any.whl:
Publisher:
release.yml on b17z/solana-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sol_mcp-0.2.1-py3-none-any.whl -
Subject digest:
21e6dfe74cf3c497373c8865ec39242a8a4fa6d807a38d60ad76aee917f4138c - Sigstore transparency entry: 937119756
- Sigstore integration time:
-
Permalink:
b17z/solana-mcp@65a022a51c721b13b8ffbcc43479eff2a0e251f9 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/b17z
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@65a022a51c721b13b8ffbcc43479eff2a0e251f9 -
Trigger Event:
push
-
Statement type: