mcpypi


Namemcpypi JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/loonghao/pypi-query-mcp-server
Summary🎤 mcpypi - Your Master of Ceremonies for PyPI! The ultimate PyPI package intelligence platform through Model Context Protocol (MCP)
upload_time2025-09-06 17:46:02
maintainerNone
docs_urlNone
authorHal
requires_python<4.0,>=3.10
licenseMIT
keywords mcp pypi package dependency python security license analysis intelligence claude
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # 🎤 mcpypi 🥧
### *Your Master of Ceremonies for PyPI*

<div align="center">

[![PyPI version](https://img.shields.io/pypi/v/mcpypi.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/mcpypi/)
[![Python versions](https://img.shields.io/pypi/pyversions/mcpypi.svg?style=for-the-badge&logo=python&logoColor=white)](https://pypi.org/project/mcpypi/)
[![Downloads](https://img.shields.io/pypi/dm/mcpypi.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/mcpypi/)
[![License](https://img.shields.io/pypi/l/mcpypi.svg?style=for-the-badge)](https://github.com/loonghao/pypi-query-mcp-server/blob/main/LICENSE)

</div>

---

> **mcpypi** (pronounced "MC-py-pie") is your **Master of Ceremonies** for PyPI! 🎤
> 
> *The ultimate PyPI package intelligence platform, now available through Model Context Protocol*

Just like a world-class DJ or MC controls the music and keeps the party flowing, **mcpypi** orchestrates your entire Python package ecosystem. It's the perfect fusion of "**MCP**" + "**PyPI**" + the Python community's beloved tradition of naming everything with "**pie**" 🥧 (NumPy, SciPy, SymPy... you get it!).

Think of mcpypi as your **intelligent package DJ** - it knows all the tracks (packages), their dependencies, security vulnerabilities, licenses, and can help you mix the perfect environment for your Python projects!

## 🌟 Why mcpypi?

<table>
<tr>
<td width="50%">

### 🎯 **37 Powerful Tools**
Complete PyPI analysis suite across 8 categories

### 🔒 **Security First**
OSV database integration + GitHub advisories

### 📊 **Real-time Analytics** 
Live download stats, trends, and rankings

### 🏥 **Health Scoring**
7-category package quality assessment

</td>
<td width="50%">

### 📄 **License Intelligence**
SPDX compatibility analysis + risk assessment  

### 🔍 **Deep Analysis**
Dependency trees, requirements parsing, bulk operations

### ⚡ **Lightning Fast**
Async operations with intelligent caching

### 🎤 **MCP Integration**
Works with Claude Code, Claude Desktop, Cursor, and more!

</td>
</tr>
</table>

## Features

Your MC knows how to drop the beats! 🎵

- 📦 **Track Info** - Get the full story on any PyPI package (metadata, versions, dependencies)
- 🐍 **Compatibility Check** - Know which Python versions can handle your tracks
- 🔍 **Deep Mixing** - Advanced dependency analysis and recursive resolution to avoid conflicts
- 📥 **Collection Building** - Download packages with all their dependencies for offline mixing
- 📊 **Chart Analysis** - Real-time download statistics and popularity trends 
- 🏆 **Top 40** - Discover the hottest packages trending right now
- 🔒 **Security Scanning** - Keep your playlist safe from vulnerable packages
- 📄 **License Mixing** - Ensure your package mix is legally compatible
- 🏥 **Health Check** - Assess package quality across 7 key metrics
- 📋 **Setlist Analysis** - Parse and analyze requirements files in any format
- 🎯 **Smart Prompts** - MCP templates for guided decision-making
- 🏢 **Private Venues** - Support for private PyPI repositories  
- ⚡ **Live Performance** - Fast async operations with intelligent caching
- 🛠️ **Universal Mixer** - Easy integration with all MCP clients

## 🚀 Quick Start

Ready to get your MC on the decks? Here's how to book mcpypi for your next Python party! 🎉

### Option 1: Lightning Setup ⚡ (Recommended)

```bash
# One-liner - Run immediately with uvx
uvx mcpypi
```

### Option 2: Traditional Install 📦

```bash
# Install from PyPI
pip install mcpypi

# Run the server  
python -m pypi_query_mcp.server
```

### Option 3: Claude Code Integration 🎤

```bash  
# Connect directly to Claude Code
claude mcp add mcpypi -- uvx mcpypi
```

<div align="center">

### 🎊 **That's it! Your MC is now live and ready to rock!** 🎊

</div>

---

## 🎭 Live Demo

Here's what your MC can do for you:

<table>
<tr>
<td align="center">

### 🔍 **Package Intelligence**
```python
"What are the security vulnerabilities 
in Django 4.1?"
```
*Get real-time security analysis with OSV database*

</td>
<td align="center">

### 📊 **Trend Analysis**
```python
"Show me the top 10 trending 
ML packages this week"
```
*Live PyPI download trends and rankings*

</td>
</tr>
<tr>
<td align="center">

### 🏥 **Health Scoring**
```python
"Compare the health scores of 
FastAPI vs Django vs Flask"
```
*7-category quality assessment with GitHub metrics*

</td>
<td align="center">

### 📄 **License Compliance**
```python
"Check if my requirements.txt 
is MIT license compatible"
```
*SPDX normalization with risk assessment*

</td>
</tr>
</table>

---

### 🛠️ Advanced Installation

<details>
<summary><b>Development Setup</b></summary>

```bash
git clone https://github.com/loonghao/pypi-query-mcp-server.git
cd pypi-query-mcp-server
uv sync
uv run pypi-query-mcp
```

</details>

---

## 🎛️ Configuration

<div align="center">

**mcpypi works with ALL major MCP clients!**

[![Claude Desktop](https://img.shields.io/badge/Claude_Desktop-Ready-blue?style=for-the-badge&logo=anthropic)](https://claude.ai/desktop)
[![Claude Code](https://img.shields.io/badge/Claude_Code-Ready-blue?style=for-the-badge&logo=anthropic)](https://claude.ai/code)
[![Cursor](https://img.shields.io/badge/Cursor-Ready-blue?style=for-the-badge&logo=cursor)](https://cursor.sh/)
[![Windsurf](https://img.shields.io/badge/Windsurf-Ready-blue?style=for-the-badge)](https://codeium.com/windsurf)

</div>

### 🖥️ 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`

```json
{
  "mcpServers": {
    "pypi-query": {
      "command": "uvx",
      "args": ["--from", "mcpypi", "mcpypi"],
      "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"
      }
    }
  }
}
```

#### With Private Repository
```json
{
  "mcpServers": {
    "pypi-query": {
      "command": "uvx",
      "args": ["--from", "mcpypi", "mcpypi"],
      "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"
      }
    }
  }
}
```

### Cline

Add to your Cline MCP settings (`cline_mcp_settings.json`):

```json
{
  "mcpServers": {
    "pypi-query": {
      "command": "uvx",
      "args": ["--from", "mcpypi", "mcpypi"],
      "env": {
        "PYPI_INDEX_URL": "https://pypi.org/simple/",
        "CACHE_TTL": "3600"
      }
    }
  }
}
```

### Cursor

Add to your Cursor MCP configuration (`.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "pypi-query": {
      "command": "uvx",
      "args": ["--from", "mcpypi", "mcpypi"],
      "env": {
        "PYPI_INDEX_URL": "https://pypi.org/simple/",
        "CACHE_TTL": "3600"
      }
    }
  }
}
```

### Windsurf

Add to your Windsurf MCP configuration (`~/.codeium/windsurf/mcp_config.json`):

```json
{
  "mcpServers": {
    "pypi-query": {
      "command": "uvx",
      "args": ["--from", "mcpypi", "mcpypi"],
      "env": {
        "PYPI_INDEX_URL": "https://pypi.org/simple/",
        "CACHE_TTL": "3600"
      }
    }
  }
}
```

### Claude Code

If you're using [Claude Code](https://claude.ai/code), you can connect to this MCP server using the `claude mcp` command:

```bash
# Connect to the PyPI Query MCP server
claude mcp add mcpypi -- uvx mcpypi

# Or with custom environment variables
claude mcp add mcpypi -- uvx mcpypi \
  --env PYPI_INDEX_URL=https://pypi.org/pypi \
  --env PYPI_CACHE_TTL=3600 \
  --env PYPI_LOG_LEVEL=INFO

# List connected MCP servers
claude mcp list

# Remove the server if needed
claude mcp remove mcpypi
```

Once connected, you can use all the MCP tools directly in Claude Code sessions by asking questions like:
- "What are the dependencies of Django?"
- "Check if numpy is compatible with Python 3.11"
- "Show me the top downloaded packages this month"
- "Analyze the security vulnerabilities in my requirements.txt file"

### Environment Variables

#### Basic Configuration
- `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)

#### Multiple Mirror Sources Support
- `PYPI_INDEX_URLS`: Additional PyPI index URLs (comma-separated, optional)
- `PYPI_EXTRA_INDEX_URLS`: Extra PyPI index URLs for fallback (comma-separated, optional)

#### Private Repository Support
- `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)

#### Advanced Dependency Analysis
- `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)

#### Example Configuration
```bash
# 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"
```

## Available MCP Tools

The server provides **37 comprehensive MCP tools** across **8 categories**:

### Core Package Information (11 tools)
1. **get_package_info** - Get comprehensive package information
2. **get_package_versions** - List all available versions for a package
3. **get_package_dependencies** - Analyze package dependencies
4. **check_package_python_compatibility** - Check Python version compatibility
5. **get_package_compatible_python_versions** - Get all compatible Python versions
6. **resolve_dependencies** - Recursively resolve all package dependencies with detailed analysis
7. **download_package** - Download package and all dependencies to local directory
8. **get_download_statistics** - Get comprehensive download statistics for any package
9. **get_download_trends** - Analyze download trends and time series data (last 180 days)
10. **get_top_downloaded_packages** - Get the most popular packages by download count
11. **search_pypi_packages** - Advanced PyPI package search with intelligent fallbacks

### PyPI Publishing & Account Management (6 tools)
12. **upload_package_to_pypi** - Upload packages to PyPI with comprehensive validation
13. **check_pypi_credentials** - Validate PyPI authentication credentials
14. **get_pypi_upload_history** - Get detailed upload history and statistics
15. **delete_pypi_release** - Delete specific package releases from PyPI
16. **manage_pypi_maintainers** - Add/remove package maintainers
17. **get_pypi_account_info** - Get comprehensive PyPI account information

### Package Metadata & Management (4 tools)
18. **update_package_metadata** - Update package descriptions, keywords, and metadata
19. **manage_package_urls** - Update project URLs and documentation links
20. **set_package_visibility** - Control package visibility and access
21. **manage_package_keywords** - Add/remove package keywords and tags

### Analytics & Insights (4 tools)
22. **get_pypi_package_analytics** - Comprehensive package analytics and metrics
23. **get_pypi_security_alerts** - Security vulnerability alerts and advisories
24. **get_pypi_package_rankings** - Package popularity rankings and comparisons
25. **analyze_pypi_competition** - Competitive analysis with similar packages

### Discovery & Monitoring (4 tools)
26. **monitor_pypi_new_releases** - Monitor new package releases and updates
27. **get_pypi_trending_today** - Get trending packages with growth metrics
28. **search_pypi_by_maintainer** - Find packages by maintainer or organization
29. **get_pypi_package_recommendations** - Get intelligent package recommendations

### Development Workflow (4 tools)
30. **validate_pypi_package_name** - Validate package names and availability
31. **preview_pypi_package_page** - Preview package page before publishing
32. **check_pypi_upload_requirements** - Validate package before upload
33. **get_pypi_build_logs** - Retrieve build logs and debugging information

### 🔒 Security Analysis (2 tools)
34. **scan_pypi_package_security** - Comprehensive security vulnerability scanning with OSV database and GitHub advisories
35. **bulk_scan_package_security** - Bulk security scanning for multiple packages with consolidated reporting

### 📄 License & Compliance (2 tools)
36. **analyze_pypi_package_license** - License compatibility analysis with SPDX normalization and risk assessment
37. **check_bulk_license_compliance** - Bulk license compliance checking with comprehensive compatibility matrix

### 🏥 Package Health Assessment (2 tools)
- **assess_package_health_score** - Package health scoring across 7 categories (maintenance, popularity, documentation, testing, security, compatibility, metadata)
- **compare_packages_health_scores** - Comparative health analysis between multiple packages with GitHub metrics integration

### 📋 Requirements Analysis (2 tools)
- **analyze_requirements_file_tool** - Requirements file analysis supporting multiple formats (requirements.txt, pyproject.toml, setup.py, Pipfile, conda.yml)
- **compare_multiple_requirements_files** - Multi-file comparison for requirements analysis across different environments

### MCP Prompt Templates (12 tools)
- **analyze_package_quality** - Generate comprehensive package quality analysis prompts
- **compare_packages** - Generate detailed package comparison prompts
- **suggest_alternatives** - Generate prompts for finding package alternatives
- **resolve_dependency_conflicts** - Generate prompts for resolving dependency conflicts
- **plan_version_upgrade** - Generate prompts for planning package version upgrades
- **audit_security_risks** - Generate prompts for security risk auditing
- **plan_package_migration** - Generate comprehensive package migration plan prompts
- **generate_migration_checklist** - Generate detailed migration checklist prompts
- **analyze_environment_dependencies** - Generate prompts for analyzing current environment dependencies
- **check_outdated_packages** - Generate prompts for checking outdated packages with update priorities
- **generate_update_plan** - Generate prompts for creating comprehensive package update plans
- **analyze_daily_trends** - Generate prompts for analyzing daily PyPI download trends

> 📖 **Learn more about prompt templates**: See [PROMPT_TEMPLATES.md](PROMPT_TEMPLATES.md) for detailed documentation and examples.

## Usage Examples

Once configured in your MCP client (Claude Desktop, Cline, Cursor, Windsurf), you can ask questions like:

### Basic Package Queries
- "What are the dependencies of Django 4.2?"
- "Is FastAPI compatible with Python 3.9?"
- "Show me all versions of requests package"
- "What Python versions does numpy support?"
- "Get detailed information about the pandas package"

### Advanced Dependency Analysis
- "Please help me analyze the complete dependency tree for PySide2 with Python 3.10"
- "Resolve all dependencies for Django including development dependencies"
- "What are all the transitive dependencies of FastAPI?"

### Package Download
- "Please help me download PySide2 and all its dependencies for Python 3.10 to my local machine"
- "Download the requests package with all dependencies to ./downloads folder"
- "Collect all packages needed for Django development"

### Download Statistics & Popularity Analysis
- "What are the download statistics for the requests package this month?"
- "Show me the download trends for numpy over the last 180 days"
- "What are the top 10 most downloaded Python packages today?"
- "Compare the popularity of Django vs Flask vs FastAPI"
- "Which web framework has the highest download count this week?"

### MCP Prompt Templates
- "Use the analyze_package_quality prompt to evaluate the requests package"
- "Generate a comparison prompt for Django vs FastAPI vs Flask for building APIs"
- "Create a migration plan prompt for moving from Flask to FastAPI"
- "Help me resolve dependency conflicts with a structured prompt"
- "Generate a security audit prompt for my production packages"

### Environment Analysis
- "Analyze my current Python environment dependencies and check for outdated packages"
- "Check which packages in my environment have security updates available"
- "Generate an update plan for my production environment with conservative strategy"
- "Help me identify packages that need immediate updates vs. planned updates"

### Trending Analysis
- "What are the most downloaded Python packages today?"
- "Show me trending packages in the machine learning domain this week"
- "Track recent security updates and new package releases"
- "Find rising packages in web development that I should consider"

### Security Analysis
- "Scan Django for security vulnerabilities using OSV database"
- "Check my requirements.txt file for packages with known security issues"
- "Bulk scan all packages in my project for security vulnerabilities"
- "What security advisories exist for numpy version 1.21.0?"

### License Analysis & Compliance
- "Analyze the license compatibility of MIT, Apache-2.0, and GPL-3.0 licenses"
- "Check if all packages in my requirements.txt are compatible with my MIT license"
- "What are the licensing risks of using this package in a commercial project?"
- "Bulk check license compliance for my entire dependency tree"

### Package Health Assessment
- "Assess the overall health score of the requests package"
- "Compare the health scores of Django vs FastAPI vs Flask for a new project"
- "Which package has better maintenance: numpy or pandas?"
- "Score this package across maintenance, popularity, and security metrics"

### Requirements File Analysis
- "Analyze my requirements.txt file for outdated packages and security issues"
- "Compare my development and production requirements files"
- "Parse my pyproject.toml file and suggest package updates"
- "What dependencies in my Pipfile need security updates?"

### Example Conversations

**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]*

### Programmatic Usage

```python
# 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
})
```

## 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
- ✅ Advanced dependency analysis and recursive resolution
- ✅ Package download with dependency collection
- ✅ **Download statistics and popularity analysis**
- ✅ **Top packages ranking and trends**
- ✅ CI/CD pipeline with multi-platform testing
- ⏳ Private repository support (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](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/loonghao/pypi-query-mcp-server",
    "name": "mcpypi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "mcp, pypi, package, dependency, python, security, license, analysis, intelligence, claude",
    "author": "Hal",
    "author_email": "hal.long@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/20/a2/4bf2305bfb09034a1ca35cd9d5721c0e477ff4fc27002c1426f2de4ff8e9/mcpypi-1.0.0.tar.gz",
    "platform": null,
    "description": "# \ud83c\udfa4 mcpypi \ud83e\udd67\n### *Your Master of Ceremonies for PyPI*\n\n<div align=\"center\">\n\n[![PyPI version](https://img.shields.io/pypi/v/mcpypi.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/mcpypi/)\n[![Python versions](https://img.shields.io/pypi/pyversions/mcpypi.svg?style=for-the-badge&logo=python&logoColor=white)](https://pypi.org/project/mcpypi/)\n[![Downloads](https://img.shields.io/pypi/dm/mcpypi.svg?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/mcpypi/)\n[![License](https://img.shields.io/pypi/l/mcpypi.svg?style=for-the-badge)](https://github.com/loonghao/pypi-query-mcp-server/blob/main/LICENSE)\n\n</div>\n\n---\n\n> **mcpypi** (pronounced \"MC-py-pie\") is your **Master of Ceremonies** for PyPI! \ud83c\udfa4\n> \n> *The ultimate PyPI package intelligence platform, now available through Model Context Protocol*\n\nJust like a world-class DJ or MC controls the music and keeps the party flowing, **mcpypi** orchestrates your entire Python package ecosystem. It's the perfect fusion of \"**MCP**\" + \"**PyPI**\" + the Python community's beloved tradition of naming everything with \"**pie**\" \ud83e\udd67 (NumPy, SciPy, SymPy... you get it!).\n\nThink of mcpypi as your **intelligent package DJ** - it knows all the tracks (packages), their dependencies, security vulnerabilities, licenses, and can help you mix the perfect environment for your Python projects!\n\n## \ud83c\udf1f Why mcpypi?\n\n<table>\n<tr>\n<td width=\"50%\">\n\n### \ud83c\udfaf **37 Powerful Tools**\nComplete PyPI analysis suite across 8 categories\n\n### \ud83d\udd12 **Security First**\nOSV database integration + GitHub advisories\n\n### \ud83d\udcca **Real-time Analytics** \nLive download stats, trends, and rankings\n\n### \ud83c\udfe5 **Health Scoring**\n7-category package quality assessment\n\n</td>\n<td width=\"50%\">\n\n### \ud83d\udcc4 **License Intelligence**\nSPDX compatibility analysis + risk assessment  \n\n### \ud83d\udd0d **Deep Analysis**\nDependency trees, requirements parsing, bulk operations\n\n### \u26a1 **Lightning Fast**\nAsync operations with intelligent caching\n\n### \ud83c\udfa4 **MCP Integration**\nWorks with Claude Code, Claude Desktop, Cursor, and more!\n\n</td>\n</tr>\n</table>\n\n## Features\n\nYour MC knows how to drop the beats! \ud83c\udfb5\n\n- \ud83d\udce6 **Track Info** - Get the full story on any PyPI package (metadata, versions, dependencies)\n- \ud83d\udc0d **Compatibility Check** - Know which Python versions can handle your tracks\n- \ud83d\udd0d **Deep Mixing** - Advanced dependency analysis and recursive resolution to avoid conflicts\n- \ud83d\udce5 **Collection Building** - Download packages with all their dependencies for offline mixing\n- \ud83d\udcca **Chart Analysis** - Real-time download statistics and popularity trends \n- \ud83c\udfc6 **Top 40** - Discover the hottest packages trending right now\n- \ud83d\udd12 **Security Scanning** - Keep your playlist safe from vulnerable packages\n- \ud83d\udcc4 **License Mixing** - Ensure your package mix is legally compatible\n- \ud83c\udfe5 **Health Check** - Assess package quality across 7 key metrics\n- \ud83d\udccb **Setlist Analysis** - Parse and analyze requirements files in any format\n- \ud83c\udfaf **Smart Prompts** - MCP templates for guided decision-making\n- \ud83c\udfe2 **Private Venues** - Support for private PyPI repositories  \n- \u26a1 **Live Performance** - Fast async operations with intelligent caching\n- \ud83d\udee0\ufe0f **Universal Mixer** - Easy integration with all MCP clients\n\n## \ud83d\ude80 Quick Start\n\nReady to get your MC on the decks? Here's how to book mcpypi for your next Python party! \ud83c\udf89\n\n### Option 1: Lightning Setup \u26a1 (Recommended)\n\n```bash\n# One-liner - Run immediately with uvx\nuvx mcpypi\n```\n\n### Option 2: Traditional Install \ud83d\udce6\n\n```bash\n# Install from PyPI\npip install mcpypi\n\n# Run the server  \npython -m pypi_query_mcp.server\n```\n\n### Option 3: Claude Code Integration \ud83c\udfa4\n\n```bash  \n# Connect directly to Claude Code\nclaude mcp add mcpypi -- uvx mcpypi\n```\n\n<div align=\"center\">\n\n### \ud83c\udf8a **That's it! Your MC is now live and ready to rock!** \ud83c\udf8a\n\n</div>\n\n---\n\n## \ud83c\udfad Live Demo\n\nHere's what your MC can do for you:\n\n<table>\n<tr>\n<td align=\"center\">\n\n### \ud83d\udd0d **Package Intelligence**\n```python\n\"What are the security vulnerabilities \nin Django 4.1?\"\n```\n*Get real-time security analysis with OSV database*\n\n</td>\n<td align=\"center\">\n\n### \ud83d\udcca **Trend Analysis**\n```python\n\"Show me the top 10 trending \nML packages this week\"\n```\n*Live PyPI download trends and rankings*\n\n</td>\n</tr>\n<tr>\n<td align=\"center\">\n\n### \ud83c\udfe5 **Health Scoring**\n```python\n\"Compare the health scores of \nFastAPI vs Django vs Flask\"\n```\n*7-category quality assessment with GitHub metrics*\n\n</td>\n<td align=\"center\">\n\n### \ud83d\udcc4 **License Compliance**\n```python\n\"Check if my requirements.txt \nis MIT license compatible\"\n```\n*SPDX normalization with risk assessment*\n\n</td>\n</tr>\n</table>\n\n---\n\n### \ud83d\udee0\ufe0f Advanced Installation\n\n<details>\n<summary><b>Development Setup</b></summary>\n\n```bash\ngit clone https://github.com/loonghao/pypi-query-mcp-server.git\ncd pypi-query-mcp-server\nuv sync\nuv run pypi-query-mcp\n```\n\n</details>\n\n---\n\n## \ud83c\udf9b\ufe0f Configuration\n\n<div align=\"center\">\n\n**mcpypi works with ALL major MCP clients!**\n\n[![Claude Desktop](https://img.shields.io/badge/Claude_Desktop-Ready-blue?style=for-the-badge&logo=anthropic)](https://claude.ai/desktop)\n[![Claude Code](https://img.shields.io/badge/Claude_Code-Ready-blue?style=for-the-badge&logo=anthropic)](https://claude.ai/code)\n[![Cursor](https://img.shields.io/badge/Cursor-Ready-blue?style=for-the-badge&logo=cursor)](https://cursor.sh/)\n[![Windsurf](https://img.shields.io/badge/Windsurf-Ready-blue?style=for-the-badge)](https://codeium.com/windsurf)\n\n</div>\n\n### \ud83d\udda5\ufe0f Claude Desktop\n\nAdd to your Claude Desktop configuration file:\n\n**MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"pypi-query\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"mcpypi\", \"mcpypi\"],\n      \"env\": {\n        \"PYPI_INDEX_URL\": \"https://pypi.org/pypi\",\n        \"PYPI_INDEX_URLS\": \"https://mirrors.aliyun.com/pypi/simple/,https://pypi.tuna.tsinghua.edu.cn/simple/\",\n        \"PYPI_CACHE_TTL\": \"3600\",\n        \"PYPI_LOG_LEVEL\": \"INFO\"\n      }\n    }\n  }\n}\n```\n\n#### With Private Repository\n```json\n{\n  \"mcpServers\": {\n    \"pypi-query\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"mcpypi\", \"mcpypi\"],\n      \"env\": {\n        \"PYPI_INDEX_URL\": \"https://pypi.org/pypi\",\n        \"PYPI_PRIVATE_PYPI_URL\": \"https://private.pypi.company.com\",\n        \"PYPI_PRIVATE_PYPI_USERNAME\": \"your_username\",\n        \"PYPI_PRIVATE_PYPI_PASSWORD\": \"your_password\",\n        \"PYPI_CACHE_TTL\": \"3600\"\n      }\n    }\n  }\n}\n```\n\n### Cline\n\nAdd to your Cline MCP settings (`cline_mcp_settings.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"pypi-query\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"mcpypi\", \"mcpypi\"],\n      \"env\": {\n        \"PYPI_INDEX_URL\": \"https://pypi.org/simple/\",\n        \"CACHE_TTL\": \"3600\"\n      }\n    }\n  }\n}\n```\n\n### Cursor\n\nAdd to your Cursor MCP configuration (`.cursor/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"pypi-query\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"mcpypi\", \"mcpypi\"],\n      \"env\": {\n        \"PYPI_INDEX_URL\": \"https://pypi.org/simple/\",\n        \"CACHE_TTL\": \"3600\"\n      }\n    }\n  }\n}\n```\n\n### Windsurf\n\nAdd to your Windsurf MCP configuration (`~/.codeium/windsurf/mcp_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"pypi-query\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"mcpypi\", \"mcpypi\"],\n      \"env\": {\n        \"PYPI_INDEX_URL\": \"https://pypi.org/simple/\",\n        \"CACHE_TTL\": \"3600\"\n      }\n    }\n  }\n}\n```\n\n### Claude Code\n\nIf you're using [Claude Code](https://claude.ai/code), you can connect to this MCP server using the `claude mcp` command:\n\n```bash\n# Connect to the PyPI Query MCP server\nclaude mcp add mcpypi -- uvx mcpypi\n\n# Or with custom environment variables\nclaude mcp add mcpypi -- uvx mcpypi \\\n  --env PYPI_INDEX_URL=https://pypi.org/pypi \\\n  --env PYPI_CACHE_TTL=3600 \\\n  --env PYPI_LOG_LEVEL=INFO\n\n# List connected MCP servers\nclaude mcp list\n\n# Remove the server if needed\nclaude mcp remove mcpypi\n```\n\nOnce connected, you can use all the MCP tools directly in Claude Code sessions by asking questions like:\n- \"What are the dependencies of Django?\"\n- \"Check if numpy is compatible with Python 3.11\"\n- \"Show me the top downloaded packages this month\"\n- \"Analyze the security vulnerabilities in my requirements.txt file\"\n\n### Environment Variables\n\n#### Basic Configuration\n- `PYPI_INDEX_URL`: Primary PyPI index URL (default: https://pypi.org/pypi)\n- `PYPI_CACHE_TTL`: Cache time-to-live in seconds (default: 3600)\n- `PYPI_LOG_LEVEL`: Logging level (default: INFO)\n- `PYPI_REQUEST_TIMEOUT`: HTTP request timeout in seconds (default: 30.0)\n\n#### Multiple Mirror Sources Support\n- `PYPI_INDEX_URLS`: Additional PyPI index URLs (comma-separated, optional)\n- `PYPI_EXTRA_INDEX_URLS`: Extra PyPI index URLs for fallback (comma-separated, optional)\n\n#### Private Repository Support\n- `PYPI_PRIVATE_PYPI_URL`: Private PyPI repository URL (optional)\n- `PYPI_PRIVATE_PYPI_USERNAME`: Private PyPI username (optional)\n- `PYPI_PRIVATE_PYPI_PASSWORD`: Private PyPI password (optional)\n\n#### Advanced Dependency Analysis\n- `PYPI_DEPENDENCY_MAX_DEPTH`: Maximum depth for recursive dependency analysis (default: 5)\n- `PYPI_DEPENDENCY_MAX_CONCURRENT`: Maximum concurrent dependency queries (default: 10)\n- `PYPI_ENABLE_SECURITY_ANALYSIS`: Enable security vulnerability analysis (default: false)\n\n#### Example Configuration\n```bash\n# Use multiple mirror sources for better availability\nexport PYPI_INDEX_URL=\"https://pypi.org/pypi\"\nexport PYPI_INDEX_URLS=\"https://mirrors.aliyun.com/pypi/simple/,https://pypi.tuna.tsinghua.edu.cn/simple/\"\nexport PYPI_EXTRA_INDEX_URLS=\"https://test.pypi.org/simple/\"\n\n# Private repository configuration\nexport PYPI_PRIVATE_PYPI_URL=\"https://private.pypi.company.com\"\nexport PYPI_PRIVATE_PYPI_USERNAME=\"your_username\"\nexport PYPI_PRIVATE_PYPI_PASSWORD=\"your_password\"\n```\n\n## Available MCP Tools\n\nThe server provides **37 comprehensive MCP tools** across **8 categories**:\n\n### Core Package Information (11 tools)\n1. **get_package_info** - Get comprehensive package information\n2. **get_package_versions** - List all available versions for a package\n3. **get_package_dependencies** - Analyze package dependencies\n4. **check_package_python_compatibility** - Check Python version compatibility\n5. **get_package_compatible_python_versions** - Get all compatible Python versions\n6. **resolve_dependencies** - Recursively resolve all package dependencies with detailed analysis\n7. **download_package** - Download package and all dependencies to local directory\n8. **get_download_statistics** - Get comprehensive download statistics for any package\n9. **get_download_trends** - Analyze download trends and time series data (last 180 days)\n10. **get_top_downloaded_packages** - Get the most popular packages by download count\n11. **search_pypi_packages** - Advanced PyPI package search with intelligent fallbacks\n\n### PyPI Publishing & Account Management (6 tools)\n12. **upload_package_to_pypi** - Upload packages to PyPI with comprehensive validation\n13. **check_pypi_credentials** - Validate PyPI authentication credentials\n14. **get_pypi_upload_history** - Get detailed upload history and statistics\n15. **delete_pypi_release** - Delete specific package releases from PyPI\n16. **manage_pypi_maintainers** - Add/remove package maintainers\n17. **get_pypi_account_info** - Get comprehensive PyPI account information\n\n### Package Metadata & Management (4 tools)\n18. **update_package_metadata** - Update package descriptions, keywords, and metadata\n19. **manage_package_urls** - Update project URLs and documentation links\n20. **set_package_visibility** - Control package visibility and access\n21. **manage_package_keywords** - Add/remove package keywords and tags\n\n### Analytics & Insights (4 tools)\n22. **get_pypi_package_analytics** - Comprehensive package analytics and metrics\n23. **get_pypi_security_alerts** - Security vulnerability alerts and advisories\n24. **get_pypi_package_rankings** - Package popularity rankings and comparisons\n25. **analyze_pypi_competition** - Competitive analysis with similar packages\n\n### Discovery & Monitoring (4 tools)\n26. **monitor_pypi_new_releases** - Monitor new package releases and updates\n27. **get_pypi_trending_today** - Get trending packages with growth metrics\n28. **search_pypi_by_maintainer** - Find packages by maintainer or organization\n29. **get_pypi_package_recommendations** - Get intelligent package recommendations\n\n### Development Workflow (4 tools)\n30. **validate_pypi_package_name** - Validate package names and availability\n31. **preview_pypi_package_page** - Preview package page before publishing\n32. **check_pypi_upload_requirements** - Validate package before upload\n33. **get_pypi_build_logs** - Retrieve build logs and debugging information\n\n### \ud83d\udd12 Security Analysis (2 tools)\n34. **scan_pypi_package_security** - Comprehensive security vulnerability scanning with OSV database and GitHub advisories\n35. **bulk_scan_package_security** - Bulk security scanning for multiple packages with consolidated reporting\n\n### \ud83d\udcc4 License & Compliance (2 tools)\n36. **analyze_pypi_package_license** - License compatibility analysis with SPDX normalization and risk assessment\n37. **check_bulk_license_compliance** - Bulk license compliance checking with comprehensive compatibility matrix\n\n### \ud83c\udfe5 Package Health Assessment (2 tools)\n- **assess_package_health_score** - Package health scoring across 7 categories (maintenance, popularity, documentation, testing, security, compatibility, metadata)\n- **compare_packages_health_scores** - Comparative health analysis between multiple packages with GitHub metrics integration\n\n### \ud83d\udccb Requirements Analysis (2 tools)\n- **analyze_requirements_file_tool** - Requirements file analysis supporting multiple formats (requirements.txt, pyproject.toml, setup.py, Pipfile, conda.yml)\n- **compare_multiple_requirements_files** - Multi-file comparison for requirements analysis across different environments\n\n### MCP Prompt Templates (12 tools)\n- **analyze_package_quality** - Generate comprehensive package quality analysis prompts\n- **compare_packages** - Generate detailed package comparison prompts\n- **suggest_alternatives** - Generate prompts for finding package alternatives\n- **resolve_dependency_conflicts** - Generate prompts for resolving dependency conflicts\n- **plan_version_upgrade** - Generate prompts for planning package version upgrades\n- **audit_security_risks** - Generate prompts for security risk auditing\n- **plan_package_migration** - Generate comprehensive package migration plan prompts\n- **generate_migration_checklist** - Generate detailed migration checklist prompts\n- **analyze_environment_dependencies** - Generate prompts for analyzing current environment dependencies\n- **check_outdated_packages** - Generate prompts for checking outdated packages with update priorities\n- **generate_update_plan** - Generate prompts for creating comprehensive package update plans\n- **analyze_daily_trends** - Generate prompts for analyzing daily PyPI download trends\n\n> \ud83d\udcd6 **Learn more about prompt templates**: See [PROMPT_TEMPLATES.md](PROMPT_TEMPLATES.md) for detailed documentation and examples.\n\n## Usage Examples\n\nOnce configured in your MCP client (Claude Desktop, Cline, Cursor, Windsurf), you can ask questions like:\n\n### Basic Package Queries\n- \"What are the dependencies of Django 4.2?\"\n- \"Is FastAPI compatible with Python 3.9?\"\n- \"Show me all versions of requests package\"\n- \"What Python versions does numpy support?\"\n- \"Get detailed information about the pandas package\"\n\n### Advanced Dependency Analysis\n- \"Please help me analyze the complete dependency tree for PySide2 with Python 3.10\"\n- \"Resolve all dependencies for Django including development dependencies\"\n- \"What are all the transitive dependencies of FastAPI?\"\n\n### Package Download\n- \"Please help me download PySide2 and all its dependencies for Python 3.10 to my local machine\"\n- \"Download the requests package with all dependencies to ./downloads folder\"\n- \"Collect all packages needed for Django development\"\n\n### Download Statistics & Popularity Analysis\n- \"What are the download statistics for the requests package this month?\"\n- \"Show me the download trends for numpy over the last 180 days\"\n- \"What are the top 10 most downloaded Python packages today?\"\n- \"Compare the popularity of Django vs Flask vs FastAPI\"\n- \"Which web framework has the highest download count this week?\"\n\n### MCP Prompt Templates\n- \"Use the analyze_package_quality prompt to evaluate the requests package\"\n- \"Generate a comparison prompt for Django vs FastAPI vs Flask for building APIs\"\n- \"Create a migration plan prompt for moving from Flask to FastAPI\"\n- \"Help me resolve dependency conflicts with a structured prompt\"\n- \"Generate a security audit prompt for my production packages\"\n\n### Environment Analysis\n- \"Analyze my current Python environment dependencies and check for outdated packages\"\n- \"Check which packages in my environment have security updates available\"\n- \"Generate an update plan for my production environment with conservative strategy\"\n- \"Help me identify packages that need immediate updates vs. planned updates\"\n\n### Trending Analysis\n- \"What are the most downloaded Python packages today?\"\n- \"Show me trending packages in the machine learning domain this week\"\n- \"Track recent security updates and new package releases\"\n- \"Find rising packages in web development that I should consider\"\n\n### Security Analysis\n- \"Scan Django for security vulnerabilities using OSV database\"\n- \"Check my requirements.txt file for packages with known security issues\"\n- \"Bulk scan all packages in my project for security vulnerabilities\"\n- \"What security advisories exist for numpy version 1.21.0?\"\n\n### License Analysis & Compliance\n- \"Analyze the license compatibility of MIT, Apache-2.0, and GPL-3.0 licenses\"\n- \"Check if all packages in my requirements.txt are compatible with my MIT license\"\n- \"What are the licensing risks of using this package in a commercial project?\"\n- \"Bulk check license compliance for my entire dependency tree\"\n\n### Package Health Assessment\n- \"Assess the overall health score of the requests package\"\n- \"Compare the health scores of Django vs FastAPI vs Flask for a new project\"\n- \"Which package has better maintenance: numpy or pandas?\"\n- \"Score this package across maintenance, popularity, and security metrics\"\n\n### Requirements File Analysis\n- \"Analyze my requirements.txt file for outdated packages and security issues\"\n- \"Compare my development and production requirements files\"\n- \"Parse my pyproject.toml file and suggest package updates\"\n- \"What dependencies in my Pipfile need security updates?\"\n\n### Example Conversations\n\n**User**: \"Check if Django 4.2 is compatible with Python 3.9\"\n\n**AI Assistant**: I'll check Django 4.2's compatibility with Python 3.9 for you.\n\n*[Uses get_package_info and check_package_python_compatibility tools]*\n\n**User**: \"What are the main dependencies of FastAPI?\"\n\n**AI Assistant**: Let me get the dependency information for FastAPI.\n\n*[Uses get_package_dependencies tool]*\n\n**User**: \"Show me the download statistics for the requests package and tell me which is more popular: requests or urllib3?\"\n\n**AI Assistant**: I'll get the download statistics for both packages and compare their popularity.\n\n*[Uses get_download_statistics tool for both packages]*\n\n### Programmatic Usage\n\n```python\n# Example: Check if Django is compatible with Python 3.9\nresult = await mcp_client.call_tool(\"check_package_python_compatibility\", {\n    \"package_name\": \"django\",\n    \"target_python_version\": \"3.9\"\n})\n\n# Example: Get package information\ninfo = await mcp_client.call_tool(\"get_package_info\", {\n    \"package_name\": \"requests\"\n})\n\n# Example: Get download statistics\nstats = await mcp_client.call_tool(\"get_download_statistics\", {\n    \"package_name\": \"numpy\",\n    \"period\": \"month\"\n})\n\n# Example: Get top downloaded packages\ntop_packages = await mcp_client.call_tool(\"get_top_downloaded_packages\", {\n    \"period\": \"week\",\n    \"limit\": 10\n})\n```\n\n## Development Status\n\n\ud83c\udf89 **Core functionality implemented and ready for use!**\n\nCurrent implementation status:\n- \u2705 Basic project structure\n- \u2705 PyPI API client with caching\n- \u2705 MCP tools implementation (package info, versions, dependencies)\n- \u2705 Python version compatibility checking\n- \u2705 Advanced dependency analysis and recursive resolution\n- \u2705 Package download with dependency collection\n- \u2705 **Download statistics and popularity analysis**\n- \u2705 **Top packages ranking and trends**\n- \u2705 CI/CD pipeline with multi-platform testing\n- \u23f3 Private repository support (planned)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\ud83c\udfa4 mcpypi - Your Master of Ceremonies for PyPI! The ultimate PyPI package intelligence platform through Model Context Protocol (MCP)",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://github.com/loonghao/pypi-query-mcp-server",
        "Homepage": "https://github.com/loonghao/pypi-query-mcp-server",
        "Repository": "https://github.com/loonghao/pypi-query-mcp-server"
    },
    "split_keywords": [
        "mcp",
        " pypi",
        " package",
        " dependency",
        " python",
        " security",
        " license",
        " analysis",
        " intelligence",
        " claude"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ee9e61fd1f6ce686d9c53feff3d80e192ffb56fc24f0abede0536f799e07cdc",
                "md5": "3581379a0f132ee6638bdc3cba8c259f",
                "sha256": "83e03dfe0e4b3dac8d72eb80093a0fc26338f7f35aa906da56b965be0ef4e3d9"
            },
            "downloads": -1,
            "filename": "mcpypi-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3581379a0f132ee6638bdc3cba8c259f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 195735,
            "upload_time": "2025-09-06T17:46:01",
            "upload_time_iso_8601": "2025-09-06T17:46:01.501612Z",
            "url": "https://files.pythonhosted.org/packages/3e/e9/e61fd1f6ce686d9c53feff3d80e192ffb56fc24f0abede0536f799e07cdc/mcpypi-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20a24bf2305bfb09034a1ca35cd9d5721c0e477ff4fc27002c1426f2de4ff8e9",
                "md5": "7147d986f40a52fc31bd3345e840c800",
                "sha256": "9619adf3816d9495ac1f694571f03f3c4e374697f904e488135e82935fea5bbb"
            },
            "downloads": -1,
            "filename": "mcpypi-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7147d986f40a52fc31bd3345e840c800",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 174024,
            "upload_time": "2025-09-06T17:46:02",
            "upload_time_iso_8601": "2025-09-06T17:46:02.934559Z",
            "url": "https://files.pythonhosted.org/packages/20/a2/4bf2305bfb09034a1ca35cd9d5721c0e477ff4fc27002c1426f2de4ff8e9/mcpypi-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-06 17:46:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "loonghao",
    "github_project": "pypi-query-mcp-server",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "mcpypi"
}
        
Hal
Elapsed time: 1.06122s