MCP HubMCP Hub
sammcj

mcp-package-version

by: sammcj

An MCP server that provides LLMs with the latest stable package versions when coding

75created 16/12/2024
Visit
LLM
packages

📌Overview

Purpose: The MCP server aims to provide tools for checking the latest stable package versions from various package registries, ensuring that code recommendations are up-to-date.

Overview: The MCP package version server supports multiple programming languages and registries including npm, PyPI, Maven Central, Go Proxy, Swift, AWS Bedrock, Docker Hub, and GitHub Actions. It enhances the reliability of software dependencies by enabling developers to retrieve current package versions easily.

Key Features:

  • Multi-Registry Support: Allows checking of the latest stable versions across various package registries for different languages, enhancing cross-language compatibility.

  • Detailed Dependency Management Tools: Provides specific tools for different package formats, enabling users to check and manage dependencies effectively for Node.js, Python, Go, Java, Swift, GitHub Actions, and Docker.


Package Version MCP Server

An MCP server that provides tools for checking the latest stable package versions from multiple package registries:

  • npm (Node.js/JavaScript)
  • PyPI (Python)
  • Maven Central (Java)
  • Go Proxy (Go)
  • Swift Packages (Swift)
  • AWS Bedrock (AI Models)
  • Docker Hub (Container Images)
  • GitHub Container Registry (Container Images)
  • GitHub Actions

This server helps LLMs ensure they're recommending up-to-date package versions when writing code.

IMPORTANT: As of version 2.0.0, mcp-package-version has been rewritten in Go, so the configuration needs to be updated in your client - see the Installation section for details.

Installation

Requirements:

Using go install (Recommended for MCP Client Setup):

go install github.com/sammcj/mcp-package-version/v2@HEAD

Then set up your client to use the MCP server. For example, if your $GOPATH is /Users/sammcj/go/bin, provide the full path to the binary:

{
  "mcpServers": {
    "package-version": {
      "command": "/Users/sammcj/go/bin/mcp-package-version"
    }
  }
}

Common client configuration paths:

  • Cline VSCode Extension: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json
  • GoMCP: ~/.config/gomcp/config.yaml

Other Installation Methods

Clone the repository and build it:

git clone https://github.com/sammcj/mcp-package-version.git
cd mcp-package-version
make

Run the server in a container:

docker run -p 18080:18080 ghcr.io/sammcj/mcp-package-version:latest

If running in a container, configure your client to use the URL instead of a command:

{
  "mcpServers": {
    "package-version": {
      "url": "http://localhost:18080"
    }
  }
}

Tip: Go Path

If $GOPATH/bin is not in your PATH, provide the full path to the binary when configuring your MCP client (e.g., /Users/sammcj/go/bin/mcp-package-version).

If you have just installed Go and haven't set up $GOPATH:

  • The default $GOPATH is usually $HOME/go on Unix-like systems.
  • You need to add $GOPATH/bin to your system's PATH environment variable.

Add this line to your shell configuration file (~/.zshrc, ~/.bashrc):

[ -z "$GOPATH" ] && export GOPATH="$HOME/go"; echo "$PATH" | grep -q ":$GOPATH/bin" || export PATH="$PATH:$GOPATH/bin"

Restart your terminal or MCP client after adding.

Usage

The server supports two transport modes: stdio (default) and SSE (Server-Sent Events).

STDIO Transport (Default)

mcp-package-version

Or if built locally:

./bin/mcp-package-version

SSE Transport

mcp-package-version --transport sse --port 18080 --base-url http://localhost

Or if built locally:

./bin/mcp-package-version --transport sse --port 18080 --base-url http://localhost

Command-line Options

  • --transport, -t: Transport type (stdio or sse). Default: stdio
  • --port: Port for SSE transport. Default: 18080
  • --base-url: Base URL for SSE transport. Default: http://localhost

Tools

NPM Packages

Check the latest versions of NPM packages:

{
  "name": "check_npm_versions",
  "arguments": {
    "dependencies": {
      "react": "^17.0.2",
      "react-dom": "^17.0.2",
      "lodash": "4.17.21"
    },
    "constraints": {
      "react": {
        "majorVersion": 17
      }
    }
  }
}

Python Packages (requirements.txt)

