Registry /
aws / awslabs-aws-api-mcp-server
Install & Compatibility
Where this runs
tested against v1.5.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✕ build_error
342MB installed
● package 342MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
McpServer
✓ from awslabs.aws_api_mcp_server import McpServer
✗ from awslabs.aws_api_mcp_server import McpServer
This quickstart demonstrates how to set up a basic MCP server using `awslabs-aws-api-mcp-server`. It implements a custom `ModelContextServiceServicer` and starts an asynchronous gRPC server. In a real application, you would implement the `AddContext` and `GetContext` methods to handle actual model context operations.
import asyncio
from concurrent import futures
import grpc
from mcp.server import McpServer
from mcp.service import ModelContextServiceServicer
from mcp.server.models.mcp_pb2_grpc import add_ModelContextServiceServicer_to_server
from mcp.server.models.mcp_pb2 import AddContextRequest, AddContextResponse
class MyMcpService(ModelContextServiceServicer):
"""Example implementation of the ModelContextServiceServicer."""
async def AddContext(self, request: AddContextRequest, context: grpc.aio.ServicerContext) -> AddContextResponse:
print(f"Received AddContext request for model: {request.model_name}")
# Implement actual context logic here
return AddContextResponse(success=True, message="Context added successfully")
async def GetContext(self, request, context):
# Implement GetContext logic
return super().GetContext(request, context)
async def serve():
server = grpc.aio.server(futures.ThreadPoolExecutor(max_workers=10))
add_ModelContextServiceServicer_to_server(MyMcpService(), server)
server.add_insecure_port('[::]:50051')
print('Starting MCP server on port 50051')
await server.start()
await server.wait_for_termination()
if __name__ == '__main__':
asyncio.run(serve())
Debug
Known issues
gotchaThe server runs as an asynchronous gRPC service. Ensure your custom `ModelContextServiceServicer` implementations are also `async def` functions and correctly handle asynchronous operations. Blocking calls within these methods can degrade performance.fixAll service methods (e.g., `AddContext`, `GetContext`) overridden from `ModelContextServiceServicer` should be defined with `async def` and use `await` for any asynchronous operations.
affects: All versions
breakingMajor changes to the underlying Model Context Protocol definition (e.g., in `mcp.proto`) could introduce breaking changes to the gRPC service interface. While `awslabs` strives for backward compatibility, new major versions of the library might reflect such protocol updates.fixAlways review the changelog for breaking changes when upgrading to new major versions. Re-generating client stubs based on the updated `.proto` definition and updating your `ModelContextServiceServicer` implementation might be necessary.
affects: Potentially future major versions (e.x., 2.0.0+)
gotchaCorrectly loading and managing API models and context is crucial for the server's function. The example provides a basic `AddContext`, but production implementations will require robust storage and retrieval mechanisms for the models and their associated context.fixDesign a proper data store (e.g., database, S3) and logic within your `ModelContextServiceServicer` to persist and retrieve model context. Consider concurrency and consistency requirements.
affects: All versions
gotchaThe library relies on specific versions of `grpcio` and `protobuf`. Incompatibility issues can arise if other projects in your environment use different or conflicting versions of these dependencies.fixUse a virtual environment to isolate project dependencies. If encountering issues, check `pip freeze` for `grpcio` and `protobuf` versions and align them with what `awslabs-aws-api-mcp-server` expects or is known to work with.
affects: All versions
Upgrade
Version history
1.5.3latest on PyPI · released Aug 27, 2026
Audit
Dependencies
grpciorequiredCore dependency for gRPC communication.
protobufrequiredUsed for protocol buffer serialization.
boto3requiredAWS SDK for Python, potentially used for interacting with other AWS services or loading models.
pydanticrequiredUsed for data validation and parsing.
jsonschemarequiredUsed for JSON schema validation.