# Python Docs MCP Server

Provides an offline SQLite index of Python stdlib documentation for coding agents. Fetches exact symbols and sections per language version without scraping web pages.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: ayhammouda
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ayhammouda/python-docs-mcp-server
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/mcp/python-docs-mcp-server

## What it does

Large web page dumps pollute model context and cause retrieval errors. This MCP server solves that by caching CPython documentation locally using Sphinx JSON output and an SQLite FTS5 database. When an agent requests a module, it inspects Python `objects.inv` records and returns only the targeted section. Seven read-only tools handle lookups without hitting external APIs at query time.

Documentation targets span Python 3.10 through 3.15. The model receives information tied strictly to the specified language release, preventing confusion over updated syntax like `asyncio.TaskGroup`. Result payloads enforce safety boundaries: search responses stay under 8000 UTF-8 bytes, and text fetches via `get_docs` stop at 8000 characters.

Running the tool requires Python 3.12 or later. Queries fail outright until you run the initial `build-index` step, which clones CPython documentation sources and builds the database locally.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add python-docs-mcp-server -- uvx python-docs-mcp-server
```
uvx runs the command named after the package; if the README names another one, use uvx --from python-docs-mcp-server <command>

### Codex

**Platform CLI**
```bash
codex mcp add python-docs-mcp-server -- uvx python-docs-mcp-server
```
uvx runs the command named after the package; if the README names another one, use uvx --from python-docs-mcp-server <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "python-docs-mcp-server": {
            "command": "uvx",
            "args": [
                "python-docs-mcp-server"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from python-docs-mcp-server <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "python-docs-mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "python-docs-mcp-server"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from python-docs-mcp-server <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add python-docs-mcp-server uvx python-docs-mcp-server
```
uvx runs the command named after the package; if the README names another one, use uvx --from python-docs-mcp-server <command>

## When to use it
- locate exact standard library signatures for a specific Python release
- retrieve targeted documentation sections without loading entire web pages
- inspect differences across Python versions from 3.10 to 3.15
- query CPython reference manuals offline without third-party API credentials

## Example prompts
- Check the signature of `asyncio.TaskGroup` in Python 3.13.
- Look up path handling rules for `pathlib.Path` in Python 3.12.
- Find standard library changes introduced in Python 3.14.

## Similar
- [Serena MCP: the IDE for your agent](https://affpapa.org/en/nevibecode/mcp/serena-mcp-the-ide-for-your-agent.md) — MCP server · ★ 30739
- [Compiler Explorer](https://affpapa.org/en/nevibecode/mcp/compiler-explorer.md) — MCP server · ★ 19155
- [Claude Code Explorer MCP](https://affpapa.org/en/nevibecode/mcp/claude-code-explorer-mcp.md) — MCP server · ★ 6236
- [Tolgee](https://affpapa.org/en/nevibecode/mcp/tolgee.md) — MCP server · ★ 4140
- [jshookmcp](https://affpapa.org/en/nevibecode/mcp/jshookmcp.md) — MCP server · ★ 2066
- [pyscn](https://affpapa.org/en/nevibecode/mcp/pyscn.md) — MCP server · ★ 1097

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
