|
| 1 | +# OpenVox Docs MCP server |
| 2 | + |
| 3 | +A local [Model Context Protocol](https://modelcontextprotocol.io/) server that |
| 4 | +exposes the OpenVox documentation to MCP-aware tools (Claude Code, Cursor, Claude |
| 5 | +Desktop, …) so an assistant can search and read the docs in-workflow. |
| 6 | + |
| 7 | +It is the local, self-hosted counterpart to a hosted "Ask AI" widget: no third |
| 8 | +party, no API key, no usage quota, and queries never leave your machine. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +> Recorded with [VHS](https://github.com/charmbracelet/vhs) from |
| 13 | +> [`demo/demo.tape`](demo/demo.tape); regenerate with `vhs tools/mcp/demo/demo.tape`. |
| 14 | +
|
| 15 | +## How it works |
| 16 | + |
| 17 | +The server's corpus is the two machine-readable files the docs site publishes |
| 18 | +(see the repository README's "LLM-friendly documentation files" section): |
| 19 | + |
| 20 | +- [`llms.txt`](https://docs.openvoxproject.org/llms.txt) — the index of pages, |
| 21 | + grouped by project. |
| 22 | +- [`llms-full.txt`](https://docs.openvoxproject.org/llms-full.txt) — the full |
| 23 | + text of every current ("latest") page, including the generated reference pages |
| 24 | + (configuration, function, type, man pages). |
| 25 | + |
| 26 | +On first use it fetches both from `https://docs.openvoxproject.org`, caches them |
| 27 | +under `~/.cache/openvox-docs-mcp/` with conditional requests (so refreshes are |
| 28 | +cheap and it still works offline from the last copy), parses them into one |
| 29 | +document per page, and builds a BM25 keyword index. |
| 30 | + |
| 31 | +## Tools |
| 32 | + |
| 33 | +| Tool | Purpose | |
| 34 | +|------|---------| |
| 35 | +| `list_projects` | List the documentation projects (openvox, openvox-server, …). | |
| 36 | +| `list_docs(project?)` | List pages as `{project, title, url}`, optionally filtered to one project. | |
| 37 | +| `search_docs(query, project?, limit=5)` | BM25 keyword search; returns `{title, url, project, score, snippet}`. | |
| 38 | +| `get_doc(ref, max_chars=40000)` | Full text of one page, resolved by URL, URL path, or exact title. The body is capped at `max_chars` (the single-page function/type references are very large); raise it to fetch more. | |
| 39 | +| `refresh_corpus()` | Force a re-fetch of the llms files and rebuild the index. | |
| 40 | + |
| 41 | +## Install |
| 42 | + |
| 43 | +Requires Python 3.10+. |
| 44 | + |
| 45 | +```console |
| 46 | +cd tools/mcp |
| 47 | +python -m venv .venv && . .venv/bin/activate |
| 48 | +pip install -e . |
| 49 | +``` |
| 50 | + |
| 51 | +## Register with an MCP client |
| 52 | + |
| 53 | +All clients launch the same stdio entry point. Use the **absolute path** to the |
| 54 | +installed executable — `tools/mcp/.venv/bin/openvox-docs-mcp` after the install |
| 55 | +above (substitute your checkout path). Each client's config also accepts an `env` |
| 56 | +block if you want to set the variables from [Configuration](#configuration) |
| 57 | +(for example `OPENVOX_DOCS_SOURCE`). |
| 58 | + |
| 59 | +### Claude Code |
| 60 | + |
| 61 | +```console |
| 62 | +claude mcp add openvox-docs -- /path/to/tools/mcp/.venv/bin/openvox-docs-mcp |
| 63 | +``` |
| 64 | + |
| 65 | +Or add it to a project-scoped `.mcp.json`: |
| 66 | + |
| 67 | +```json |
| 68 | +{ |
| 69 | + "mcpServers": { |
| 70 | + "openvox-docs": { |
| 71 | + "command": "/path/to/tools/mcp/.venv/bin/openvox-docs-mcp" |
| 72 | + } |
| 73 | + } |
| 74 | +} |
| 75 | +``` |
| 76 | + |
| 77 | +### Cursor |
| 78 | + |
| 79 | +Add it to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project). Cursor |
| 80 | +uses the same `mcpServers` schema as Claude Code: |
| 81 | + |
| 82 | +```json |
| 83 | +{ |
| 84 | + "mcpServers": { |
| 85 | + "openvox-docs": { |
| 86 | + "command": "/path/to/tools/mcp/.venv/bin/openvox-docs-mcp" |
| 87 | + } |
| 88 | + } |
| 89 | +} |
| 90 | +``` |
| 91 | + |
| 92 | +### GitHub Copilot (VS Code) |
| 93 | + |
| 94 | +Add it to `.vscode/mcp.json` in your workspace (or run **MCP: Add Server** from |
| 95 | +the Command Palette). VS Code uses a top-level `servers` key, and stdio is the |
| 96 | +default for a `command`: |
| 97 | + |
| 98 | +```json |
| 99 | +{ |
| 100 | + "servers": { |
| 101 | + "openvox-docs": { |
| 102 | + "type": "stdio", |
| 103 | + "command": "/path/to/tools/mcp/.venv/bin/openvox-docs-mcp" |
| 104 | + } |
| 105 | + } |
| 106 | +} |
| 107 | +``` |
| 108 | + |
| 109 | +Or from the command line: |
| 110 | + |
| 111 | +```console |
| 112 | +code --add-mcp '{"name":"openvox-docs","command":"/path/to/tools/mcp/.venv/bin/openvox-docs-mcp"}' |
| 113 | +``` |
| 114 | + |
| 115 | +### Codex CLI |
| 116 | + |
| 117 | +Add it to `~/.codex/config.toml` (or a project-scoped `.codex/config.toml`). |
| 118 | +Codex uses a `mcp_servers` TOML table: |
| 119 | + |
| 120 | +```toml |
| 121 | +[mcp_servers.openvox-docs] |
| 122 | +command = "/path/to/tools/mcp/.venv/bin/openvox-docs-mcp" |
| 123 | +``` |
| 124 | + |
| 125 | +## Testing |
| 126 | + |
| 127 | +Install the dev extras, then run the suite: |
| 128 | + |
| 129 | +```console |
| 130 | +pip install -e '.[dev]' |
| 131 | +pytest |
| 132 | +``` |
| 133 | + |
| 134 | +The unit tests cover corpus parsing, remote fetch/caching (offline fallback and |
| 135 | +304 reuse), BM25 ranking, and every tool. For an end-to-end check that launches |
| 136 | +the server over stdio and exercises all five tools against a throwaway corpus |
| 137 | +(network- and model-free): |
| 138 | + |
| 139 | +```console |
| 140 | +python smoke_test.py |
| 141 | +``` |
| 142 | + |
| 143 | +## Configuration |
| 144 | + |
| 145 | +The server is configured entirely through environment variables: |
| 146 | + |
| 147 | +| Variable | Default | Effect | |
| 148 | +|----------|---------|--------| |
| 149 | +| `OPENVOX_DOCS_BASE_URL` | `https://docs.openvoxproject.org` | Site to fetch the llms files from. | |
| 150 | +| `OPENVOX_DOCS_SOURCE` | _(unset)_ | Read `llms.txt` / `llms-full.txt` from a local directory instead of fetching. Point it at a Jekyll `_site/` build for offline or pre-release use. | |
| 151 | + |
| 152 | +For example, to run against a local build of this repo: |
| 153 | + |
| 154 | +```console |
| 155 | +bundle exec jekyll build |
| 156 | +OPENVOX_DOCS_SOURCE="$PWD/_site" openvox-docs-mcp |
| 157 | +``` |
| 158 | + |
| 159 | +> **Note:** until the `llms.txt` / `llms-full.txt` feature is deployed to the live |
| 160 | +> site, set `OPENVOX_DOCS_SOURCE` to a local `_site/` build — the live URLs will |
| 161 | +> 404 otherwise. |
0 commit comments