picoclaw/pkg/mcp
Andy Lo-A-Foe a01c0ec3af
feat(mcp): support per-request dynamic headers from channel context
Channels can now pass HTTP headers to MCP servers on a per-request basis
by storing keys with a "mcp:" prefix in InboundContext.Raw. This enables
forwarding bearer tokens from channel authentication to MCP tool calls.

The context flows: Channel → InboundContext.Raw["mcp:Authorization"]
→ toolshared.MCPHeaders(ctx) → headerTransport.RoundTrip → HTTP header.

SSE/HTTP transports now always use headerTransport (previously only when
static headers were configured) so dynamic headers work out of the box.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 09:55:38 +02:00
..
events.go fix(events): keep runtime observers non-blocking 2026-04-27 13:09:03 +08:00
isolated_command_transport.go Feat/support isolation (#2423) 2026-04-08 18:15:42 +08:00
manager.go feat(mcp): support per-request dynamic headers from channel context 2026-05-11 09:55:38 +02:00
manager_test.go fix(events): keep runtime observers non-blocking 2026-04-27 13:09:03 +08:00