Model Context Protocol (MCP) server providing documentation and code analysis for Python packages
Project description
MCPyDoc - Python Package Documentation MCP Server
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 mcpydocinstead ofuvx, or install globally withpip install mcpydocand usepython -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:
- MCP Client Roots - Auto-detected from your IDE workspace (zero config!)
MCPYDOC_PYTHON_PATH- Manual override:"env": {"MCPYDOC_PYTHON_PATH": "~/myproject/.venv"}VIRTUAL_ENV- Activated virtual environment- Common directories - Searches
~/projects,~/dev,~/code, etc. 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?
- Check your project has a
.venvorvenvdirectory - Verify the package is installed:
pip list | grep package-name - If needed, set
MCPYDOC_PYTHON_PATHexplicitly
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
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05f4a0cb1b1c5e91ee9a14170112231906c71e665ac40e1b8ed53021494dea1c
|
|
| MD5 |
ebcf2014fdf30a4777c751ff93b96bb5
|
|
| BLAKE2b-256 |
eae13d7e6b28f51f2edec26ed4d0d87182d92ad9f2040b71acee0a479ee9f74e
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
049144f4ce0544eb6fc42e810e0f03463664434843e0f050f9c216843a129ffa
|
|
| MD5 |
c515942c886fe307673c08c34ddd813d
|
|
| BLAKE2b-256 |
20c361a2646f6c62b4d62818a34d95d617d4e89f198ff7c0c41b4a65c3d44292
|