Skip to main content

Model Context Protocol (MCP) server providing documentation and code analysis for Python packages

Project description

MCPyDoc - Python Package Documentation MCP Server

CI PyPI version Python 3.9+ License: MIT

AI assistants hallucinate when working with unfamiliar Python packages—guessing APIs, wrong signatures, outdated usage. MCPyDoc fixes that by giving your assistant real-time access to actual documentation and source code from your environment.

✨ Features

  • 📚 Package Documentation - Comprehensive docs for any Python package
  • 🔍 Symbol Search - Find classes, functions, and modules by pattern
  • 💻 Source Code Access - Retrieve actual implementation code
  • 🏗️ Structure Analysis - Analyze complete package architecture
  • 🔧 Auto-Environment Detection - Finds your project's venv automatically

🚀 Quick Start

Zero Config (Recommended)

With compatible MCP clients (Cursor, VS Code), MCPyDoc automatically detects your workspace and virtual environment. Just add to your MCP config:

{
  "mcpServers": {
    "mcpydoc": {
      "command": "uvx",
      "args": ["mcpydoc"]
    }
  }
}

Alternatives: Use pipx run mcpydoc instead of uvx, or install globally with pip install mcpydoc and use python -m mcpydoc.

VS Code Extension

For VS Code, install the MCPyDoc extension for a fully automatic setup.

🔧 Environment Detection

MCPyDoc automatically finds your Python environment in this priority order:

  1. MCP Client Roots - Auto-detected from your IDE workspace (zero config!)
  2. MCPYDOC_PYTHON_PATH - Manual override: "env": {"MCPYDOC_PYTHON_PATH": "~/myproject/.venv"}
  3. VIRTUAL_ENV - Activated virtual environment
  4. Common directories - Searches ~/projects, ~/dev, ~/code, etc.
  5. MCPYDOC_SEARCH_PATHS - Custom: "env": {"MCPYDOC_SEARCH_PATHS": "~/work,~/repos"}

Per-Project Config

Create .mcpydoc.json in your project root:

{"python_path": ".venv"}

🔍 Troubleshooting

Package not found?

  1. Check your project has a .venv or venv directory
  2. Verify the package is installed: pip list | grep package-name
  3. If needed, set MCPYDOC_PYTHON_PATH explicitly

MCPyDoc shows "isolated pipx/uvx environment"?

Add your projects directory:

"env": {"MCPYDOC_SEARCH_PATHS": "~/projects"}

Or point directly to your venv:

"env": {"MCPYDOC_PYTHON_PATH": "~/myproject/.venv"}

📝 License

MIT License - see LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Submit a pull request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpydoc-1.4.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpydoc-1.4.0-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file mcpydoc-1.4.0.tar.gz.

File metadata

  • Download URL: mcpydoc-1.4.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcpydoc-1.4.0.tar.gz
Algorithm Hash digest
SHA256 05f4a0cb1b1c5e91ee9a14170112231906c71e665ac40e1b8ed53021494dea1c
MD5 ebcf2014fdf30a4777c751ff93b96bb5
BLAKE2b-256 eae13d7e6b28f51f2edec26ed4d0d87182d92ad9f2040b71acee0a479ee9f74e

See more details on using hashes here.

File details

Details for the file mcpydoc-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: mcpydoc-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcpydoc-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 049144f4ce0544eb6fc42e810e0f03463664434843e0f050f9c216843a129ffa
MD5 c515942c886fe307673c08c34ddd813d
BLAKE2b-256 20c361a2646f6c62b4d62818a34d95d617d4e89f198ff7c0c41b4a65c3d44292

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page