tezos-mcp
RAG-powered MCP server that indexes and searches Tezos protocol specs, TZIPs, and Octez source code, enabling semantic search and expert guidance on Tezos topics.
README
tezos-mcp
RAG-powered MCP server for Tezos protocol specs, TZIPs, and Octez source code.
What It Does
Indexes and searches across:
- Octez Protocol - OCaml protocol implementations (
src/proto_*/lib_protocol/) - Octez Node - Shell architecture, RPC specs, P2P, storage (
src/,docs/) - TZIPs - Tezos Improvement Proposals (FA2, metadata, wallet standards)
Installation
# From PyPI
pip install tezos-mcp
# From source
pip install -e .
# With Voyage API embeddings (best quality)
pip install -e ".[voyage]"
# With tree-sitter OCaml parsing
pip install -e ".[ocaml]"
Quick Start
# Build the index (downloads repos + creates embeddings)
tezos-mcp build
# Search
tezos-mcp search "FA2 token standard"
# Check status
tezos-mcp status
Features
Incremental Indexing
Only re-embeds changed files instead of rebuilding the entire index. Reduces update time from minutes to seconds.
# Update repos and incrementally re-index (fast!)
tezos-mcp update
# Incremental index (default behavior)
tezos-mcp index
# Force full rebuild
tezos-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
tezos-mcp models
# Use a specific model
tezos-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 ~/.tezos-mcp/config.yaml:
embedding_model: all-MiniLM-L6-v2
chunk_size: 1000
chunk_overlap: 200
protocol_depth: 3 # Number of past protocols to index
Expert Guidance
Curated knowledge beyond what's in the code:
# Via MCP tool
tez_expert_guidance("baking")
tez_expert_guidance("governance")
tez_expert_guidance("smart_rollups")
Topics include: baking, delegation, staking, tenderbake, governance, smart_rollups, dal, michelson, fa2, adaptive_issuance, slashing
CLI Commands
# Full build pipeline
tezos-mcp build # Download + compile + index
tezos-mcp build --full # Force full rebuild
# Individual steps
tezos-mcp download # Clone octez + tzip repos
tezos-mcp compile # Parse OCaml/markdown into JSON
tezos-mcp index # Build vector embeddings
tezos-mcp index --full # Force full rebuild
tezos-mcp index --model MODEL # Use specific embedding model
# Update (git pull + incremental index)
tezos-mcp update
tezos-mcp update --full # Update + force rebuild
# Search
tezos-mcp search "stake delegation"
tezos-mcp search "tenderbake consensus" --protocol paris
tezos-mcp search "FA2 transfer" --limit 10
# Lookup
tezos-mcp constant max_operations_ttl
tezos-mcp function apply_operation
# Info
tezos-mcp status # Index status, manifest info
tezos-mcp models # List embedding models
tezos-mcp serve # Start MCP server
MCP Tools
When running as an MCP server:
| Tool | Purpose |
|---|---|
tez_search |
Semantic search across all indexed content |
tez_search_tzip |
Search TZIP standards (FA2, metadata, wallet specs) |
tez_search_protocol |
Search protocol specs and OCaml source |
tez_search_octez |
Search Octez node docs and source code |
tez_grep_constant |
Fast OCaml constant lookup |
tez_analyze_function |
Get OCaml function source code |
tez_get_current_protocol |
Current mainnet protocol (Tallinn) |
tez_list_protocols |
Full amendment history (Athens through Tallinn) |
tez_expert_guidance |
Curated guidance on Tezos topics |
Protocol Amendments
Tezos upgrades through on-chain governance. The index covers the full amendment history:
| Protocol | Date | Notable Features |
|---|---|---|
| Athens | 2019-05 | First amendment |
| Ithaca | 2022-03 | Tenderbake consensus |
| Mumbai | 2023-03 | Smart rollups |
| Paris | 2024-06 | Adaptive issuance, staking |
| Quebec | 2025-02 | Universal baker attestation |
| Tallinn | 2026-01 | 6s block time |
Project Structure
src/tezos_mcp/
├── server.py # MCP server (FastMCP)
├── cli.py # CLI commands (Click)
├── config.py # Configuration management
├── models.py # Pydantic input validation
├── protocols.py # Protocol amendment history
├── logging.py # Structured logging
├── indexer/
│ ├── downloader.py # Git clone with sparse checkout
│ ├── compiler.py # Markdown/RST extraction
│ ├── ocaml_compiler.py # OCaml parsing (tree-sitter + regex)
│ ├── chunker.py # Document chunking + chunk IDs
│ ├── embedder.py # Embeddings + LanceDB + incremental
│ └── manifest.py # File tracking for incremental updates
└── expert/
└── guidance.py # Curated expert knowledge
Data Location
~/.tezos-mcp/
├── config.yaml # Configuration (optional)
├── manifest.json # Index state tracking
├── repos/
│ ├── tezos/ # Octez protocol + node (sparse checkout)
│ └── tzip/ # TZIP standards (full clone)
├── compiled/ # Extracted JSON specs
│ ├── tzips/
│ └── octez_docs/
└── lancedb/ # Vector index
Expert Guidance Topics
The tez_expert_guidance tool provides curated knowledge on:
Consensus & Baking:
baking- Block production, endorsing, rightsdelegation- Delegating to bakers, rewardsstaking- Direct staking (Paris+), frozen depositstenderbake- Deterministic finality consensusslashing- Double-baking/endorsing penalties
Governance & Standards:
governance- On-chain amendment processfa2- FA2 token standard (TZIP-012)michelson- Smart contract language
Scaling & Data:
smart_rollups- L2 scaling (WASM rollups)dal- Data Availability Layeradaptive_issuance- Dynamic reward adjustment
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=tezos_mcp
# Lint
ruff check src/
Running as MCP Server
# Start the server
tezos-mcp serve
Add to your Claude Code MCP configuration:
{
"mcpServers": {
"tezos-mcp": {
"command": "tezos-mcp",
"args": ["serve"]
}
}
}
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。