Skip to main content

MCP server for checking latest package versions from PyPI, npm, and pub.dev

Project description

๐Ÿฆธ MCP Package Hero

Python 3.10+ FastMCP License: MIT Tests Coverage Type Check

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 package
  • ecosystem (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 with package_name and ecosystem
  • max_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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

๐Ÿ—บ๏ธ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_package_hero-1.0.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_package_hero-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

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

Hashes for mcp_package_hero-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d9137875d61e03a1d869912e0c83eb2dda5f7afa1204dfbd1653aec88c0675bb
MD5 cb2f2c43ed72a936f7006e688bdee730
BLAKE2b-256 6ffec3aaffd8d24f2545e28879a1277b24ec8155344f70b3865de82b9efc1efd

See more details on using hashes here.

File details

Details for the file mcp_package_hero-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_package_hero-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 427682aa599fef03adf79755579153d654e1e1d049ee2f93aaec11b51cec740a
MD5 6c602f5099701c55038afc45aa0a29c2
BLAKE2b-256 c0b2024d50259adcb5dcd576b962a07df25bc9959edca80c4b095fa8e6d7b76a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page