An MCP (Model Context Protocol) server that provides tools for querying OCI registries and image references. This project implements an SSE-based MCP server that allows LLM-powered applications to interact with OCI registries. It provides tools for retrieving information about container images, listing tags, and more. - Get information about OCI images - List tags for repositories - Get image mani
Add this skill
npx mdskills install StacklokLabs/ocireg-mcpWell-documented MCP server providing useful OCI registry interaction tools with clear setup instructions
1# OCI Registry MCP Server23[](https://archestra.ai/mcp-catalog/stackloklabs__ocireg-mcp)4An MCP (Model Context Protocol) server that provides tools for querying OCI5registries and image references.67## Overview89This project implements an SSE-based MCP server that allows LLM-powered10applications to interact with OCI registries. It provides tools for retrieving11information about container images, listing tags, and more.1213## Features1415- Get information about OCI images16- List tags for repositories17- Get image manifests18- Get image configs1920## MCP Tools2122The server provides the following MCP tools:2324### get_image_info2526Get information about an OCI image.2728**Input:**2930- `image_ref`: The image reference (e.g., docker.io/library/alpine:latest)3132**Output:**3334- Image information including digest, size, architecture, OS, creation date, and35 number of layers3637### list_tags3839List tags for a repository.4041**Input:**4243- `repository`: The repository name (e.g., docker.io/library/alpine)4445**Output:**4647- List of tags for the repository4849### get_image_manifest5051Get the manifest for an OCI image.5253**Input:**5455- `image_ref`: The image reference (e.g., docker.io/library/alpine:latest)5657**Output:**5859- The image manifest6061### get_image_config6263Get the config for an OCI image.6465**Input:**6667- `image_ref`: The image reference (e.g., docker.io/library/alpine:latest)6869**Output:**7071- The image config7273## Usage7475### Running with ToolHive (Recommended)7677The easiest way to run the OCI Registry MCP server is using78[ToolHive](https://github.com/stacklok/toolhive), which provides secure,79containerized deployment of MCP servers:8081```bash82# Install ToolHive (if not already installed)83# See: https://docs.stacklok.com/toolhive/guides-cli/install8485# Register a supported client so ToolHive can auto-configure your environment86thv client setup87# Run the OCI Registry MCP server (packaged as 'oci-registry' in ToolHive)88thv run oci-registry8990# List running servers91thv list9293# Get detailed information about the server94thv registry info oci-registry95```9697The server will be available to your MCP-compatible clients and can query OCI98registries for image information.99100#### Authentication with ToolHive101102If you need to access private registries, you can provide authentication103credentials using ToolHive's secret management:104105```bash106# For bearer token authentication107thv secret set oci-token108# Enter your bearer token when prompted109110thv run --secret oci-token,target=OCI_TOKEN oci-registry111112# For username/password authentication113thv secret set oci-username114thv secret set oci-password115# Enter your credentials when prompted116117thv run --secret oci-username,target=OCI_USERNAME --secret oci-password,target=OCI_PASSWORD oci-registry118```119120## Development121122### Prerequisites123124- Go 1.21 or later125- Access to OCI registries126127### Authentication128129The server supports the following authentication methods for accessing private130OCI registries (in order of priority):1311321. **HTTP Authorization Header** (Highest Priority): Include a bearer token in133 the HTTP request's `Authorization` header:134135 - `Authorization: Bearer <your-token>`136 - This method takes precedence over all other authentication methods137 - When present, environment variables and Docker config are ignored1381392. **Bearer Token Environment Variable**: Set the following environment variable:140141 - `OCI_TOKEN`: Bearer token for registry authentication1421433. **Username and Password**: Set the following environment variables:144145 - `OCI_USERNAME`: Username for registry authentication146 - `OCI_PASSWORD`: Password for registry authentication1471484. **Docker Config** (Lowest Priority): If no other authentication is provided,149 the server will use the default Docker keychain, which reads credentials from150 `~/.docker/config.json`.151152Examples:153154```bash155# HTTP Authorization header (for per-request authentication)156# This is handled automatically by the MCP client when making requests157# Example: curl -H "Authorization: Bearer mytoken" http://localhost:8080/...158159# Bearer token authentication via environment variable160export OCI_TOKEN=mytoken161162# Username/password authentication via environment variables163export OCI_USERNAME=myuser164export OCI_PASSWORD=mypassword165```166167### Port Configuration168169The server can be configured to listen on a specific port using either:1701711. **Environment Variable**:172173 - `MCP_PORT`: The port number to listen on (must be between 0 and 65535)174 - If not set or invalid, defaults to port 80801751762. **Command-line Flag**:177 - `-port`: Overrides the environment variable setting (must be between 0178 and 65535)179 - If invalid port provided it defaults to port 8080180 - Example: `./ocireg-mcp -port 9090`181182### Testing183184```bash185go test ./...186```187188### Linting189190```bash191golangci-lint run192```193194## Contributing195196We welcome contributions to this MCP server! If you'd like to contribute, please197review the [CONTRIBUTING guide](./CONTRIBUTING.md) for details on how to get198started.199200If you run into a bug or have a feature request, please201[open an issue](https://github.com/StacklokLabs/ocireg-mcp/issues) in the202repository or join us in the `#mcp-servers` channel on our203[community Discord server](https://discord.gg/stacklok).204205## License206207This project is licensed under the Apache v2 License - see the LICENSE file for208details.209
Full transparency — inspect the skill content before installing.