MCP server for checking latest package versions from PyPI, npm, and pub.dev
Project description
๐ฆธ MCP Package Hero
A focused, reliable Model Context Protocol (MCP) server for checking the latest package versions across Python (PyPI), JavaScript/TypeScript (npm), and Dart (pub.dev).
๐ฏ Purpose
MCP Package Hero answers one question exceptionally well: "What is the current latest version of this package?"
Unlike tools that try to do everything, Package Hero focuses on doing three things perfectly:
- โ Check Python packages on PyPI
- โ Check JavaScript/TypeScript packages on npm
- โ Check Dart packages on pub.dev
๐ Features
- Simple API: Just two tools - get one version or batch check multiple packages
- Fast: Sub-second response times with async operations
- Reliable: Comprehensive error handling and clear status indicators
- LLM-Friendly: Designed specifically for AI assistants and agents
- Type-Safe: Full type hints, Pydantic validation, and mypy compliance
- Well-Tested: 81% code coverage with comprehensive test suite
- Production-Ready: Modern Python best practices, timezone-aware, Pydantic V2
๐ฆ Installation
Using uv (Recommended)
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone the repository
git clone https://github.com/moinsen-dev/mcp-package-hero.git
cd mcp-package-hero
# Install dependencies
uv sync
# Install the package
uv pip install -e .
Using pip
git clone https://github.com/moinsen-dev/mcp-package-hero.git
cd mcp-package-hero
pip install -e .
๐ง Configuration
Add to your MCP client configuration (e.g., Claude Desktop, Cline, etc.):
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or
%APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"package-hero": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/mcp-package-hero",
"mcp-package-hero"
]
}
}
}
Cline VSCode Extension
Edit ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json:
{
"mcpServers": {
"package-hero": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/mcp-package-hero",
"mcp-package-hero"
]
}
}
}
๐ Usage
Tool 1: Get Latest Version
Check the latest version of a single package:
# Example queries for your LLM:
"What's the latest version of requests in Python?"
"Check the current version of react"
"Show me the latest version of the http package for Dart"
Tool Name: get_latest_version
Parameters:
package_name(string): Name of the packageecosystem(string): One of "python", "javascript", or "dart"
Example Response:
{
"package_name": "requests",
"ecosystem": "python",
"latest_version": "2.31.0",
"registry_url": "https://pypi.org/project/requests/",
"checked_at": "2025-10-06T10:30:00Z",
"status": "success"
}
Tool 2: Batch Version Check
Check multiple packages at once (max 10):
# Example query:
"Check the latest versions of requests (python), react (javascript), and http (dart)"
Tool Name: get_latest_versions_batch
Parameters:
packages(array): List of objects withpackage_nameandecosystemmax_packages(integer, optional): Limit (default: 10)
Example Response:
{
"results": [
{
"package_name": "requests",
"ecosystem": "python",
"latest_version": "2.31.0",
"status": "success"
},
{
"package_name": "nonexistent-pkg",
"ecosystem": "python",
"latest_version": null,
"status": "not_found"
}
],
"checked_at": "2025-10-06T10:30:00Z"
}
๐งช Testing
Run the test suite:
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=src/mcp_package_hero --cov-report=html
# Run with coverage summary
uv run pytest --cov=src/mcp_package_hero --cov-report=term-missing
# Run specific test file
uv run pytest tests/test_registries/test_pypi.py
Test Results
- โ 8/8 tests passing
- โ 81% code coverage
- โ All three ecosystems validated with live API calls
๐๏ธ Development
Project Structure
mcp-package-hero/
โโโ src/mcp_package_hero/
โ โโโ __init__.py
โ โโโ server.py # Main FastMCP server
โ โโโ models.py # Pydantic models
โ โโโ registries/
โ โโโ base.py # Abstract base class
โ โโโ pypi.py # PyPI integration
โ โโโ npm.py # npm integration
โ โโโ pubdev.py # pub.dev integration
โโโ tests/
โโโ README.md
โโโ pyproject.toml
Code Quality
# Format code
uv run ruff format .
# Lint code
uv run ruff check .
# Auto-fix safe linting issues
uv run ruff check --fix .
# Type check
uv run mypy src/
Quality Standards
- โ Type Safety: Full mypy compliance with Pydantic plugin
- โ Code Style: Ruff linting and formatting
- โ Modern Python: Python 3.10+ type hints (PEP 604)
- โ Timezone-Aware: All timestamps use UTC timezone
- โ Pydantic V2: Using latest ConfigDict patterns
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with FastMCP by Prefect
- Inspired by mcp-package-version by Sam McLeod
- Part of the Model Context Protocol ecosystem
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
๐บ๏ธ Roadmap
v1.1
- Cache layer for improved performance
- Support for specific version queries
v2.0
- Additional ecosystems (Rust, Go, Ruby)
- Dependency tree analysis
- Version compatibility checking
Made with โ๏ธ by moinsen-dev
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 mcp_package_hero-1.0.0.tar.gz.
File metadata
- Download URL: mcp_package_hero-1.0.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9137875d61e03a1d869912e0c83eb2dda5f7afa1204dfbd1653aec88c0675bb
|
|
| MD5 |
cb2f2c43ed72a936f7006e688bdee730
|
|
| BLAKE2b-256 |
6ffec3aaffd8d24f2545e28879a1277b24ec8155344f70b3865de82b9efc1efd
|
File details
Details for the file mcp_package_hero-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mcp_package_hero-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
427682aa599fef03adf79755579153d654e1e1d049ee2f93aaec11b51cec740a
|
|
| MD5 |
6c602f5099701c55038afc45aa0a29c2
|
|
| BLAKE2b-256 |
c0b2024d50259adcb5dcd576b962a07df25bc9959edca80c4b095fa8e6d7b76a
|