Provides programmatic access to PyPI package data via MCP for searching, metadata, releases, and stats.
Configuration
View docs{
"mcpServers": {
"jackkuo666-pypi-mcp-server": {
"command": "python",
"args": [
"pypi_server.py"
]
}
}
}PyPI MCP Server lets AI assistants search PyPI and fetch package metadata through the Model Context Protocol (MCP). It provides fast access to package information, version histories, and download statistics, enabling assistants to answer questions about Python packages and their releases directly.
You use this server by connecting an MCP client to it over standard input/output (stdio). The server exposes tools to search for PyPI packages, retrieve detailed metadata for a package (optionally for a specific version), list all released versions, and get download statistics. In your MCP-enabled assistant, invoke these tools by calling their corresponding functions and passing the required arguments. The server processes your requests and returns structured results that your assistant can display or use in further reasoning.
Practical usage patterns you can perform include: - Searching for packages by keywords to discover relevant projects - Getting comprehensive metadata for a package to surface dependencies, authors, and descriptions - Viewing all released versions to understand version history - Retrieving download statistics to gauge a package’s popularity over time
Prerequisites: Install Python 3.10 or newer and ensure you can run Python commands from your shell.
Step 1: Set up a working directory for the server.
Step 2: Install required dependencies.
Step 3: Run the server to start listening for MCP client connections.
Use the following concrete commands in order.
git clone https://example.org/pyppi-mcp-server.git
cd pyppi-mcp-server
# Install Python dependencies
pip install -r requirements.txt
# Start the MCP server (stdio mode)
python pypi_server.pyThe server communicates with MCP clients through standard input/output (stdio). There is no network port listening to configure.
Integration example for an MCP-enabled assistant (Claude Desktop) shows how to wire the server as a local stdio MCP server.
{
"mcpServers": {
"pypi": {
"command": "python",
"args": ["pypi_server.py"]
}
}
}The server offers four core tools that you can call from your MCP client to access PyPI data.
Examples of tool usage in your MCP-enabled assistant include searching for a package, retrieving package information, listing releases, and getting statistics.
Fetches detailed information about a specific PyPI package, with an optional version filter to retrieve metadata for that version.
Searches PyPI packages by keywords and returns a list of matching packages with metadata.
Returns all released versions for a specified package, enabling you to inspect version history.
Retrieves download statistics for a specified package to gauge its usage trends.