MCP server for querying and retrieving documentation for qibo, qibolab and qibocal — the qiboteam quantum computing ecosystem.
- 📚 All three libraries — qibo, qibolab and qibocal indexed and searchable
- 🔄 Always up-to-date — on every
servestartup the server checks the latest GitHub commit SHA per library and re-indexes any that changed - 🔍 BM25 full-text search — SQLite FTS5 with porter stemming, zero external dependencies
- ⚡ Fast — offline index, sub-millisecond searches after first build
- 🔌 stdio transport — works as a subprocess with any MCP client (Copilot CLI, Claude Code, Cursor, Claude Desktop, VS Code)
- Python ≥ 3.10
- uv (recommended)
- Internet access to GitHub (for fetching and updating the index)
git clone https://github.com/qiboteam/qibo-docs-mcp.git
cd qibo-docs-mcp
uv syncOn the first run (or to force a full refresh):
uv run qibo-docs-mcp indexThis fetches all .rst and .md files from doc/source/ in each of the three repos,
converts them to Markdown, and stores them in ~/.local/share/qibo-docs-mcp/qibo_docs.db.
Index a single library:
uv run qibo-docs-mcp index --library qibouv run qibo-docs-mcp serveOn startup the server automatically checks for new commits and re-indexes changed libraries before accepting MCP connections — no manual refresh needed.
The GitHub API allows 60 unauthenticated requests/hour. A personal access token raises this to 5000/hr, which is important for full index builds (hundreds of RST files).
export GITHUB_TOKEN=ghp_your_token_here| Tool | Description |
|---|---|
search_docs(query, library?, top_k?) |
BM25 search across all indexed docs. library filters to qibo, qibolab or qibocal. |
get_page(library, path, max_length?, offset?) |
Return full Markdown of a specific page. Supports pagination via offset. |
list_pages(library?) |
List all indexed pages with their paths and rendered URLs. |
| Resource URI | Description |
|---|---|
qibo-docs://libraries |
Available libraries with indexed commit SHA and rendered URL. |
Note: MCP clients spawn processes without a login shell, so use the full path to
uv(find it withwhich uv; if not installed, runcurl -LsSf https://astral.sh/uv/install.sh | sh).
{
"mcpServers": {
"qibo-docs": {
"command": "/Users/you/.local/bin/uv",
"args": ["run", "--directory", "/path/to/qibo-docs-mcp", "qibo-docs-mcp", "serve"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}{
"mcpServers": {
"qibo-docs": {
"command": "uv",
"args": ["run", "--directory", "/path/to/qibo-docs-mcp", "qibo-docs-mcp", "serve"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}{
"servers": {
"qibo-docs": {
"type": "stdio",
"command": "uv",
"args": ["run", "--directory", "/path/to/qibo-docs-mcp", "qibo-docs-mcp", "serve"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}{
"mcpServers": {
"qibo-docs": {
"command": "uv",
"args": ["run", "--directory", "/path/to/qibo-docs-mcp", "qibo-docs-mcp", "serve"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}Override the default database location with the QIBO_DOCS_DB environment variable:
export QIBO_DOCS_DB=/custom/path/qibo_docs.db
uv run qibo-docs-mcp serveOr via the --db flag:
uv run qibo-docs-mcp --db /custom/path/qibo_docs.db servesrc/qibo_docs_mcp/
├── __init__.py # CLI entry point (index / serve subcommands)
├── server.py # FastMCP server: tools, resources, startup sync
├── fetcher.py # GitHub API → RST/MD → Markdown conversion
├── store.py # SQLite FTS5: build, BM25 search, fetch, SHA tracking
└── constants.py # Library configs (repo, branch, doc path, rendered URL)
Update flow:
servestarts → calls_sync_libraries()- For each library, fetch latest commit SHA touching
doc/source/via GitHub API - Compare with stored SHA in
metatable - If changed → re-fetch all RST/MD files → rebuild FTS5 index for that library
- Serve MCP requests with the fresh index
All documentation is sourced directly from the official GitHub repositories:
| Library | Repository | Branch | Doc path |
|---|---|---|---|
| qibo | qiboteam/qibo | master | doc/source/ |
| qibolab | qiboteam/qibolab | main | doc/source/ |
| qibocal | qiboteam/qibocal | main | doc/source/ |
Apache-2.0