A simple, FastMCP server for PyPI that provides package metadata lookup capabilities to LLMs.
- Query PyPI package information and metadata
- Support for specific version queries
- Fast and lightweight FastMCP implementation
- Python 3.10 or higher
uvpackage manager (recommended) orpip
# Clone the repository
git clone https://github.com/sunil-dhaka/pypi-mcp-server.git
cd pypi-mcp-server
# Install dependencies
uv sync# Clone the repository
git clone https://github.com/sunil-dhaka/pypi-mcp-server.git
cd pypi-mcp-server
# Install dependencies
pip install fastmcp httpxThe server provides a single tool get_package_metadata that can query PyPI for package information.
Add this configuration to your MCP client settings:
"pypi-mcp": {
"command": "uv",
"args": ["run", "/absolute/path/to/server.py"]
}Or if using pip:
"pypi-mcp": {
"command": "python",
"args": ["/absolute/path/to/server.py"]
}Retrieves metadata for a PyPI package.
Parameters:
package(string, required): The PyPI package nameversion(string, optional): Specific version to query
Returns:
- Package version
- Description
- Summary
- Project URLs
- Python version requirements
Example Usage:
# Get latest package info
result = await get_package_metadata("requests")
# Get specific version info
result = await get_package_metadata("requests", "2.31.0")The server provides helpful error messages and suggestions for common issues:
- Package not found
- Version not found
- Network connectivity issues
- Invalid package names
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.