$ show awslabs/mcp
This is a monorepo containing over 40 independent MCP (Model Context Protocol) servers for AWS services, hosted under awslabs/mcp. Each server exposes tools, resources, and prompts that allow AI agents (coding assistants, chatbots) to interact with AWS APIs, databases, documentation, and best practices. The architecture is a collection of standalone Python packages, each with its own entry point (server.py/main.py), tests, Dockerfile, and PyPI distribution. Servers are built using either FastMCP or the lower-level MCP Python SDK, with consistent patterns for read-only enforcement, error handling, AWS client creation, and user-agent tracking. The codebase demonstrates solid engineering with extensive test coverage, but suffers from significant copy-paste boilerplate across servers (healthcheck scripts, Context singletons, test_init.py) and inconsistent use of MCP frameworks. Notable high-craftsmanship components include the AWS API MCP server's custom CLI-to-IR parser and execution engine, the OpenAPI MCP server's pluggable authentication provider framework, and the DynamoDB MCP server's schema-driven code generation tool. The repository is actively maintained with frequent commits and issue triage, though some servers are marked as deprecated or in initial setup, and the announcement of a successor ('Agent Toolkit for AWS') suggests potential future migration.
The LLM identified 5 files worth highlighting for reuse:
A custom lexer that tokenizes AWS CLI command strings into an intermediate representation (IR) for further processing. It handles shlex-style tokenization, rejects shell operators (pipe, redirect, etc.) for security, and produces structured tokens (Command, Flag, Positional, etc.). This is a non-obvious, self-contained component that could be extracted for any CLI parsing task requiring strict input validation.
The execution engine that takes the parsed IR from the lexer/parser and translates it into boto3 API calls. It handles pagination, error mapping, and result formatting. This module demonstrates a clean separation between parsing and execution, and its pagination logic (build_result, extract_pagination_config) is reusable for any paginated AWS API.
An abstract base class and protocol for authentication providers in an MCP server that proxies OpenAPI specs. It defines a clean interface (authenticate, get_auth_headers, refresh) and is implemented by BasicAuthProvider, BearerAuthProvider, APIKeyAuthProvider, and CognitoAuthProvider. This is a well-designed, extensible pattern that can be reused in any MCP server needing pluggable authentication.
An abstract interface for language-specific type mappings used in DynamoDB entity/repository code generation. It defines methods for mapping DynamoDB attribute types to language types, generating import statements, and formatting field declarations. Implementations exist for Python and TypeScript. This is a self-contained pattern for schema-driven code generation that could be adapted to any database or API.
A reusable session management module for deploying MCP servers on AWS Lambda. It defines a SessionStore abstract base class with NoOpSessionStore (in-memory) and DynamoDBSessionStore (persistent) implementations. This pattern allows any MCP server to be deployed serverlessly with pluggable session persistence, and is cleanly separated from the server logic.