A server to query the Python Package Index (PyPI) for package information, dependencies, and compatibility.
A Model Context Protocol (MCP) server for querying PyPI package information, dependencies, and compatibility checking.
# Run directly with uvx
uvx pypi-query-mcp-server
# Or install and run with specific script
uvx --from pypi-query-mcp-server pypi-query-mcp
# Install from PyPI
pip install pypi-query-mcp-server
# Run the server
python -m pypi_query_mcp.server
git clone https://github.com/loonghao/pypi-query-mcp-server.git
cd pypi-query-mcp-server
uv sync
uv run pypi-query-mcp
Add to your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"pypi-query": {
"command": "uvx",
"args": ["--from", "pypi-query-mcp-server", "pypi-query-mcp"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/pypi",
"PYPI_INDEX_URLS": "https://mirrors.aliyun.com/pypi/simple/,https://pypi.tuna.tsinghua.edu.cn/simple/",
"PYPI_CACHE_TTL": "3600",
"PYPI_LOG_LEVEL": "INFO"
}
}
}
}
{
"mcpServers": {
"pypi-query": {
"command": "uvx",
"args": ["--from", "pypi-query-mcp-server", "pypi-query-mcp"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/pypi",
"PYPI_PRIVATE_PYPI_URL": "https://private.pypi.company.com",
"PYPI_PRIVATE_PYPI_USERNAME": "your_username",
"PYPI_PRIVATE_PYPI_PASSWORD": "your_password",
"PYPI_CACHE_TTL": "3600"
}
}
}
}
Add to your Cline MCP settings (cline_mcp_settings.json
):
{
"mcpServers": {
"pypi-query": {
"command": "uvx",
"args": ["--from", "pypi-query-mcp-server", "pypi-query-mcp"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/simple/",
"CACHE_TTL": "3600"
}
}
}
}
Add to your Cursor MCP configuration (.cursor/mcp.json
):
{
"mcpServers": {
"pypi-query": {
"command": "uvx",
"args": ["--from", "pypi-query-mcp-server", "pypi-query-mcp"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/simple/",
"CACHE_TTL": "3600"
}
}
}
}
Add to your Windsurf MCP configuration (~/.codeium/windsurf/mcp_config.json
):
{
"mcpServers": {
"pypi-query": {
"command": "uvx",
"args": ["--from", "pypi-query-mcp-server", "pypi-query-mcp"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/simple/",
"CACHE_TTL": "3600"
}
}
}
}
PYPI_INDEX_URL
: Primary PyPI index URL (default: https://pypi.org/pypi)PYPI_CACHE_TTL
: Cache time-to-live in seconds (default: 3600)PYPI_LOG_LEVEL
: Logging level (default: INFO)PYPI_REQUEST_TIMEOUT
: HTTP request timeout in seconds (default: 30.0)PYPI_INDEX_URLS
: Additional PyPI index URLs (comma-separated, optional)PYPI_EXTRA_INDEX_URLS
: Extra PyPI index URLs for fallback (comma-separated, optional)PYPI_PRIVATE_PYPI_URL
: Private PyPI repository URL (optional)PYPI_PRIVATE_PYPI_USERNAME
: Private PyPI username (optional)PYPI_PRIVATE_PYPI_PASSWORD
: Private PyPI password (optional)PYPI_DEPENDENCY_MAX_DEPTH
: Maximum depth for recursive dependency analysis (default: 5)PYPI_DEPENDENCY_MAX_CONCURRENT
: Maximum concurrent dependency queries (default: 10)PYPI_ENABLE_SECURITY_ANALYSIS
: Enable security vulnerability analysis (default: false)# Use multiple mirror sources for better availability
export PYPI_INDEX_URL="https://pypi.org/pypi"
export PYPI_INDEX_URLS="https://mirrors.aliyun.com/pypi/simple/,https://pypi.tuna.tsinghua.edu.cn/simple/"
export PYPI_EXTRA_INDEX_URLS="https://test.pypi.org/simple/"
# Private repository configuration
export PYPI_PRIVATE_PYPI_URL="https://private.pypi.company.com"
export PYPI_PRIVATE_PYPI_USERNAME="your_username"
export PYPI_PRIVATE_PYPI_PASSWORD="your_password"
The server provides the following MCP tools:
📖 Learn more about prompt templates: See PROMPT_TEMPLATES.md for detailed documentation and examples.
Once configured in your MCP client (Claude Desktop, Cline, Cursor, Windsurf), you can ask questions like:
User: "Check if Django 4.2 is compatible with Python 3.9"
AI Assistant: I'll check Django 4.2's compatibility with Python 3.9 for you.
[Uses get_package_info and check_package_python_compatibility tools]
User: "What are the main dependencies of FastAPI?"
AI Assistant: Let me get the dependency information for FastAPI.
[Uses get_package_dependencies tool]
User: "Show me the download statistics for the requests package and tell me which is more popular: requests or urllib3?"
AI Assistant: I'll get the download statistics for both packages and compare their popularity.
[Uses get_download_statistics tool for both packages]
# Example: Check if Django is compatible with Python 3.9
result = await mcp_client.call_tool("check_package_python_compatibility", {
"package_name": "django",
"target_python_version": "3.9"
})
# Example: Get package information
info = await mcp_client.call_tool("get_package_info", {
"package_name": "requests"
})
# Example: Get download statistics
stats = await mcp_client.call_tool("get_download_statistics", {
"package_name": "numpy",
"period": "month"
})
# Example: Get top downloaded packages
top_packages = await mcp_client.call_tool("get_top_downloaded_packages", {
"period": "week",
"limit": 10
})
🎉 Core functionality implemented and ready for use!
Current implementation status:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Enable AI Agents to fix build failures from CircleCI.
Converts LaTeX mathematical expressions to MathML format using MathJax-node.
Interact with Odoo instances using the XML-RPC API. Requires configuration via environment variables or config files.
A server for securely executing commands on the host system, requiring Java 21 or higher.
Integrates with Jenkins CI/CD systems for AI-powered insights, build management, and debugging.
Manage Xcode simulators.
Single tool to control all 100+ API integrations, and UI components
Performs data enrichment on observables using third-party services via the security-cli Python package.
An AI-powered server providing access to multiple models for code analysis, problem-solving, and collaborative development with guided workflows.
A platform for creating and managing AI agents with specific personalities and simulating their responses. Requires a DeepSeek API key.