Model Context Protocol (MCP) server providing documentation and code analysis for Python packages
Project description
MCPyDoc - Python Package Documentation MCP Server
AI assistants often hallucinate when code depends on private or unfamiliar Python packages: guessed APIs, wrong signatures, and outdated usage that breaks at runtime. MCPyDoc fixes that by giving your assistant real-time access to the actual documentation and source code of the Python packages installed in your environment.
MCPyDoc is a Model Context Protocol (MCP) server that provides comprehensive documentation and code analysis capabilities for Python packages. It enables AI agents like Cline and GitHub Copilot to understand and work with Python codebases more effectively.
✨ Features
- 📚 Package Documentation: Get 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
- 🔧 Type Hints: Extract and analyze type annotations
- 📖 Docstring Parsing: Support for Google, NumPy, and Sphinx formats
- 🏃 High Performance: Efficient caching and optimized operations
- 🛡️ Error Handling: Robust error management and validation
🚀 Quick Start
VS Code Extension
For a zero-config setup inside VS Code, install the MCPyDoc extension.
It registers the server using the MCP Server Definition Provider API and
automatically ensures the mcpydoc package is available when the server starts.
Installation for PyCharm AI Assistant
-
Install MCPyDoc in the Python interpreter PyCharm will use for AI Assistant:
pip install mcpydoc
💡 If you use multiple interpreters/virtual environments, make sure
mcpydocis installed in the same environment PyCharm uses for MCP servers. You can check or change this in Settings → Project → Python Interpreter. -
Open MCP configuration: Go to Settings → Tools → AI Assistant → Model Context Protocol (MCP).
-
Add a new server:
-
Click Add → As JSON, and paste:
{ "mcpServers": { "mcpydoc": { "command": "python", "args": ["-m", "mcpydoc"], "env": {}, "description": "Python package documentation and code analysis server" } } }
Or use Add → Command and fill:
- Command:
python - Arguments:
-m mcpydoc
- Command:
-
-
Apply and restart AI Assistant: PyCharm will launch MCPyDoc automatically when the AI Assistant starts.
Installation for Other Platforms
-
Install MCPyDoc:
pip install mcpydoc
Alternative: You can also use
pipx install mcpydocoruvx mcpydocif you prefer isolated environments. -
Add to your MCP configuration:
{ "mcpServers": { "mcpydoc": { "command": "python", "args": ["-m", "mcpydoc"], "env": {}, "description": "Python package documentation and code analysis server" } } }
💡 Platform Note: On some Linux/macOS systems, you may need to use
python3instead ofpython. To check which command is available, runpython --versionorpython3 --versionin your terminal.💡 pipx users: If you installed with pipx, you can use
"command": "mcpydoc"with empty args instead.
Development Installation
If you want to contribute or modify the source code:
git clone https://github.com/amit608/MCPyDoc.git
cd MCPyDoc
pip install -e .[dev]
📊 Supported Package Types
- ✅ Standard Library - Built-in modules (
json,os,sys, etc.) - ✅ Third-Party Packages - pip-installed packages
- ✅ Local Packages - Development packages in current environment
- ✅ Virtual Environments - Proper path resolution
📝 License
MIT License - see LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run the test suite
- 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.2.0.tar.gz.
File metadata
- Download URL: mcpydoc-1.2.0.tar.gz
- Upload date:
- Size: 847.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b215f9c91a00cb11e61fb1174b7748c04865e12a7bbec474c9abcb52073135f4
|
|
| MD5 |
cf1e44c6d5ad75170753420bf75d7326
|
|
| BLAKE2b-256 |
598d821b8f45dd0af506d7f014af5c0e883df7d45a3911ad2413936ddc3c6e30
|
File details
Details for the file mcpydoc-1.2.0-py3-none-any.whl.
File metadata
- Download URL: mcpydoc-1.2.0-py3-none-any.whl
- Upload date:
- Size: 27.8 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 |
a04d15189efe3bd87d665b1584f4d23561cade9ff6df1411f85190abdf1259e3
|
|
| MD5 |
a4d8e1a91c9843e6341d803a964c8279
|
|
| BLAKE2b-256 |
46f0c8136a0e4723d2eadcc62c10d1687abf8bbb87a9dd211c46c359314f910a
|