pypi-query
A Model Context Protocol (MCP) server for Python package intelligence, providing structured queries for PyPI packages and GitHub repositories. Features include dependency analysis, version tracking, and package metadata retrieval for LLM interactions.
claude mcp add --transport stdio loonghao-pypi-query-mcp-server uvx --from pypi-query-mcp-server pypi-query-mcp \ --env PYPI_CACHE_TTL="3600" \ --env PYPI_INDEX_URL="https://pypi.org/pypi" \ --env PYPI_LOG_LEVEL="INFO" \ --env PYPI_INDEX_URLS=""
How to use
The PyPI Query MCP Server provides a comprehensive tooling surface for interacting with PyPI data through the MCP framework. It can query package metadata, list versions, analyze dependencies, check Python compatibility, and perform advanced dependency analyses including recursive resolution. It also supports downloading packages with their dependencies, collecting download statistics and trends, and presenting results through MCP prompt templates for guided decision-making. Use the available MCP tools to inspect packages, compare versions, resolve dependency graphs, and generate structured prompts for analysis or migration planning. Typical workflows include querying a package's info, checking compatible Python versions, resolving dependencies for installation planning, and optionally downloading the package with its dependencies for local analysis or offline use.
How to install
Prerequisites:
- Python (>= 3.8) or a runtime environment capable of running MCP servers
- Node.js is not required for this server since uvx (Python) is the recommended runner
- Access to install and run uvx or install via PyPI
Option A: Run with uvx (recommended)
- Install the MCP server via uvx:
uvx --from pypi-query-mcp-server pypi-query-mcp
- Run the server directly (if you have the package available in the environment):
uvx pypi-query-mcp-server
- Or specify the exact command as demonstrated in the configuration:
uvx --from pypi-query-mcp-server pypi-query-mcp
Option B: Install from PyPI and run with Python
- Install the package from PyPI:
pip install pypi-query-mcp-server
- Run the server:
python -m pypi_query_mcp.server
Option C: From source
- Clone the repository and install dependencies, then run with uvx as shown in the README:
git clone https://github.com/loonghao/pypi-query-mcp-server.git
cd pypi-query-mcp-server
uv sync
uv run pypi-query-mcp
Additional notes
Environment variables control indexing, caching, and security checks. Common options include:
- PYPI_INDEX_URL: Primary PyPI index URL (default: https://pypi.org/pypi)
- PYPI_CACHE_TTL: Cache duration in seconds (default: 3600)
- PYPI_LOG_LEVEL: Logging level (default: INFO)
- PYPI_INDEX_URLS: Additional mirror sources (comma-separated)
- PYPI_PRIVATE_PYPI_URL / PYPI_PRIVATE_PYPI_USERNAME / PYPI_PRIVATE_PYPI_PASSWORD: Optional private PyPI configuration
Tips:
- If you rely on private packages, configure PYPI_PRIVATE_PYPI_URL and credentials to enable private index access.
- Adjust PYPI_DEPENDENCY_MAX_DEPTH and concurrency settings to tune performance for large dependency graphs.
- Use the available MCP tools for automated prompt generation (e.g., analyze_package_quality, resolve_dependencies) to guide decisions.
- Ensure network access to configured PyPI indices; behind proxies may require additional environment variables.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP