ayhammouda avatar

Python Docs MCP Server

ayhammouda/python-docs-mcp-server

Offline, token-efficient Python stdlib lookup for AI coding agents. Indexes official docs.python.org content locally, exposes six MCP tools including symbol search (get the exact asyncio.TaskGroup entry, not a full page), section retrieval with truncation, and version-scoped queries across 3.10 through 3.14. Built on SQLite FTS5 and Python's objects.inv inventory files. No API keys, no web scraping at runtime, no vector store hallucinations about section anchors. When your agent needs pathlib.Path semantics or what changed in 3.12, this returns the canonical answer in minimal context instead of dumping an entire docs page into the prompt window.

GitHub stars
9
tools
7
transport
STDIO
last updated
Oct 30, 2026

Tools

7 tools

Public tool metadata for what this MCP can expose to an agent.

search_docsSearch Python stdlib docs by query. Supports symbol lookup (`asyncio.TaskGroup`), module search (`json`), and free-text search. Returns ranked hits with BM25 scoring and snippet excerpts.

Search Python stdlib docs by query. Supports symbol lookup (`asyncio.TaskGroup`), module search (`json`), and free-text search. Returns ranked hits with BM25 scoring and snippet excerpts.

No parameter schema in public metadata yet.

get_docsRetrieve 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.

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.

No parameter schema in public metadata yet.

lookup_package_docsLook up official PyPI package metadata and return package-declared documentation/homepage/source URLs. This is a controlled PyPI metadata lookup, not generic web search.

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.

No parameter schema in public metadata yet.

list_versionsList all indexed Python versions with metadata.

List all indexed Python versions with metadata.

No parameter schema in public metadata yet.

detect_python_versionReport the Python version detected in the user's environment when the server started, and whether that version is indexed.

Report the Python version detected in the user's environment when the server started, and whether that version is indexed.

No parameter schema in public metadata yet.

compare_versionsDiff a Python stdlib symbol between two indexed versions. Returns change=added|removed|changed|unchanged with optional new_in, changed_in, deprecated_in, signature_delta (advisory heuristic), see_also_added/removed, section_diff, and note deltas. Token-frugal — emits only chan...

Diff a Python stdlib symbol between two indexed versions. Returns change=added|removed|changed|unchanged with optional new_in, changed_in, deprecated_in, signature_delta (advisory heuristic), see_also_added/removed, section_diff, and note deltas. Token-frugal — emits only chan...

No parameter schema in public metadata yet.

whatsnew_for_versionBrowse nonempty sections of the already-indexed official What's New page for one Python version. Optional kind filters by conservative heading-hierarchy category. start_index and max_sections paginate the filtered results; the structured response is capped at 20,000 characters...

Browse nonempty sections of the already-indexed official What's New page for one Python version. Optional kind filters by conservative heading-hierarchy category. start_index and max_sections paginate the filtered results; the structured response is capped at 20,000 characters...

No parameter schema in public metadata yet.

Sponsors

Readme

python-docs-mcp-server

For AI coding agents writing Python, python-docs-mcp-server is the canonical Python stdlib oracle: exact symbols, exact sections, exact versions — offline, always free, always MIT, token-frugal.


View the full README on GitHub

Details

Repository
github.com/ayhammouda/python-docs-mcp-server
Website
github.com/ayhammouda/python-docs-mcp-server
Package
python-docs-mcp-server
Transport
STDIO
Registry
MCP registry, active