Run custom MCP proxies serverless on Amazon Bedrock AgentCore Runtime
Summary
This post details how to deploy a serverless Model Context Protocol (MCP) proxy on Amazon Bedrock AgentCore Runtime, enabling custom governance, controls, and observability for AI agent-tool interactions. The proxy acts as an intermediary, applying custom logic like input sanitization, audit trail generation, or data redaction, without modifying upstream MCP servers or clients. It runs as a stateless container on AgentCore Runtime, dynamically discovering tools from an upstream MCP server (like Amazon Bedrock AgentCore Gateway) at startup and forwarding requests. The solution supports both AWS Identity and Access Management (IAM) and JSON Web Token (JWT)-based authorization for proxy-to-upstream server communication. An open-source GitHub implementation provides the foundation, with deployment scripts and a test agent to demonstrate the end-to-end flow, including customization opportunities for tokenization and tool-level access control.
Key takeaway
For AI Architects and MLOps Engineers building enterprise AI agents, consider deploying a serverless MCP proxy on Amazon Bedrock AgentCore Runtime. This approach allows you to embed custom governance and security controls, such as data tokenization or fine-grained access control, directly into the agent-tool communication flow without altering existing backend systems. Your teams can maintain compliance and enhance security by centralizing custom logic at the protocol layer, ensuring robust and auditable AI agent operations.
Key insights
Deploying a serverless MCP proxy on AgentCore Runtime enables custom governance and control over AI agent-tool interactions.
Principles
- Separate custom control logic from core tool execution.
- Enforce authorization independently at each architectural layer.
- Dynamically discover and re-expose tools with custom logic.
Method
The proxy discovers tools from an upstream MCP server at startup, dynamically registers local FastMCP tools, and forwards client requests through handler functions that apply custom logic before or after forwarding.
In practice
- Implement PII tokenization in tool call arguments.
- Apply tool-level access control based on caller identity.
- Use AgentCore Gateway as a managed upstream MCP server.
Topics
- Model Context Protocol
- Amazon Bedrock AgentCore Runtime
- Serverless Proxy
- AI Agent Governance
- Tool Integration
Code references
Best for: MLOps Engineer, AI Engineer, AI Architect
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence.