Skip to main content
Glama

MCP Docker Hub Server

Assignment.md7.37 kB
# **DockerHub MCP Server Development Assignment** ## **Overview** Build a Model Context Protocol (MCP) server that provides comprehensive integration with DockerHub, enabling AI assistants to search, analyze, and manage Docker images through standardized MCP tools. ## **Assignment Objectives** ### **Primary Goal** Create a production-ready MCP server that: * Implements the official MCP SDK specification using TypeScript * Provides comprehensive Docker Hub functionality through MCP tools * Supports both public Docker Hub and private registries * Is compatible with popular MCP clients (Claude Desktop, Cursor, Cline, etc.) * Demonstrates best practices in authentication, caching, and error handling ### **Technical Requirements** 1. **MCP SDK Implementation** * Use the official TypeScript MCP SDK from [https://github.com/modelcontextprotocol/typescript-sdk](https://github.com/modelcontextprotocol/typescript-sdk) * Implement proper server lifecycle management * Support standard MCP transport protocols (stdio, SSE) * Comprehensive TypeScript typing 2. **Docker Hub API Integration** * Image search and discovery * Image details and metadata retrieval * Tag listing and management * Layer information and size analysis * Vulnerability scanning results (when available) * Download statistics and popularity metrics * User and organization repository access * Dockerfile retrieval (when available) * Image history and creation details 3. **Authentication & Security** * Docker Hub authentication (username/password and access tokens) * Secure credential storage * Proper scope handling * Rate limit management 4. **Performance & Efficiency** * Implement caching for frequently accessed data * Rate limit handling for Docker Hub API * Efficient pagination for large result sets * Parallel request optimization where applicable ## **Deliverables** 1. **Source Code** * Well-structured TypeScript codebase * Clear README with setup instructions * Docker Compose file for testing with local registry * Example configuration files 2. **MCP Tools Implementation** **Required Tools:** * `docker_search_images` \- Search Docker Hub for images * `docker_get_image_details` \- Get detailed information about an image * `docker_list_tags` \- List all tags for a repository * `docker_get_manifest` \- Retrieve image manifest * `docker_analyze_layers` \- Analyze image layers and sizes * `docker_compare_images` \- Compare two images (layers, sizes, base images) * `docker_get_dockerfile` \- Attempt to retrieve Dockerfile (when available) * `docker_get_stats` \- Get download statistics and star count 3. **Bonus Tools:** * `docker_get_vulnerabilities` \- Fetch security scan results * `docker_get_image_history` \- Get image build history * `docker_track_base_updates` \- Check if base images have updates * `docker_estimate_pull_size` \- Calculate download size for an image 4. **Documentation** * API documentation for each tool * Authentication setup guide * Private registry configuration * Example workflows and use cases * Troubleshooting guide 5. **Testing** * Unit tests for core functionality * Integration tests with Docker Hub API * Mock registry tests * Example test data and fixtures ## **Evaluation Criteria** ### **Code Quality (30%)** * Clean, maintainable TypeScript code * Proper error handling and edge cases * Efficient data structures * Good separation of concerns ### **Functionality (40%)** * Complete implementation of required tools * Accurate Docker API integration * Multi-registry support * Performance optimizations ### **MCP Compliance (20%)** * Adherence to MCP specification * Proper tool schema definitions * Correct response formatting * Client compatibility ### **Documentation & Usability (10%)** * Clear setup instructions * Comprehensive examples * Good error messages * Developer experience ## **Bonus Points** * **Advanced Features** * Support for StreamableHTTP transport * Smart caching with TTL based on image update frequency * Batch operations for fetching multiple image details * Export to various formats (JSON, CSV, dependency trees) * Rate limit visualization and smart request queuing * **Security Enhancements** * Vulnerability severity filtering and grouping * CVE database cross-referencing * License compliance checking * Security policy validation (e.g., no images older than X days) * **Developer Experience** * Interactive configuration wizard * Built-in Docker Hub connectivity tester * Performance metrics and monitoring * Comprehensive error messages with recovery suggestions * Support for .env configuration files ## **Example Use Cases** The MCP server should enable AI assistants to: 1. "Find the most popular Python images and compare their sizes" 2. "Check if our production images have any critical vulnerabilities" 3. "List all versions of nginx and show me the differences between latest and stable" 4. "Analyze the layers of this image and identify optimization opportunities" 5. "Monitor our private registry and alert on unusual image sizes" ## **Technical Challenges to Address** 1. **Rate Limiting**: Docker Hub has strict rate limits \- implement intelligent request management 2. **Data Size**: Image manifests and layer data can be large \- handle efficiently 3. **API Limitations**: Some data (like Dockerfiles) may not always be available 4. **Caching Strategy**: Balance between fresh data and API quota usage 5. **Response Streaming**: For large datasets, implement proper streaming responses ## **Submission Instructions** 1. Create a public GitHub repository with your implementation 2. Include a `IMPLEMENTATION.md` file documenting: * Your architectural decisions * How you handled authentication across registries * Caching strategy and performance optimizations * Challenges faced and solutions * Security considerations * Future improvements 3. Ensure the repository includes: * All source code * Comprehensive README * Example configuration files * CI/CD pipeline (GitHub Actions) * License file (MIT preferred) ## **Resources** * [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) * [Docker Hub API Documentation](https://docs.docker.com/docker-hub/api/latest/) * [MCP Specification](https://modelcontextprotocol.io/docs) * [Docker Hub Rate Limiting](https://docs.docker.com/docker-hub/download-rate-limit/) ## **Important Notes** * Focus on creating a tool that would genuinely help developers manage their Docker images through AI assistants * Consider real-world scenarios like security scanning, image optimization, and dependency tracking * The implementation should handle Docker Hub's rate limiting gracefully * Emphasize good developer experience with clear error messages and intuitive tool naming --- **This assignment tests**: API integration skills, handling rate limits, data caching strategies, performance optimization, and creating developer-friendly tools for container management.

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/sirsambhav221/MCPDCOKER'

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