How we built an MCP bridge to give our AgentCore-hosted AI agent access to local MCP tools
Anthropic's MCP protocol lacks a transport mechanism for remote clients connecting to local servers, creating a gap for cloud-hosted agents needing local tool access AWS built an MCP bridge using WebSocket tunneling and native messaging to connect cloud-hosted Strands agents on AgentCore with local MCP servers The architecture uses four components: AgentCore runtime (cloud), browser extension (bidirectional relay), MCP Bridge (FastMCP proxy on local machine), and local MCP server Authentication
Analysis
TL;DR
- Anthropic's MCP protocol lacks a transport mechanism for remote clients connecting to local servers, creating a gap for cloud-hosted agents needing local tool access
- AWS built an MCP bridge using WebSocket tunneling and native messaging to connect cloud-hosted Strands agents on AgentCore with local MCP servers
- The architecture uses four components: AgentCore runtime (cloud), browser extension (bidirectional relay), MCP Bridge (FastMCP proxy on local machine), and local MCP server
- Authentication uses presigned WebSocket URLs generated locally with AWS credentials, ensuring no credentials leave the user's machine
- The solution enables financial analysts to use centrally deployed AI agents that can directly read and act on local Excel files and browser context
Why It Matters
This architecture solves a critical gap in the MCP ecosystem where cloud-hosted AI agents cannot natively access local tools and data, which is essential for enterprise workflows involving local files like spreadsheets. It demonstrates a production-grade pattern (41,000+ conversations) that other organizations can replicate for secure, self-hosted AI agent deployments on AWS.
Technical Details
- MCP Bridge Architecture: Uses a FastMCP proxy running locally that translates between native messaging envelope format and raw MCP JSON-RPC, with stdio transport for local server communication
- Message Flow: Three-layer wrapping/unwrapping—AgentCore sends JSON envelope over WebSocket to browser extension, which relays via native messaging to the bridge, which unwraps and forwards JSON-RPC to the MCP server over stdio
- WebSocket Authentication: Presigned SigV4-signed WebSocket URLs generated locally using the user's AWS credentials and the bedrock-agentcore SDK, scoped to the deployed runtime ARN with 5-minute validity and automatic reconnection
- Strands Agent Integration: Agent performs standard MCP initialization handshake (initialize request → capabilities response → notifications/initialized), then calls tools/list on each user message and wraps schemas into Strands AgentTool objects with stream() methods
- Request-Response Correlation: Each JSON-RPC request gets a unique ID registered against an asyncio.Future keyed by (session_id, jsonrpc_id) for proper response matching
Industry Insight
- The MCP protocol's current transport limitations (stdio and streamable HTTP only) create a market opportunity for bridge solutions enabling hybrid cloud-local AI agent deployments
- Enterprises should consider self-hosted patterns on AWS Bedrock AgentCore for sensitive workflows, keeping credentials local while leveraging cloud compute for AI processing
- The presigned URL authentication pattern demonstrated here provides a secure template for other cloud-to-local communication scenarios without exposing credentials to browsers or networks
Disclaimer: The above content is generated by AI and is for reference only.