Python Docs MCP Server — Claude Code 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.
claude mcp add python-docs-mcp-server -- uvx python-docs-mcp-serverWhat Python Docs MCP Server 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.
What it helps with
- 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 for the agent
- Check the signature of
asyncio.TaskGroupin Python 3.13. - Look up path handling rules for
pathlib.Pathin Python 3.12. - Find standard library changes introduced in Python 3.14.
How to install Python Docs MCP Server
Platform CLI
claude mcp add python-docs-mcp-server -- uvx python-docs-mcp-serveruvx runs the command named after the package; if the README names another one, use uvx --from python-docs-mcp-server <command>
Platform CLI
codex mcp add python-docs-mcp-server -- uvx python-docs-mcp-serveruvx runs the command named after the package; if the README names another one, use uvx --from python-docs-mcp-server <command>
Config file
{
"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>
Config file
{
"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>
Platform CLI
gemini mcp add python-docs-mcp-server uvx python-docs-mcp-serveruvx runs the command named after the package; if the README names another one, use uvx --from python-docs-mcp-server <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Python Docs MCP Server
How to install Python Docs MCP Server in Claude Code?
Run claude mcp add python-docs-mcp-server -- uvx python-docs-mcp-server. Next, generate the local documentation index with uvx python-docs-mcp-server build-index --versions 3.10,3.11,3.12,3.13,3.14.
What does Python Docs MCP Server do?
It builds an offline SQLite index of official Python documentation and provides seven read-only tools to retrieve exact standard library symbols and section text by version.
Does Python Docs MCP Server require internet access or API tokens?
No API keys are needed. Network connectivity is only required once during the initial build-index command to fetch Sphinx sources and inventory files.