Skip to content

Add Secret Management Support for Remote Servers Bearer Tokens #1747

Done

Description

@amirejaz

We need a way to securely provide authentication (e.g., headers, bearer tokens) when connecting to remote MCP servers. Right now, there’s no dedicated mechanism for secret management for remote MCP servers, which leads to hardcoding or less secure workarounds.

Initial Scope

  • Start simple with support for injecting a single secret (e.g., API key or bearer token).

Future Extensibility

  • Allow integration with external secret providers (Vault, OAuth proxy, cloud secret managers, etc.).
  • Support dynamic secret resolution based on a combination of caller identity and server identity.
  • Consider secret rotation and refresh flows.

Motivation

  • Securely manage authentication for remote MCP servers.
  • Enable flexible setups where secrets are resolved dynamically.
  • Avoid embedding sensitive information directly in configs.

Activity

  1. danbarr commented on Dec 4, 2025

    @danbarr
    Collaborator

    For reference / later testing, I've just run into a remote server that requires a header to authenticate: PagerDuty.

    From their docs:

    {
      "mcpServers": {
        "pagerduty-hosted": {
          "url": "https://mcp.pagerduty.com/mcp",
          "headers": {
            "Authorization": "Token your-pagerduty-api-token-here"
          }
        }
      }
    }
  2. jhrozek commented on Nov 24, 2026

    @jhrozek
    Contributor

    Closing this as covered for the initial scope. Remote servers can take a bearer token via --remote-auth-bearer-token (or --remote-auth-bearer-token-file, or the environment variable), and arbitrary headers can be forwarded with --remote-forward-headers, with values read from secrets via --remote-forward-headers-secret.

    The longer-term items (external secret providers such as Vault, dynamic resolution, rotation) are not covered here. If you need those, please open one issue for each so they can be scoped separately.

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

    authenticationenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions