# Python Docs MCP server

> Provides AI agents with precise, version-specific access to the official Python standard library documentation via a local indexed search.

- Repository: https://github.com/ayhammouda/python-docs-mcp-server
- Page: https://hostedmcp.org/servers/ayhammouda/python-docs-mcp-server
- Transport: stdio
- Stars: 9
- License: MIT
- Latest version: 0.4.1

## Install

### Claude Code

```sh
claude mcp add python-docs-mcp-server -- uvx python-docs-mcp-server
```

### Cursor (`~/.cursor/mcp.json`)

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

### VS Code (`.vscode/mcp.json`)

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

### Claude Desktop (`claude_desktop_config.json`)

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

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.python-docs-mcp-server]
command = "uvx"
args = ["python-docs-mcp-server"]
```

### Gemini CLI (`~/.gemini/settings.json`)

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

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `PYTHON_DOCS_MCP_DISABLE_AUTO_INDEX` | no | no |  |

## Tools (7)

- `search_docs`
- `get_docs`
- `lookup_package_docs`
- `list_versions`
- `detect_python_version`
- `compare_versions`
- `whatsnew_for_version`

## FAQ

### Does this server require an API key?

No, the server does not require any API keys to function.

### How do I index specific Python versions?

You can build the local documentation index by running the build-index command with the desired versions, for example: `uvx python-docs-mcp-server build-index --versions 3.10,3.11,3.12,3.13,3.14`.

### Does the server perform web scraping at runtime?

No, the server uses a local SQLite and FTS5 index instead of runtime web scraping.

### Can I compare changes between different Python versions?

Yes, the server includes a tool to diff a Python stdlib symbol between two indexed versions.