Check the latest versions of Python packages from requirements.txt:

{
  "name": "check_python_versions",
  "arguments": {
    "requirements": [
      "requests==2.28.1",
      "flask>=2.0.0",
      "numpy"
    ]
  }
}

Python Packages (pyproject.toml)

Check the latest versions of Python packages from pyproject.toml:

{
  "name": "check_pyproject_versions",
  "arguments": {
    "dependencies": {
      "dependencies": {
        "requests": "^2.28.1",
        "flask": ">=2.0.0"
      },
      "optional-dependencies": {
        "dev": {
          "pytest": "^7.0.0"
        }
      },
      "dev-dependencies": {
        "black": "^22.6.0"
      }
    }
  }
}

Java Packages (Maven)

Check the latest versions of Java packages from Maven:

{
  "name": "check_maven_versions",
  "arguments": {
    "dependencies": [
      {
        "groupId": "org.springframework.boot",
        "artifactId": "spring-boot-starter-web",
        "version": "2.7.0"
      },
      {
        "groupId": "com.google.guava",
        "artifactId": "guava",
        "version": "31.1-jre"
      }
    ]
  }
}

Java Packages (Gradle)

Check the latest versions of Java packages from Gradle:

{
  "name": "check_gradle_versions",
  "arguments": {
    "dependencies": [
      {
        "configuration": "implementation",
        "group": "org.springframework.boot",
        "name": "spring-boot-starter-web",
        "version": "2.7.0"
      },
      {
        "configuration": "testImplementation",
        "group": "junit",
        "name": "junit",
        "version": "4.13.2"
      }
    ]
  }
}

Go Packages

Check the latest versions of Go packages from go.mod:

{
  "name": "check_go_versions",
  "arguments": {
    "dependencies": {
      "module": "github.com/example/mymodule",
      "require": [
        {
          "path": "github.com/gorilla/mux",
          "version": "v1.8.0"
        },
        {
          "path": "github.com/spf13/cobra",
          "version": "v1.5.0"
        }
      ]
    }
  }
}

Docker Images

Check available tags for Docker images:

{
  "name": "check_docker_tags",
  "arguments": {
    "image": "nginx",
    "registry": "dockerhub",
    "limit": 5,
    "filterTags": ["^1\\."],
    "includeDigest": true
  }
}

AWS Bedrock Models

List all AWS Bedrock models:

{
  "name": "check_bedrock_models",
  "arguments": {
    "action": "list"
  }
}

Search for specific AWS Bedrock models:

{
  "name": "check_bedrock_models",
  "arguments": {
    "action": "search",
    "query": "claude",
    "provider": "anthropic"
  }
}

Get the latest Claude Sonnet model:

{
  "name": "get_latest_bedrock_model",
  "arguments": {}
}

Swift Packages

Check the latest versions of Swift packages:

{
  "name": "check_swift_versions",
  "arguments": {
    "dependencies": [
      {
        "url": "https://github.com/apple/swift-argument-parser",
        "version": "1.1.4"
      },
      {
        "url": "https://github.com/vapor/vapor",
        "version": "4.65.1"
      }
    ],
    "constraints": {
      "https://github.com/apple/swift-argument-parser": {
        "majorVersion": 1
      }
    }
  }
}

GitHub Actions

Check the latest versions of GitHub Actions:

{
  "name": "check_github_actions",
  "arguments": {
    "actions": [
      {
        "owner": "actions",
        "repo": "checkout",
        "currentVersion": "v3"
      },
      {
        "owner": "actions",
        "repo": "setup-node",
        "currentVersion": "v3"
      }
    ],
    "includeDetails": true
  }
}

Releases and CI/CD

This project uses GitHub Actions for continuous integration and deployment. The workflow automatically:

  1. Builds and tests the application on every push to the main branch and pull requests.
  2. Creates a release when a tag with the format v* (e.g., v1.0.0) is pushed.
  3. Builds and pushes Docker images to GitHub Container Registry.

Docker Images

Docker images are available from GitHub Container Registry:

docker pull ghcr.io/sammcj/mcp-package-version:latest

Or with a specific version:

docker pull ghcr.io/sammcj/mcp-package-version:v2.0.0

License

MIT