Skip to content

feat(agent/x/agentmcp): add a same-origin header HTTP client - #32271

Draft
f0ssel wants to merge 9 commits into
garrett/agent-plugins/07-agentmcp-helpersfrom
garrett/agent-plugins/08-mcp-same-origin-headers
Draft

f0ssel wants to merge 9 commits into
garrett/agent-plugins/07-agentmcp-helpersfrom
garrett/agent-plugins/08-mcp-same-origin-headers

Conversation

@f0ssel

@f0ssel f0ssel commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

sameOriginHeaderClient adds a server's configured headers only to requests whose scheme, IDNA host, and port match the server URL, so a request that leaves that origin (for example a redirect) doesn't carry them. It never overrides caller-set or transport-managed headers.

Plugin HTTP servers use it in the next PR. Part 1 of the #29325 split.

Stack (base main, replaces #29321–#30577):

PR Title Size
#32264 feat: carry Agent Plugin fields through context snapshots +542/-213
#32265 feat(agent/agentcontext): discover and validate Agent Plugins manifests +1951/-74
#32296 feat(agent/agentcontext): load skills bundled in Agent Plugins +653/-19
#32266 feat(agent): enable Agent Plugins discovery from the manifest +988/-79
#32267 feat(coderd/x): add plugin skill source and alias grammar +138/-32
#32268 feat: add plugin skill and plugin context resource types +295/-161
#32269 feat(coderd): serve plugin skills in chatd +1338/-386
#32270 feat(agent/x/agentmcp): accept streamable-http MCP type, add plugin data dir helper +92/-0
👉 #32271 feat(agent/x/agentmcp): add a same-origin header HTTP client +547/-4
#32272 feat(agent): load plugin mcp.json and reload registered MCP sources +1262/-228
#32273 test(agent/x/agentmcp): cover plugin mcp.json parsing, reloads, isolation, and env +2044/-2
#32274 feat: run plugin MCP servers discovered by agentcontext +851/-26
#32275 feat(site/src): render Agent Plugin context +1349/-240

Generated by Claude Code

sameOriginHeaderClient adds a server's configured headers only to
requests whose scheme, host (IDNA ASCII form), and port match the
server URL, so a request that leaves that origin, such as a redirect,
does not carry them; the first such request is logged at warn level
with origins only. It never replaces a caller-set header or one that
net/http manages. mcpBaseTransport picks the test-isolated transport
or http.DefaultTransport for both header clients.

Plugin HTTP servers use this client in the next change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VpiVZBgFqiSdRKrH8dPSPT
@f0ssel f0ssel self-assigned this Nov 16, 2026
@f0ssel
f0ssel added this pull request to stack #32278 November 16, 2026 18:37
@f0ssel
f0ssel force-pushed the garrett/agent-plugins/08-mcp-same-origin-headers branch from 1ca24a8 to 396b134 Compare November 16, 2026 23:25
f0ssel and others added 2 commits November 16, 2026 22:12
@f0ssel f0ssel assigned garrettatcoder and unassigned f0ssel Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants