A Model Context Protocol (MCP) server that provides access to Quay container registry APIs. This server automatically discovers Quay API endpoints from the OpenAPI specification and generates MCP tools for interacting with Quay registries.
This project follows Go best practices with a clean, modular architecture:
quay-mcp-server/
βββ cmd/
β βββ quay-mcp/ # Main application
β βββ main.go
βββ internal/ # Private application code
β βββ client/ # Quay API client
β β βββ quay_client.go
β βββ server/ # MCP server implementation
β β βββ mcp_server.go
β βββ types/ # Common data types
β βββ types.go
βββ examples/ # Example code and demonstrations
β βββ example.go
βββ test/ # Test files
β βββ main_test.go
βββ testing/ # Test data and fixtures
βββ bin/ # Built binaries (created by build)
βββ go.mod # Go module definition
βββ go.sum # Go module checksums
βββ Makefile # Build automation
βββ README.md # This file
βββ .gitignore # Git ignore rules
- Automatic API Discovery: Fetches and parses Quay's OpenAPI specification
- Dynamic Tool Generation: Creates MCP tools from API endpoints
- Smart Parameter Handling: Supports both path and query parameters
- Comprehensive Logging: Detailed request/response logging with security features
- Tag-based Filtering: Only exposes relevant API endpoints (manifest, organization, repository, robot, tag)
- Authentication Support: OAuth token authentication for protected resources
- Go 1.23 or later
- Access to a Quay registry (e.g., quay.io)
# Clone the repository
git clone https://github.com/quay/quay-mcp-server.git
cd quay-mcp-server
# Install dependencies
make deps
# Build the application
make build
# The binary will be available at ./bin/quay-mcp
# Build the application
make build
# Run tests
make test
# Run example mode
make run-example
# Clean build artifacts
make clean
# Format code
make fmt
# Install to GOPATH/bin
make install
# Show all available commands
make help
# Start MCP server for quay.io
./bin/quay-mcp -url https://quay.io
# Start with OAuth token for authenticated access
./bin/quay-mcp -url https://quay.io -token your-oauth-token
# Run in example mode to see available tools
./bin/quay-mcp -url https://quay.io -example
-url <registry-url>
: Quay registry URL (required)-token <oauth-token>
: OAuth token for authentication (optional)-example
: Run in example mode to demonstrate functionality
Add the following to your Claude Desktop MCP configuration:
{
"mcpServers": {
"quay": {
"command": "/path/to/bin/quay-mcp",
"args": ["-url", "https://quay.io"],
"env": {
"QUAY_OAUTH_TOKEN": "your-oauth-token-here"
}
}
}
}
MCPHost is a powerful CLI host application that enables Large Language Models (LLMs) to interact with MCP servers. You can use it to interact with your Quay registry through various LLM providers.
Install MCPHost using one of these methods:
# Using Go
go install github.com/mark3labs/mcphost@latest
# Using npm
npm install -g @mark3labs/mcphost
# Or download from releases
# https://github.com/mark3labs/mcphost/releases
Create or update your MCPHost configuration file at ~/.mcphost.yml
:
# MCP Servers configuration
mcpServers:
quay:
command: "/path/to/bin/quay-mcp"
args: ["-url", "https://quay.io"]
env:
QUAY_OAUTH_TOKEN: "your-oauth-token-here"
# Application settings
model: "anthropic:claude-3-5-sonnet-latest" # or openai:gpt-4, ollama:qwen2.5:3b, etc.
max-steps: 20
debug: false
# Model generation parameters
max-tokens: 4096
temperature: 0.7
top-p: 0.95
Interactive Mode:
# Start interactive session with Claude
mcphost
# Use with different LLM providers
mcphost -m openai:gpt-4
mcphost -m ollama:qwen2.5:3b
mcphost -m google:gemini-2.0-flash
Non-Interactive Mode (Perfect for Automation):
# Single query with full UI
mcphost -p "List all repositories in the redhat namespace"
# Quiet mode for scripting (only AI response)
mcphost -p "Show manifest details for redhat/ubi8" --quiet
# Use in shell scripts
REPOS=$(mcphost -p "Get public repositories from quay.io/redhat" --quiet)
echo "Found repositories: $REPOS"
Advanced Usage:
# Custom parameters for more focused responses
mcphost -p "Analyze repository security tags" --temperature 0.3 --max-tokens 2000
# With custom stop sequences
mcphost -p "Generate automation script" --stop-sequences "```","END"
Once in MCPHost interactive mode, you can use:
/tools
- List all available Quay tools/servers
- Show configured MCP servers/help
- Show available commands/history
- Display conversation history/quit
- Exit the application
$ mcphost
π€ MCPHost Interactive Mode
π‘ Connected to Quay MCP Server
You: List repositories in the redhat namespace that are public
π€ I'll help you list the public repositories in the redhat namespace using the Quay API.
[Uses quay_listRepos tool with namespace=redhat, public=true]
Here are the public repositories in the redhat namespace:
- redhat/ubi8: Red Hat Universal Base Image 8
- redhat/ubi9: Red Hat Universal Base Image 9
- redhat/3scale-toolbox: 3scale toolbox container
...
You: Show me the manifest details for redhat/ubi8:latest
π€ I'll retrieve the manifest details for the redhat/ubi8:latest image.
[Uses quay_getRepoManifest tool]
Here are the manifest details for redhat/ubi8:latest:
- Architecture: amd64
- Size: 234MB
- Layers: 3
- Digest: sha256:abc123...
...
MCPHost's non-interactive mode makes it perfect for DevOps automation:
#!/bin/bash
# Repository monitoring script
REPOS=$(mcphost -p "List all repositories in namespace 'myorg' that haven't been updated in 30 days" --quiet)
# Security scanning
VULNS=$(mcphost -p "Check for security vulnerabilities in myorg/myapp:latest" --quiet)
# Automated reporting
mcphost -p "Generate a weekly report of repository activity for myorg namespace" --quiet > weekly-report.md
The server automatically filters and exposes Quay API endpoints with the following tags:
- manifest: Container manifest operations
- organization: Organization management
- repository: Repository operations
- robot: Robot account management
- tag: Container tag operations
internal/client
: Quay API client with comprehensive HTTP handling, parameter processing, and authenticationinternal/server
: MCP server implementation with tool registration and request handlinginternal/types
: Common data structures used across packages
- Swagger Spec Discovery: Automatically fetches OpenAPI specification from Quay
- Endpoint Discovery: Parses specification to identify relevant API endpoints
- Tool Generation: Creates MCP tools with proper parameter schemas
- Request Processing: Handles both path parameters and query parameters
- Response Formatting: Returns JSON responses with proper formatting
The project follows the Standard Go Project Layout:
cmd/
: Main applicationsinternal/
: Private application and library codeexamples/
: Examples and demonstrationstest/
: Additional external test apps and test data
- Client Features: Add to
internal/client/quay_client.go
- Server Features: Add to
internal/server/mcp_server.go
- Types: Add common types to
internal/types/types.go
# Run all tests
make test
# Run tests with verbose output
go test -v ./...
The server provides comprehensive logging including:
- API request/response details
- Parameter processing
- Authentication (with token masking for security)
- Error handling
- Performance metrics
- OAuth tokens are masked in logs for security
- Response bodies are truncated to prevent log overflow
- Internal packages are not exposed to external consumers
- Fork the repository
- Create a feature branch
- Make your changes following Go best practices
- Add tests for new functionality
- Run
make fmt
andmake lint
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For issues and questions:
- Check the existing issues on GitHub
- Create a new issue with detailed information
- Include logs and reproduction steps
- Initial release with refactored architecture
- Proper Go project structure
- Comprehensive API coverage
- Full parameter support (path and query)
- Authentication and logging features