A Model Context Protocol (MCP) server for querying PyPI package information, dependencies, and compatibility
Project description
PyPI Query MCP Server
A Model Context Protocol (MCP) server for querying PyPI package information, dependencies, and compatibility checking.
Features
- 📦 Query PyPI package information (name, version, description, dependencies)
- 🐍 Python version compatibility checking
- 🔍 Dependency analysis and resolution
- 🏢 Private PyPI repository support
- ⚡ Fast async operations with caching
- 🛠️ Easy integration with MCP clients
Installation
Using uvx (recommended)
# Run directly with uvx
uvx pypi-query-mcp-server
# Or install and run
uvx --from pypi-query-mcp-server pypi-query-mcp
Using pip
# Install from PyPI
pip install pypi-query-mcp-server
# Run the server
python -m pypi_query_mcp.server
From source
git clone https://github.com/loonghao/pypi-query-mcp-server.git
cd pypi-query-mcp-server
uv sync
uv run pypi-query-mcp
Configuration
Claude Desktop
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": ["pypi-query-mcp-server"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/simple/",
"CACHE_TTL": "3600"
}
}
}
}
Cline
Add to your Cline MCP settings (cline_mcp_settings.json):
{
"mcpServers": {
"pypi-query": {
"command": "uvx",
"args": ["pypi-query-mcp-server"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/simple/",
"CACHE_TTL": "3600"
}
}
}
}
Cursor
Add to your Cursor MCP configuration (.cursor/mcp.json):
{
"mcpServers": {
"pypi-query": {
"command": "uvx",
"args": ["pypi-query-mcp-server"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/simple/",
"CACHE_TTL": "3600"
}
}
}
}
Windsurf
Add to your Windsurf MCP configuration (~/.codeium/windsurf/mcp_config.json):
{
"mcpServers": {
"pypi-query": {
"command": "uvx",
"args": ["pypi-query-mcp-server"],
"env": {
"PYPI_INDEX_URL": "https://pypi.org/simple/",
"CACHE_TTL": "3600"
}
}
}
}
Environment Variables
PYPI_INDEX_URL: PyPI index URL (default: https://pypi.org/simple/)CACHE_TTL: Cache time-to-live in seconds (default: 3600)PRIVATE_PYPI_URL: Private PyPI repository URL (optional)PRIVATE_PYPI_USERNAME: Private PyPI username (optional)PRIVATE_PYPI_PASSWORD: Private PyPI password (optional)
Available MCP Tools
The server provides the following MCP tools:
- get_package_info - Get comprehensive package information
- get_package_versions - List all available versions for a package
- get_package_dependencies - Analyze package dependencies
- check_package_python_compatibility - Check Python version compatibility
- get_package_compatible_python_versions - Get all compatible Python versions
Example Usage with MCP Client
# 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"
})
Development Status
🎉 Core functionality implemented and ready for use!
Current implementation status:
- ✅ Basic project structure
- ✅ PyPI API client with caching
- ✅ MCP tools implementation (package info, versions, dependencies)
- ✅ Python version compatibility checking
- ✅ CI/CD pipeline with multi-platform testing
- ⏳ Private repository support (planned)
- ⏳ Advanced dependency analysis (planned)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pypi_query_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: pypi_query_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba36fbf0196e18ce958cba2ae7c4bc3dba8d25b4bb9d7c2e00903f5dfa5de183
|
|
| MD5 |
c15b6f45a0068d7032405100a15a1ee0
|
|
| BLAKE2b-256 |
e343554eca6852e1a5652b99ef7168aade801d22fbea26eaae93f8894543342d
|
Provenance
The following attestation bundles were made for pypi_query_mcp_server-0.1.0.tar.gz:
Publisher:
release.yml on loonghao/pypi-query-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypi_query_mcp_server-0.1.0.tar.gz -
Subject digest:
ba36fbf0196e18ce958cba2ae7c4bc3dba8d25b4bb9d7c2e00903f5dfa5de183 - Sigstore transparency entry: 220222414
- Sigstore integration time:
-
Permalink:
loonghao/pypi-query-mcp-server@f27493d8d21e12a81cb9dd12909c6687736a8f59 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/loonghao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f27493d8d21e12a81cb9dd12909c6687736a8f59 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pypi_query_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pypi_query_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
156adb0f2ce052fabc07c890bc5db601239cade1f63b78457a18ad9b3855f2e2
|
|
| MD5 |
5eaa316f91e56cf65361d52543f56cc8
|
|
| BLAKE2b-256 |
6692d572a17608e3f5a182a8db5de8147d5515fc0d33600ae77ddb97f6967e22
|
Provenance
The following attestation bundles were made for pypi_query_mcp_server-0.1.0-py3-none-any.whl:
Publisher:
release.yml on loonghao/pypi-query-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypi_query_mcp_server-0.1.0-py3-none-any.whl -
Subject digest:
156adb0f2ce052fabc07c890bc5db601239cade1f63b78457a18ad9b3855f2e2 - Sigstore transparency entry: 220222417
- Sigstore integration time:
-
Permalink:
loonghao/pypi-query-mcp-server@f27493d8d21e12a81cb9dd12909c6687736a8f59 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/loonghao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f27493d8d21e12a81cb9dd12909c6687736a8f59 -
Trigger Event:
push
-
Statement type: