MCP server support with Secrets Manager-backed Bearer auth
dropthejase wires MCP server support into the main agent, storing per-server API keys in AWS Secrets Manager rather than env vars. The credential-handling shape - read once at cold start, scoped by server identifier, no plaintext in config - is portable to any fork that wants to connect external tools without leaking secrets.
The implementation lands across four commits. 064677 adds a buildMcpClients() function in mcp-config.ts that reads an mcp.json file from the admin S3 bucket. The format mirrors Claude Code's own MCP config: each server entry has a url and an optional authSecretName. 38f9c4a adds the Secrets Manager path - if authSecretName is set, the agent fetches the secret value at startup and attaches it as a Bearer token header on the StreamableHTTPClientTransport. If the fetch fails, that server is silently dropped rather than crashing the agent.
The client list is built per-invocation by querying user_profiles.disabled_mcp_servers and filtering out anything the user has toggled off. The McpClient instances are passed directly into createAgent() as additional tools, sitting alongside the existing tool list.
The seed server changes from mcp.data.gouv.fr (French open government data) to lex.lab.i.ai.gov.uk (UK legislation search from i.AI/DSIT) - useful if your user base is UK-oriented, otherwise replace it.
Limitations noted in the README: only static Bearer tokens are supported. OAuth 2.0 and three-legged OAuth flows won't work without AgentCore Gateway in the middle.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?