Repository navigation
feat(mcp): reach hosted servers through a url and headers in mcp.yaml - #1757
Merged
Merged
Conversation
A server entry accepts `url`, replacing the endpoint built from scheme, host, port and path, and `headers`, sent on every request under the protocol's own headers. `${VAR}` expansion keeps the credential in the environment of the process that loads the file, so a daemon's workers get it from the machine the agent runs on.
An enabled server whose expanded header is empty is skipped with a warning and no container is started for it, so a process without the credential starts without that server instead of failing discovery.
Closes #1755
Closed
4 tasks
Contributor
|
🎉 This PR is included in version 0.248.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This was referenced Nov 8, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1755
Summary
A hosted MCP server such as AgentMail (
https://mcp.agentmail.to/mcp, authenticated with anx-api-keyheader) could not be configured. A server entry built its endpoint fromscheme,host,portandpath, and nothing could carry a request header.This replaces the per-thread
mcp_serverson theresume_conversationframe that #1754 asked for. The server is configuration of the machine the agent runs on, not a field a client sends with every thread open. #1754 is closed with the rationale.Changes
config/mcp.go:MCPServerEntrygainsurlandheaders, andGetURLreturnsurlwhen it is set.UnresolvedHeadersnames the headers whose expanded value is empty.internal/protocols/mcp/infrastructure/client.go:NewClienttakes the headers and sends them on every request. They are set before the protocol headers, so they never overrideContent-Type,Acceptor the MCP headers.internal/protocols/mcp/supervisor.go: an enabled server with an unresolved header is skipped with a warning. No client is made for it and no container is started, so a process without the credential starts without that server instead of failing discovery.docs/mcp-integration.md, and one line in the mcp README.Verification
GetURLwithurl,UnresolvedHeaders, the client sending configured headers without overriding protocol ones, and the supervisor skip.StartServersguard is removed.go test -racepasses on the touched packages,go test ./...passes, and so do the pre-commit hook and lint.Docs follow-up: inference-gateway/docs#1128.