Skip to content

[FEATURE] Hosted MCP servers: url and headers in mcp.yaml #1755

Description

@edenreich

Summary

A hosted MCP server such as AgentMail (https://mcp.agentmail.to/mcp, authenticated with an x-api-key header) cannot be configured today. MCPServerEntry in config/mcp.go builds the endpoint from scheme, host, port and path and has no way to send a request header, so there is no place for an API key.

Add two optional fields to a server entry in mcp.yaml:

servers:
  - name: agentmail
    enabled: true
    url: https://mcp.agentmail.to/mcp
    headers:
      x-api-key: ${AGENTMAIL_API_KEY}

url replaces the built endpoint when set. headers are sent on every request under the protocol's own headers. ${VAR} expansion already applies to the whole file, so the credential stays in the worker's environment and never in the file. A server whose expanded header is empty is skipped with a warning, so a process without the credential starts without that server instead of failing discovery.

This replaces the per-thread mcp_servers on the resume_conversation frame asked for in #1754: the server is configuration of the computer the agent runs on, not of a client's frame.

Acceptance Criteria

  • MCPServerEntry accepts url and headers, and GetURL() returns url when set.
  • The MCP client sends the configured headers on every request. A configured header never overrides Content-Type, Accept or the MCP protocol headers.
  • The supervisor skips an enabled server with an empty header value and logs which headers were unresolved.
  • docs/mcp-integration.md documents both fields with a hosted-server example, and internal/protocols/mcp/README.md mentions them.
  • Tests cover GetURL with url, header injection, and the skip rule.

Activity

  1. added
    enhancement
    on Nov 8, 2026
  2. added theissue type on Nov 8, 2026
  3. moved this from Todo to In progress in 2026on Nov 8, 2026
  4. moved this from In progress to QA in 2026on Nov 8, 2026
  5. inference-gateway-releaser commented on Nov 8, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.248.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  6. moved this from QA to Done in 2026on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions