Skip to main content
Glama
live-docs
by kingabzpro
README.md
# live-docs-mcp

A small Context7-inspired MCP server for public library docs. It fetches up to four pages concurrently with Olostep and returns ranked Markdown excerpts with source links. SQLite FTS5 ranks results with BM25 and caches pages for 24 hours by default.

## Setup

From the repo directory, use Python 3.11+ with SQLite FTS5 and an [Olostep API key](https://docs.olostep.com/get-started/authentication).

```sh
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
```

On Windows PowerShell, activate with `.\.venv\Scripts\Activate.ps1`. Set `OLOSTEP_API_KEY` in the shell where you run Claude Code.

## Claude Code

Register the stdio server from the repo directory.

```sh
claude mcp add --scope local --transport stdio live-docs -- "$PWD/.venv/bin/python" "$PWD/server.py"
```

On Windows PowerShell:

```powershell
claude mcp add --scope local --transport stdio live-docs -- (Resolve-Path .venv/Scripts/python.exe).Path (Resolve-Path server.py).Path
```

```sh
claude mcp get live-docs
claude -p "Use live-docs to explain HTTPX timeouts and cite www.python-httpx.org." --allowedTools mcp__live-docs__search_docs
```

The `search_docs` tool takes a library, a topic, and the exact docs hostname. For other MCP clients, configure stdio with the virtual environment's Python and the absolute path to `server.py`.

## Cache and tests

The database defaults to `~/.live-docs-mcp/docs.sqlite3`. Set `LIVE_DOCS_DB` to change its location or `LIVE_DOCS_TTL_SECONDS` to change when entries refresh.

```sh
python -m unittest discover -s tests -v
python benchmark.py
```

The tests run offline. The benchmark uses Olostep credits and reports cold and warm lookup times.

[MIT License](LICENSE)