Skip to main content
Glama

https://github.com/sammcj/mcp-package-version

by sammcj

软件包版本 MCP 服务器

铁匠徽章

MCP 服务器提供用于从多个软件包注册中心检查最新稳定软件包版本的工具:

  • npm(Node.js/JavaScript)

  • PyPI(Python)

  • Maven 中心(Java)

  • Go 代理 (Go)

  • Swift 包(Swift)

  • AWS Bedrock(AI 模型)

  • Docker Hub(容器镜像)

  • GitHub 容器注册表(容器镜像)

  • GitHub Actions

该服务器可帮助 LLM 确保他们在编写代码时推荐最新的软件包版本。

重要提示:从 2.0.0 版本开始,mcp-package-version 已用 Go 重写,因此需要在您的客户端中更新配置 - 有关更多详细信息,请参阅

截屏

带有和不带有 mcp-package-version 的工具

安装

要求:

  • 安装了现代 Go 版本(参见Go 安装

使用go install (推荐用于 MCP 客户端设置):

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

然后设置你的客户端以使用 MCP 服务器。假设你已经使用go install github.com/sammcj/mcp-package-version/v2@HEAD安装了二进制文件,并且你的$GOPATH/Users/sammcj/go/bin ,你可以提供二进制文件的完整路径:

{ "mcpServers": { "package-version": { "command": "/Users/sammcj/go/bin/mcp-package-version" } } }
  • 对于 Cline VSCode 扩展,这将是~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

  • 对于 Claude 桌面~/Library/Application\ Support/Claude/claude_desktop_config.json

  • 对于 GoMCP ~/.config/gomcp/config.yaml

其他安装方法

或者克隆存储库并构建它:

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

您还可以在容器中运行服务器:

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

注意:如果在容器中运行,则需要配置客户端以使用 URL 而不是命令,例如:

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

提示:Go Path

如果$GOPATH/bin不在您的PATH中,则您需要在配置 MCP 客户端时提供二进制文件的完整路径(例如/Users/sammcj/go/bin/mcp-package-version )。

如果您之前没有使用过 Go 应用程序,并且刚刚安装了 Go,则可能没有在环境中设置$GOPATH 。这对于任何go install命令的正确运行都至关重要。

理解

go install命令会下载并编译 Go 软件包,并将生成的二进制可执行文件放在$GOPATHbin子目录中。默认情况下,类 Unix 系统(包括 macOS)上的$GOPATH通常位于$HOME/go 。如果您尚未明确配置$GOPATH ,Go 将使用此默认值。

如果您想从任何终端位置直接按名称运行已安装的 Go 二进制文件,则需要将位置$GOPATH/bin (例如, /Users/your_username/go/bin )包含在系统的PATH环境变量中。

您可以将以下行添加到您的 shell 配置文件(例如~/.zshrc~/.bashrc )中,以将$GOPATH设置为默认值(如果尚未设置),并确保$GOPATH/bin在您的PATH中:

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

添加此行后,重新启动您的终端或 MCP 客户端。

用法

服务器支持两种传输模式:stdio(默认)和SSE(服务器发送事件)。

STDIO 传输(默认)

mcp-package-version

上交所运输

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

这将使服务器可供客户端在http://localhost:18080/sse上使用(请注意/sse后缀!)。

命令行选项

  • --transport-t :传输类型(stdio 或 sse)。默认值:stdio

  • --port :用于 SSE 传输的端口。默认值:18080

  • --base-url :SSE 传输的基本 URL。默认值: http://localhost

Docker 镜像

Docker 镜像可从 GitHub Container Registry 获取:

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

您还可以查看示例docker-compose.yaml

工具

NPM 包

检查 NPM 包的最新版本:

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

Python 包(requirements.txt)

从 requirements.txt 检查 Python 包的最新版本:

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

Python 包(pyproject.toml)

从 pyproject.toml 检查 Python 包的最新版本:

{ "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 包(Maven)

从 Maven 检查 Java 包的最新版本:

{ "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 包(Gradle)

从 Gradle 检查 Java 包的最新版本:

{ "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 包

从 go.mod 检查 Go 软件包的最新版本:

{ "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 镜像

检查 Docker 镜像的可用标签:

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

AWS Bedrock 模型

列出所有 AWS Bedrock 模型:

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

搜索特定的 AWS Bedrock 模型:

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

获取最新的 Claude Sonnet 模型:

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

Swift 包

检查 Swift 软件包的最新版本:

{ "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

检查 GitHub Actions 的最新版本:

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

发布和 CI/CD

本项目使用 GitHub Actions 进行持续集成和部署。工作流程自动执行以下任务:

  1. 在每次推送到主分支和拉取请求时构建并测试应用程序

  2. 当推送格式为v* (例如v1.0.0 )的标签时,创建一个版本

  3. 构建 Docker 镜像并将其推送到 GitHub Container Registry

执照

麻省理工学院

Deploy Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

编写代码时建议使用最新的稳定包版本。

  1. 截屏
    1. 安装
      1. 其他安装方法
    2. 用法
      1. STDIO 传输(默认)
      2. 上交所运输
      3. Docker 镜像
    3. 工具
      1. NPM 包
      2. Python 包(requirements.txt)
      3. Python 包(pyproject.toml)
      4. Java 包(Maven)
      5. Java 包(Gradle)
      6. Go 包
      7. Docker 镜像
      8. AWS Bedrock 模型
      9. Swift 包
      10. GitHub Actions
    4. 发布和 CI/CD
      1. 执照

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          Get the narrative and API documentation for the exact version of any of your dependencies. (Only Rust is supported at the moment.)
          Last updated -
          1
          13
          59
          MIT License
        • A
          security
          A
          license
          A
          quality
          The server can be utilized for secure development by listing all packages' CVEs, their affected versions and their fix versions.
          Last updated -
          4
          2
          MIT License
        • A
          security
          A
          license
          A
          quality
          Fetches up-to-date, version-specific documentation and code examples from the source and adds them to your LLM prompts, helping eliminate outdated code generations and hallucinated APIs.
        • A
          security
          A
          license
          A
          quality
          Provides up-to-date documentation for 9000+ libraries directly in your AI code editor, enabling accurate code suggestions and eliminating outdated information.
          Last updated -
          1
          329
          158
          MIT License
          • Apple
          • Linux

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/sammcj/mcp-package-version'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server