# ayhammouda/python-docs-mcp-server [Health: Active]

**Category:** 🎓 Education  
**Repository:** https://github.com/ayhammouda/python-docs-mcp-server  
**GitHub Stars:** 8  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ayhammouda-python-docs-mcp-server

## Description
Local, read-only retrieval over official Python standard library docs with exact symbol lookup, section-level results, and version-aware context.

## Tools
Capabilities this server exposes over MCP:

- **search_docs** — 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.
- **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.
- **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.
- **list_versions** — List all indexed Python versions with metadata.
- **detect_python_version** — Detect the user's local Python version and report whether that version has been indexed.
- **compare_versions** — Diff a Python stdlib symbol between two indexed versions. Returns `change=added

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "python-docs-mcp-server": {
    "command": "uvx",
    "args": ["python-docs-mcp-server"]
  }
}
```

## Documentation

## What ayhammouda/python-docs-mcp-server MCP server does

The ayhammouda/python-docs-mcp-server MCP server provides local, read-only access to indexed Python standard-library documentation. It is designed for coding agents that need a specific symbol, module, section, or version comparison without loading an entire documentation page into context.

The corpus is based on official Python documentation. Supported queries include exact symbols such as `asyncio.TaskGroup`, module names such as `json`, and general free-text searches. Results include ranked matches, BM25 scores, and excerpts that help the agent select the relevant page or section.

The server also includes a controlled PyPI metadata lookup. `lookup_package_docs` returns documentation, homepage, and source URLs declared by a package, rather than performing unrestricted web search.

## How it works

The ayhammouda/python-docs-mcp-server MCP server uses a local SQLite database with FTS5 search. Documentation is indexed separately for the Python versions selected during setup. The initial index build downloads Python `objects.inv` files, obtains CPython documentation sources, renders them to JSON with Sphinx, and stores the resulting searchable data locally.

A typical symbol lookup uses `search_docs` first, followed by `get_docs` with the returned slug and optional anchor. `get_docs` returns Markdown for a page or section and applies a response budget, truncation, and pagination. Retrieved responses are cached on disk using the Python documentation version and request identity.

Version-related tools report indexed versions, detect the local Python version, and compare one standard-library symbol between two indexed versions. Comparisons can identify additions, removals, changes, deprecations, signature differences, related-section changes, and note differences. Signature deltas are advisory heuristics rather than a replacement for reading the source documentation.

## Setup and configuration

Install or run the package with `uvx` or install it persistently through `pipx`. Before querying documentation, build the local corpus for the versions needed by the project. The documented example indexes Python 3.10 through 3.14, and the build may take several minutes because it prepares the source documentation and database.

The MCP configuration uses the published package as a local stdio process. Examples are provided for Claude Desktop, Cursor, Claude Code, and Codex. Claude Desktop requires restarting after its configuration changes. No API key is required. The package targets Python 3.12 or newer, while the indexed documentation versions are selected independently during the build.

## Tools and capabilities

The ayhammouda/python-docs-mcp-server MCP server exposes six read-only tools:

- `search_docs`: searches symbols, modules, and free text with ranked snippets.
- `get_docs`: retrieves a documentation page or anchored section with truncation and pagination.
- `lookup_package_docs`: reads official PyPI metadata for declared project links.
- `list_versions`: lists indexed Python versions and metadata.
- `detect_python_version`: checks the local Python version and whether it is indexed.
- `compare_versions`: reports documented differences for a symbol between two indexed versions.

## Limitations and notes

This server is focused on official Python standard-library documentation, not arbitrary web pages or general third-party library research. Its documentation results depend on the versions that have been indexed locally; an installed Python version may be detected but unavailable if it was not included in the build. `lookup_package_docs` is limited to package-declared PyPI links. Runtime access is read-only, and the server does not provide tools for modifying documentation or package metadata.

_Full upstream README: https://allmcps.com/mcp/ayhammouda-python-docs-mcp-server/readme_

