container-tag-finder
Enables AI agents to retrieve the latest semantic version tags for container images from Docker Hub, GHCR, Quay, and other OCI registries, allowing them to pin specific versions for reproducible deployments.
README
Container Tag Finder
A simple API and MCP server that helps AI agents find the latest container image tags.
The Problem
AI agents often struggle with container image versioning:
- Web searches return outdated or inconsistent information
- Registry APIs require authentication and specific knowledge
- The "latest" tag is ambiguous—you usually want the latest semantic version
This project provides a clean API that returns the actual latest version tag, making it easy for agents to pin images to specific versions.
Quick Start
Run with Docker Compose (Recommended)
# Start the API server
docker compose up -d
# Test it
curl http://localhost:8080/latest/nginx
Run the MCP server via Docker
# Interactive mode for MCP
docker compose run --rm mcp
Local Installation
# Clone and install
cd container-tag-finder
pip install -e .
Run the REST API (Local)
# Start the server (with hot reload for development)
RELOAD=true container-tag-finder
# Or directly
python -m container_tag_finder.server
The API will be available at http://localhost:8080. Try:
# Get latest nginx version
curl http://localhost:8080/latest/nginx
# Get latest Redis from Bitnami
curl http://localhost:8080/latest/bitnami/redis
# Get latest KEDA from GitHub Container Registry
curl "http://localhost:8080/latest/ghcr.io/kedacore/keda"
# Get latest PostgreSQL 16.x only
curl "http://localhost:8080/latest/postgres?major=16"
Use as MCP Server
Add to your MCP configuration (e.g., Claude Desktop's claude_desktop_config.json or Cursor's MCP settings):
{
"mcpServers": {
"container-tags": {
"command": "container-tag-mcp",
"args": []
}
}
}
Or with uv:
{
"mcpServers": {
"container-tags": {
"command": "uv",
"args": ["run", "--directory", "/path/to/container-tag-finder", "container-tag-mcp"]
}
}
}
Or via Docker:
{
"mcpServers": {
"container-tags": {
"command": "docker",
"args": ["compose", "-f", "/path/to/container-tag-finder/docker-compose.yml", "run", "--rm", "-T", "mcp"]
}
}
}
API Reference
GET /latest/{image}
Get the latest semantic version tag for an image. This is the primary endpoint for agents.
Parameters:
image(path) - Image reference (e.g.,nginx,ghcr.io/owner/repo)include_prerelease(query) - Include RC/beta versions (default:false)major(query) - Only consider this major version (e.g.,16for PostgreSQL 16.x)pattern(query) - Regex filter for tags
Example Response:
{
"image": "nginx",
"registry": "docker.io",
"repository": "library/nginx",
"latest_tag": "1.27.3",
"latest_stable": "1.27.3",
"full_reference": "nginx:1.27.3",
"digest": "sha256:abc123...",
"all_semver_tags": ["1.27.3", "1.27.2", "1.27.1", "1.26.2", ...]
}
GET /tags/{image}
List all tags for an image with semantic version analysis.
Parameters:
image(path) - Image referencepattern(query) - Regex filterlimit(query) - Max tags to return (default: 50)
GET /compare/{image}?current={tag}
Check if an update is available for a given tag.
Example:
curl "http://localhost:8080/compare/nginx?current=1.25.0"
Response:
{
"current_tag": "1.25.0",
"current_is_semver": true,
"latest_tag": "1.27.3",
"update_available": true,
"update_type": "minor",
"message": "Update available: 1.25.0 → 1.27.3"
}
MCP Tools
The MCP server provides three tools for AI agents:
get_latest_image_tag
Find the latest version of a container image.
Input: { "image": "nginx" }
Output: Latest stable version with full reference
list_image_tags
List available tags for an image.
Input: { "image": "postgres", "pattern": "^16\\." }
Output: All PostgreSQL 16.x tags
check_image_update
Check if an update is available.
Input: { "image": "nginx", "current_tag": "1.25.0" }
Output: Update status and recommendation
Supported Registries
- Docker Hub (
docker.io) - Official and user images - GitHub Container Registry (
ghcr.io) - Quay.io (
quay.io) - Google Container Registry (
gcr.io) - Any OCI-compliant registry - Generic support via OCI Distribution API
Image Reference Formats
The API understands these formats:
| Input | Registry | Repository |
|---|---|---|
nginx |
docker.io | library/nginx |
bitnami/redis |
docker.io | bitnami/redis |
ghcr.io/owner/repo |
ghcr.io | owner/repo |
quay.io/prometheus/prometheus |
quay.io | prometheus/prometheus |
gcr.io/project/image |
gcr.io | project/image |
Version Detection
The API parses semantic versions from tags intelligently:
- Standard semver:
1.2.3,v1.2.3 - With prerelease:
1.2.3-rc1,1.2.3-beta.2 - With build metadata:
1.2.3+build123 - Variant suffixes:
1.2.3-alpine,1.2.3-slim(treated as prerelease) - Two-part versions:
1.2(treated as1.2.0)
Non-version tags like latest, edge, nightly, sha-abc123 are automatically filtered out.
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
ruff format .
ruff check --fix .
Why This Exists
When working with AI coding assistants on containerized applications, I found that:
- Asking "what's the latest nginx version?" leads to web searches with outdated results
- Agents can't easily query container registries directly
- The "latest" tag is what agents default to, but it's bad practice for reproducibility
This API/MCP gives agents a reliable way to find the actual latest semantic version, making it easy to write nginx:1.27.3 instead of nginx:latest.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。