Skip to content

Commit 147a9ac

Browse files
committed
docs: humanize README
1 parent 1660220 commit 147a9ac

1 file changed

Lines changed: 63 additions & 70 deletions

File tree

README.md

Lines changed: 63 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,43 @@
1010
[![MCP Registry](https://img.shields.io/badge/MCP%20Registry-v0.1.4-0f766e)](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.ayhammouda%2Fpython-docs-mcp-server)
1111
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
1212
[![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue)](https://www.python.org/)
13-
[![No API Keys](https://img.shields.io/badge/API%20keys-none-success)](#why-teams-like-this)
13+
[![No API Keys](https://img.shields.io/badge/API%20keys-none-success)](#why-use-it)
1414
[![Official Python Docs](https://img.shields.io/badge/source-official%20python%20docs-informational)](https://docs.python.org/3/)
1515

16-
A read-only, version-aware MCP server for Python standard library
17-
documentation, optimized for low-token, section-level retrieval.
16+
`python-docs-mcp-server` is a read-only MCP server for the Python standard
17+
library docs. It builds a local, version-aware index and gives MCP clients the
18+
relevant section instead of a whole docs page.
1819

19-
It gives Claude, Cursor, Codex, and other MCP clients precise stdlib answers
20-
without dumping whole documentation pages into the context window, without API
21-
keys, and without depending on a hosted docs provider at query time.
20+
Use it with Claude, Cursor, Codex, or any MCP client when you want answers from
21+
docs.python.org without API keys or a hosted docs API at query time.
2222

2323
## Why this exists
2424

25-
General-purpose docs retrieval is often noisy for Python stdlib questions:
25+
Generic docs retrieval is a rough fit for Python stdlib questions:
2626

27-
- symbol lookups like `asyncio.TaskGroup` need exact resolution
28-
- answers should be version-aware (`3.12` vs `3.13`)
29-
- full-page fetches waste tokens when one section is enough
30-
- official Python docs are the source of truth, but they are not packaged for
31-
MCP out of the box
27+
- `asyncio.TaskGroup` should resolve to the actual symbol, not a fuzzy page hit
28+
- Python version matters (`3.12` and `3.13` do not always say the same thing)
29+
- fetching a whole page burns tokens when one section answers the question
30+
- the official docs are canonical, but they do not ship as an MCP server
3231

33-
This server builds a local index from the official Python documentation and
34-
exposes a small MCP tool surface tuned for high-signal retrieval.
32+
This server indexes the official docs locally and exposes a small set of MCP
33+
tools for lookup and section retrieval.
3534

36-
## Why teams like this
35+
## Why use it
3736

38-
- no API keys to provision, rotate, or justify
39-
- official Python docs are the source of truth
40-
- local index, so runtime retrieval does not depend on a third-party hosted API
41-
- read-only behavior with a simple security story
42-
- easy to explain in environments where external dependencies raise friction
37+
- no API keys to manage
38+
- queries run against a local index, not a hosted docs API
39+
- results come from the official Python docs
40+
- the server is read-only at runtime
41+
- fewer dependencies to review in strict environments
4342

4443
## What you get
4544

46-
- exact symbol lookup from Python `objects.inv`
47-
- section-level retrieval with truncation and pagination
48-
- local SQLite + FTS5 index with no runtime web scraping
49-
- version-aware results across indexed Python versions
50-
- a deliberately small, read-only MCP tool surface
45+
- symbol lookup through Python `objects.inv`
46+
- page and section retrieval with truncation and pagination
47+
- a local SQLite + FTS5 index; no runtime web scraping
48+
- results for each Python version you index
49+
- five read-only MCP tools
5150

5251
## Quick example
5352

@@ -62,19 +61,19 @@ exposes a small MCP tool surface tuned for high-signal retrieval.
6261

6362
**Result**
6463

65-
The model gets the exact symbol match and the relevant documentation section
66-
instead of a full-page dump.
64+
The model gets the matching symbol and the relevant docs section, not a
65+
full-page dump.
6766

6867
## 30-second demo
6968

7069
Ask your MCP client:
7170

7271
> In Python 3.13, how should I use `asyncio.TaskGroup` and what changed from older asyncio patterns?
7372
74-
The agent should use `search_docs` for the exact symbol, then `get_docs` for the
75-
matching section. Instead of generic web results or an entire docs page, it gets
76-
the official stdlib text for the requested Python version, trimmed to the useful
77-
section.
73+
If setup is working, the client should use `search_docs` for the exact symbol,
74+
then `get_docs` for the matching section. Instead of generic web results or an
75+
entire docs page, it gets official stdlib text for the requested Python version,
76+
trimmed to the section that matters.
7877

7978
<!-- PRE-PYPI: replace this temporary GitHub-source smoke test after the first PyPI publish -->
8079
Local source smoke test until the PyPI package is published:
@@ -106,7 +105,7 @@ Run directly with `uvx`:
106105
uvx python-docs-mcp-server --version
107106
```
108107

109-
Or install it persistently:
108+
Or install it once with `pipx`:
110109

111110
```bash
112111
pipx install python-docs-mcp-server
@@ -143,9 +142,9 @@ If you installed the package persistently, you can drop the `uvx` prefix:
143142
python-docs-mcp-server build-index --versions 3.10,3.11,3.12,3.13,3.14
144143
```
145144

146-
This downloads Python's `objects.inv` files, clones CPython docs sources, runs
147-
`sphinx-build -b json`, and writes an SQLite index to your local cache. Expect
148-
the first build to take several minutes.
145+
The first build downloads Python's `objects.inv` files, clones CPython docs
146+
sources, runs `sphinx-build -b json`, and writes an SQLite index to your local
147+
cache. It can take several minutes.
149148

150149
## Configure your MCP client
151150

@@ -246,20 +245,17 @@ command = "uvx"
246245
args = ["python-docs-mcp-server"]
247246
```
248247

249-
## How quality is verified
250-
251-
The repo makes quality visible with reproducible checks instead of relying on
252-
marketing claims.
248+
## Quality checks
253249

254250
- CI runs `ruff`, `pyright`, and `pytest` on macOS and Linux for Python 3.12
255251
and 3.13
256-
- subprocess-based stdio hygiene and smoke tests protect the MCP protocol pipe
257-
- packaging tests verify the wheel contents and CLI entry points
258-
- curated retrieval regression tests cover exact symbol hits, version behavior,
252+
- subprocess-based stdio and smoke tests cover the MCP protocol pipe
253+
- packaging tests check the wheel contents and CLI entry points
254+
- retrieval regression tests cover exact symbol hits, version behavior,
259255
missing symbols, truncation, and local-version defaults
260-
- manual MCP QA is documented in
256+
- manual MCP QA lives in
261257
[`.github/INTEGRATION-TEST.md`](.github/INTEGRATION-TEST.md), with MCP
262-
Inspector as the fast-feedback loop and Claude/Cursor as real-client checks
258+
Inspector for local checks and Claude/Cursor for real-client checks
263259

264260
Contributor commands and validation steps live in
265261
[`CONTRIBUTING.md`](CONTRIBUTING.md).
@@ -274,25 +270,23 @@ The server currently exposes five MCP tools:
274270
| `get_docs` | Retrieve a specific documentation page or section by slug and optional anchor. Returns markdown content with budget-enforced truncation and pagination. Retrieved results are cached on disk by Python docs version and request identity. |
275271
| `lookup_package_docs` | Look up official PyPI package metadata and return package-declared documentation/homepage/source URLs. This is a controlled PyPI metadata lookup, not generic web search. |
276272
| `list_versions` | List all indexed Python versions with metadata. |
277-
| `detect_python_version` | Detect the user's local Python version and report whether it matches an indexed documentation version. |
273+
| `detect_python_version` | Detect the user's local Python version and report whether that version has been indexed. |
278274

279275
## Why not Context7 or generic docs retrieval?
280276

281277
Use this server when you want precise local Python docs retrieval rather than
282278
broad web search:
283279

284-
- official Python docs, not scraped mirrors or mixed-source summaries
280+
- official Python docs, not scraped mirrors or summaries
285281
- exact symbol resolution from `objects.inv`
286-
- Python-version-aware results across 3.10 through 3.14
287-
- token-efficient section retrieval instead of full-page dumps
288-
- package-declared PyPI metadata lookup via `lookup_package_docs` for
289-
documentation, homepage, and source URLs
290-
- local, read-only runtime behavior with no API keys
282+
- version-aware results for Python 3.10 through 3.14
283+
- section retrieval instead of full-page dumps
284+
- PyPI-declared docs, homepage, and source links through `lookup_package_docs`
285+
- local read-only runtime with no API keys
291286

292-
Use Context7 or a generic docs fetcher when you need broader third-party library
293-
coverage, arbitrary web pages, or cross-framework research. This server is not a
294-
universal docs search engine. It is a precise stdlib retrieval tool for AI
295-
coding agents.
287+
Use Context7 or a generic docs fetcher for third-party libraries, arbitrary web
288+
pages, or framework research. This server is not a universal docs search engine;
289+
it is a focused stdlib retrieval tool for AI coding agents.
296290

297291
## Retrieved docs cache
298292

@@ -303,16 +297,16 @@ platform cache directory:
303297
<platform cache dir>/mcp-python-docs/retrieved-docs-cache.sqlite3
304298
```
305299

306-
The cache stores completed `get_docs` results, including page/section content,
307-
for the resolved Python docs version plus request identity (`slug`, optional
308-
`anchor`, `max_chars`, and `start_index`). Cache misses fall back to the normal
309-
local index retrieval path and then write the retrieved result.
300+
The cache stores completed `get_docs` results for the resolved Python docs
301+
version plus request identity (`slug`, optional `anchor`, `max_chars`, and
302+
`start_index`). Cache misses use the normal local index retrieval path and then
303+
write the result.
310304

311305
Cache entries are also scoped to a fingerprint of the local `index.db` file
312306
(path, size, and modification timestamp). If you rebuild or replace the local
313-
docs index, older entries are ignored automatically instead of being returned
314-
for the new index generation. Deleting `retrieved-docs-cache.sqlite3` is safe;
315-
it only removes cached retrieval results, not the docs index.
307+
docs index, older entries are ignored automatically. Deleting
308+
`retrieved-docs-cache.sqlite3` is safe; it removes cached retrieval results, not
309+
the docs index.
316310

317311
## PyPI package docs lookup
318312

@@ -345,8 +339,7 @@ uvx python-docs-mcp-server doctor
345339
```
346340

347341
This checks the runtime Python version, SQLite FTS5, cache/index paths, disk
348-
space, and whether the current interpreter has the `venv`/`ensurepip` support
349-
needed by `build-index`.
342+
space, and the `venv`/`ensurepip` support needed by `build-index`.
350343

351344
<!-- PRE-PYPI: remove the GitHub-source validate-corpus invocation and "After PyPI publishing:" lead-in after the first PyPI publish; the post-PyPI code fence below survives -->
352345
Before PyPI publishing, validate an existing index from the GitHub source
@@ -369,7 +362,7 @@ uvx python-docs-mcp-server validate-corpus
369362

370363
### FTS5 unavailable
371364

372-
If you see an error about SQLite FTS5 not being available:
365+
If your Python build does not include SQLite FTS5:
373366

374367
**Linux x86-64**
375368

@@ -389,8 +382,8 @@ uv python install
389382

390383
### Missing `pythonX.Y-venv` on Debian/Ubuntu
391384

392-
If `doctor` reports that build venv support is unavailable, install the venv
393-
package for the same Python minor version that runs the server:
385+
If `doctor` says build venv support is unavailable, install the venv package
386+
for the same Python minor version that runs the server:
394387

395388
```bash
396389
sudo apt install python3.12-venv
@@ -408,7 +401,7 @@ Earlier development snapshots of this project used the PyPI name
408401
the old name via `uvx`, you will see a `Package not found` error,
409402
because `uvx` resolves projects by PyPI name.
410403

411-
Update your config's `args` from:
404+
Change your config `args` from:
412405

413406
```json
414407
"args": ["mcp-server-python-docs"]
@@ -479,8 +472,8 @@ Replace `YOU` with your Windows username. Find the exact path with `where uvx`.
479472
### Restart after rebuild
480473

481474
After running `build-index`, restart your MCP client so it picks up the new
482-
database file. The server opens the index read-only at startup and does not
483-
hot-reload an updated database.
475+
database file. The server opens the index read-only on startup and does not
476+
reload it while running.
484477

485478
On Windows, close the MCP client before rebuilding if the index file is locked.
486479

0 commit comments

Comments
 (0)