@sammcj/mcp-package-version
An MCP server that provides tools for checking latest stable package versions from multiple package registries.
Installation
Claude Desktop
Installation Command
npx -y @smithery/cli install mcp-package-version --client claude
Configuration
{ "mcpServers": { "package-version": { "command": "npx", "args": ["-y", "mcp-package-version"] } } }
Instructions
Add the configuration to your MCP settings file located at `~/Library/Application Support/Claude/claude_desktop_config.json`.
README
Package Version MCP Server
An MCP server that provides tools for checking 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)
This server helps LLMs ensure they're recommending up-to-date package versions when writing code.
Screenshot
Running
Installing via Smithery
To install Package Version for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mcp-package-version --client claude
Configure MCP Settings
Add the following to your MCP settings file:
{
"mcpServers": {
"package-version": {
"command": "npx",
"args": ["-y", "mcp-package-version"]
}
}
}
If you are behind a corporate proxy which MITMs your traffic, you may need to additionally specify the proxy CA cert bundle:
{
"mcpServers": {
"package-version": {
"command": "npx",
"args": ["-y", "mcp-package-version"],
"env": {
"NODE_EXTRA_CA_CERTS": "/path/to/mitm/cert.pem"
}
}
}
}
- For the Cline VSCode Extension this will be
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
- For Claude Desktop
~/Library/Application\ Support/Claude/claude_desktop_config.json
- For GoMCP
~/.config/gomcp/config.yaml
Tools
1. JavaScript/Node.js
check_npm_versions
Check latest stable versions for npm packages from a package.json dependencies object.
use_mcp_tool({
server_name: "package-version",
tool_name: "check_npm_versions",
arguments: {
dependencies: {
"express": "^4.17.1",
"react": "^17.0.2"
}
}
});
2. Python
check_python_versions
Check latest stable versions for Python packages from requirements.txt entries.
check_pyproject_versions
Check latest stable versions for Python packages from pyproject.toml.
use_mcp_tool({
server_name: "package-version",
tool_name: "check_pyproject_versions",
arguments: {
dependencies: {
dependencies: {
"requests": "^2.28.0",
"pandas": ">=1.5.0"
},
"optional-dependencies": {
"test": {
"pytest": ">=7.0.0"
}
},
"dev-dependencies": {
"black": "^22.0.0"
}
}
}
});
use_mcp_tool({
server_name: "package-version",
tool_name: "check_python_versions",
arguments: {
requirements: [
"requests==2.26.0",
"pandas>=1.3.0"
]
}
});
3. Go
check_go_versions
Check latest stable versions for Go packages from go.mod.
use_mcp_tool({
server_name: "package-version",
tool_name: "check_go_versions",
arguments: {
dependencies: {
module: "example.com/mymodule",
require: [
{
path: "github.com/gin-gonic/gin",
version: "v1.7.0"
}
],
replace: [
{
old: "github.com/old/pkg",
new: "github.com/new/pkg",
version: "v2.0.0"
}
]
}
}
});
4. Java
check_maven_versions
Check latest stable versions for Java packages from pom.xml.
use_mcp_tool({
server_name: "package-version",
tool_name: "check_maven_versions",
arguments: {
dependencies: [
{
groupId: "org.springframework.boot",
artifactId: "spring-boot-starter-web",
version: "2.7.0",
scope: "compile"
}
]
}
});
5. check_package_versions
Bulk check latest stable versions for multiple packages from npm and PyPI.
use_mcp_tool({
server_name: "package-version",
tool_name: "check_package_versions",
arguments: {
packages: [
{ name: "react", registry: "npm" },
{ name: "requests", registry: "pypi" },
{ name: "typescript", registry: "npm", currentVersion: "5.0.0" }
]
}
});
6. AWS Bedrock
check_bedrock_models
Search, list, and get information about Amazon Bedrock AI models.
// List all available Bedrock models
use_mcp_tool({
server_name: "package-version",
tool_name: "check_bedrock_models",
arguments: {
action: "list"
}
});
get_latest_bedrock_model
Get the latest Claude Sonnet model from Amazon Bedrock (best for coding tasks).
use_mcp_tool({
server_name: "package-version",
tool_name: "get_latest_bedrock_model",
arguments: {}
});
7. Swift
check_swift_versions
Check latest stable versions for Swift packages in Package.swift.
use_mcp_tool({
server_name: "package-version",
tool_name: "check_swift_versions",
arguments: {
dependencies: [
{
url: "https://github.com/apple/swift-argument-parser",
version: "1.0.0",
requirement: "from"
},
{
url: "https://github.com/apple/swift-log.git",
version: "1.4.0",
requirement: "upToNextMajor"
}
],
constraints: {
"https://github.com/apple/swift-argument-parser": {
majorVersion: 1
}
}
}
});
8. Docker Container Images
check_docker_tags
Check available tags for Docker container images from Docker Hub, GitHub Container Registry, or custom registries.
// Check Docker Hub images
use_mcp_tool({
server_name: "package-version",
tool_name: "check_docker_tags",
arguments: {
image: "nginx",
limit: 5
}
});
Guidelines for LLMs
When writing code that includes package dependencies, LLMs should:
- Choose the Right Tool for the Job
- Use language-specific tools for detailed dependency management:
check_npm_versions
for package.jsoncheck_python_versions
for requirements.txtcheck_pyproject_versions
for pyproject.tomlcheck_maven_versions
for pom.xmlcheck_gradle_versions
for build.gradlecheck_go_versions
for go.modcheck_swift_versions
for Package.swift
- Use
check_package_versions
for quick bulk checks across npm and PyPI - Use AWS Bedrock tools for AI model information:
check_bedrock_models
to search, list, or get specific model informationget_latest_bedrock_model
to get the latest Claude Sonnet model (best for coding tasks)
- Use Docker container image tools:
check_docker_tags
to find available tags for Docker images from Docker Hub, GitHub Container Registry, or custom registries
- Use language-specific tools for detailed dependency management:
- Always Check Versions Before Writing
- Before writing a package.json or requirements.txt file, use the appropriate tool to check latest versions
- Use the bulk check tool when dealing with multiple packages
- Consider the project's needs when deciding whether to use exact versions or version ranges
- Package.json Best Practices
// Before writing package.json, check versions
const versions = await use_mcp_tool({
server_name: "package-version",
tool_name: "check_package_versions",
arguments: {
packages: [
{ name: "express", registry: "npm" },
{ name: "react", registry: "npm" }
]
}
});
// Use the returned versions in package.json
{
"dependencies": {
"express": `^${versions.find(p => p.name === 'express').latestVersion}`,
"react": `^${versions.find(p => p.name === 'react').latestVersion}`
}
}
- Requirements.txt Best Practices
// Before writing requirements.txt, check versions
const versions = await use_mcp_tool({
server_name: "package-version",
tool_name: "check_package_versions",
arguments: {
packages: [
{ name: "requests", registry: "pypi" },
{ name: "pandas", registry: "pypi" }
]
}
});
// Use the returned versions in requirements.txt
requests=={requests.latestVersion}
pandas=={pandas.latestVersion}
- Version Range Considerations
- For applications: Consider using exact versions (= for Python, no prefix for npm)
- For libraries: Consider using compatible ranges (>= for Python, ^ for npm)
- Always document version choices in comments
- Error Handling
- If version check fails for a package, document it in comments
- Consider falling back to known stable versions if checks fail
- Warn users about any packages that couldn't be verified
Example Integrations
Here's how an LLM should approach creating new projects with different package managers:
Node.js Project
// 1. Check npm package versions
const versions = await use_mcp_tool({
server_name: "package-version",
tool_name: "check_npm_versions",
arguments: {
dependencies: {
"express": "^4.17.1",
"typescript": "~4.5.0"
}
}
});
// 2. Use the versions in package.json
write_to_file({
path: "package.json",
content: {
"name": "my-project",
"version": "1.0.0",
"dependencies": {
"express": `^${versions.find(p => p.name === 'express').latestVersion}`,
"typescript": `^${versions.find(p => p.name === 'typescript').latestVersion}`
}
}
});
Python Project with pyproject.toml
// 1. Check Python package versions
const versions = await use_mcp_tool({
server_name: "package-version",
tool_name: "check_pyproject_versions",
arguments: {
dependencies: {
dependencies: {
"requests": "^2.28.0",
"pandas": ">=1.5.0"
},
"dev-dependencies": {
"pytest": ">=7.0.0"
}
}
}
});
// 2. Use the versions in pyproject.toml
write_to_file({
path: "pyproject.toml",
content: `
[project]
name = "my-project"
version = "1.0.0"
dependencies = [
"requests>=${versions.find(p => p.name === 'requests').latestVersion}",
"pandas>=${versions.find(p => p.name === 'pandas').latestVersion}"
]
[project.optional-dependencies]
test = [
"pytest>=${versions.find(p => p.name === 'pytest (dev)').latestVersion}"
]
`
});
Go Project
// 1. Check Go package versions
const versions = await use_mcp_tool({
server_name: "package-version",
tool_name: "check_go_versions",
arguments: {
dependencies: {
module: "example.com/mymodule",
require: [
{
path: "github.com/gin-gonic/gin",
version: "v1.7.0"
}
]
}
}
});
// 2. Use the versions in go.mod
write_to_file({
path: "go.mod",
content: `
module example.com/mymodule
go 1.21
require (
github.com/gin-gonic/gin ${versions.find(p => p.name === 'github.com/gin-gonic/gin').latestVersion}
)
`
});
Java Project with Maven
// 1. Check Maven package versions
const versions = await use_mcp_tool({
server_name: "package-version",
tool_name: "check_maven_versions",
arguments: {
dependencies: [
{
groupId: "org.springframework.boot",
artifactId: "spring-boot-starter-web",
version: "2.7.0"
}
]
}
});
// 2. Use the versions in pom.xml
write_to_file({
path: "pom.xml",
content: `
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-project</artifactId>
<version>1.0.0</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${versions.find(p => p.name === 'org.springframework.boot:spring-boot-starter-web').latestVersion}</version>
</dependency>
</dependencies>
</project>
`
});
Swift Project
// 1. Check Swift package versions
const versions = await use_mcp_tool({
server_name: "package-version",
tool_name: "check_swift_versions",
arguments: {
dependencies: [
{
url: "https://github.com/apple/swift-argument-parser",
version: "1.0.0",
requirement: "from"
}
]
}
});
// 2. Use the versions in Package.swift
write_to_file({
path: "Package.swift",
content: `
// swift-tools-version:5.5
import PackageDescription
let package = Package(
name: "MyProject",
products: [
.library(name: "MyProject", targets: ["MyProject"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "${versions.find(p => p.name === 'swift-argument-parser').latestVersion}"),
],
targets: [
.target(name: "MyProject", dependencies: [.product(name: "ArgumentParser", package: "swift-argument-parser")]),
.testTarget(name: "MyProjectTests", dependencies: ["MyProject"]),
]
)
`
});
This ensures that new projects always start with the latest stable versions of packages.
Development
- Clone and Install Dependencies
git clone https://github.com/sammcj/mcp-package-version.git
cd mcp-package-version
npm i
- Build the Server
npm run build
- Development Workflow
- Use
npm run watch
for development to automatically rebuild on changes - Use
npm run build
for production builds
- Use
- Release Process
# 1. Make your changes
vim src/your-file.ts
# 2. Commit your changes
git add .
git commit -m "feat: your new feature"
# 3. Run bump command (this will):
# - Update version in package.json
# - Update CHANGELOG.md
# - Commit changes
# - Push to GitHub
npm run bump
# GitHub Actions will then:
# - Create a git tag
# - Create a GitHub release
# - Publish to npm (when triggered manually)
- Manual npm Publishing
# To trigger a manual npm publish
gh workflow run publish.yml
License
About
An MCP server that provides LLMs with the latest stable package versions when coding
Topics
javascript python security package node typescript ai tool mcp versions versioning llm
Resources
License
Code of conduct
Activity
Stars
Watchers
Forks
Releases\ 8
Release v0.1.17\Latest\ \Mar 18, 2025
Sponsor this project
Packages\ 0
No packages published