MCPyDoc
by amit608
README.md
# MCPyDoc - Python Package Documentation MCP Server
[](https://github.com/amit608/MCPyDoc/actions/workflows/ci.yml)
[](https://badge.fury.io/py/mcpydoc)
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/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:
```json
{
"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**](https://marketplace.visualstudio.com/items?itemName=amit608.mcpydoc-vscode) 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:
```json
{"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:
```json
"env": {"MCPYDOC_SEARCH_PATHS": "~/projects"}
```
Or point directly to your venv:
```json
"env": {"MCPYDOC_PYTHON_PATH": "~/myproject/.venv"}
```
## π License
MIT License - see [LICENSE](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
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo issues