Skip to content

SEP-1488: securitySchemes in Tool Metadata for Mixed-Auth Servers #1488

Done

Description

@thiago-openai

SEP: securitySchemes in Tool Metadata for Mixed-Auth Servers

Authors: Duke Kim ([email protected]), Thiago Hirai ([email protected])
Status: Draft
Sponsor: Nick Cooper ([email protected])
Type: Standards Track
Created: 2025-09-17

Summary

We propose adding an optional securitySchemes field to MCP tool descriptors. This makes it possible for a server to mark which tools are open to everyone and which need auth. Clients can then:

  • Show clear UI labels (e.g. “Public” vs. “Requires sign-in”).
  • Ask users to sign in before calling protected tools.
  • Pick between public and authenticated versions of the same tool.

This is a small, backward-compatible change. For now, we support just two scheme types:

  • "noauth" → tool can be called without credentials
  • "oauth2" → tool needs OAuth 2.0 (with optional scopes list)

More scheme types can be added later without changing the shape of the field.

Motivation

Right now, clients only discover auth needs by trying and failing, or by reading docs. This isn’t great.
By declaring securitySchemes per tool, servers can:

  • Improve UX: Clients know upfront if a tool is public or needs auth.
  • Guide flows: Clients can prompt users for login before invoking a protected tool.
  • Reduce mistakes: Servers can mark tools as public vs. protected.
  • Stay flexible: Easy to add new auth schemes (API keys, mTLS, etc.) later.

Design

Tool Descriptor Change

Each tool can include a new optional securitySchemes field in its tools/list response:

{
  "name": "get_weather",
  "title": "Weather Info",
  "description": "Get current weather for a location",
  "inputSchema": {
    "type": "object",
    "properties": { "location": { "type": "string" } },
    "required": ["location"]
  },
  "securitySchemes": [
    { "type": "noauth" },
    { "type": "oauth2", "scopes": ["weather.read"] }
  ]
}

Field Definition

securitySchemes (array, optional)

  • If missing → tool follows the server’s default policy.
  • If empty array → discouraged, same as missing.
  • If present with entries → lists supported auth schemes.

Scheme types (so far):

  • noauth: no credentials required.
  • oauth2: needs OAuth2; can list scopes if relevant.

Multiple Schemes

  • Tools can list both noauth and oauth2 to mean “works anonymously, but auth gives more features.”
  • Clients can pick any scheme they can satisfy, usually preferring authenticated.
  • Servers must enforce auth rules regardless of client metadata.

Examples

Public with optional auth:

{
  "name": "search",
  "title": "Public Search",
  "description": "Search public documents.",
  "inputSchema": { "type": "object", "properties": { "q": { "type": "string" } }, "required": ["q"] },
  "securitySchemes": [
    { "type": "noauth" },
    { "type": "oauth2", "scopes": ["search.read"] }
  ]
}

Auth required:

{
  "name": "create_doc",
  "title": "Create Document",
  "description": "Make a new doc in your account.",
  "inputSchema": { "type": "object", "properties": { "title": { "type": "string" } }, "required": ["title"] },
  "securitySchemes": [
    { "type": "oauth2", "scopes": ["docs.write"] }
  ]
}

No field (inherits server policy):

{
  "name": "status",
  "title": "Server Status",
  "description": "Basic health info.",
  "inputSchema": { "type": "object", "properties": {} }
}

JSON Schema (informative)

{
  "$id": "https://modelcontextprotocol.io/schemas/tool.securitySchemes.v1",
  "type": "object",
  "properties": {
    "securitySchemes": {
      "type": "array",
      "items": {
        "oneOf": [
          { "type": "object", "required": ["type"], "properties": { "type": { "const": "noauth" } } },
          { "type": "object", "required": ["type"], "properties": {
              "type": { "const": "oauth2" },
              "scopes": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }
            }
          }
        ]
      }
    }
  },
  "additionalProperties": true
}

Compatibility

  • Optional field → no breaking changes.
  • Old clients ignore it and keep using runtime errors/docs to figure out auth.
  • Old servers just don’t send it.

Security Notes

  • Declaring noauth makes public tools explicit and auditable.
  • Declaring oauth2 with scopes helps clients request the right tokens.
  • This field is just metadata; servers still must enforce auth.
  • Misconfigurations (e.g. forgetting to require auth) are the main risk.

Activity

  1. changed the title [-]SEP: securitySchemes in Tool Metadata for Mixed-Auth Servers[/-] [+]SEP-1488: securitySchemes in Tool Metadata for Mixed-Auth Servers[/+] on Sep 18, 2025
  2. self-assigned this
    on Sep 18, 2025
  3. added
    draft
    on Sep 18, 2025
  4. localden commented on Sep 19, 2025

    @localden
    Contributor

    I am thinking through the scenario of how this would work today. If I have a server that does not require auth, and then I encounter a tool that does require auth, #835 might already cover it - this would effectively have the client invoke the authorization flow even if the server initially did not go through the auth flow.

    The only drawback there is that there isn't any explicit "labeling" of a tool as being open or requiring auth.

    This leads me to think that the metadata can be much simpler in the SEP - you don't need to define the scopes or additional information beyond requiresAuth: true|false. This also allows this to work with other future auth profiles that might not even use scopes for authorization and something else entirely. The server can determine what's required once the auth flow kicks off.

  5. D-McAdams commented on Sep 19, 2025

    @D-McAdams

    To help evaluate this proposal, could you quantify the specific impact you're seeing? You mention that discovery-by-failure "isn't great," but I'd like to better understand the measurable friction this creates.

    For example, the proposed approach doesn't reduce client complexity—clients always need to handle auth failures since tokens can expire or be revoked. Adding discovery would actually introduce additional complexity and another code path for clients to maintain.

    If the concern is latency, that extra round-trip tends to be immaterial compared to the existing overhead from metadata lookups and consent flows that are already part of the auth process.

    What specific, measurable problems would this solve that justify the added complexity to the specification?

  6. nbarbettini commented on Sep 19, 2025

    @nbarbettini
    Contributor

    Along the lines of @localden's question but from another angle, consider a "usage hint" that could be shown to the end-user in the UI:

    {
      "name": "delete_doc",
      "title": "Delete Document",
      "description": "Delete a doc in your account.",
      "inputSchema": { "type": "object", "properties": { "title": { "type": "string" } }, "required": ["title"] },
      
      // Hypothetical:
      "usage_hint": "This tool may require administrator privileges."
    }

    A usage hint would help the consumer understand that invoking the tool may require a step-up authorization or additional interaction. But, it's not structured/machine-readable because the pattern for machines is try->fail with WWW-Authenticate.

    Other than the extra roundtrip of the try-fail pattern, what benefit does securitySchemes have over a usage hint?

    I'm not pushing on this because I hate structured security info 🙂 but rather because servers advertising info like which scopes are required for a tool is often quite nuanced. @localden and I discussed a similar idea in detail (#850 and an accompanying doc), and the conclusion at the time was not to add structured authz info to resource descriptors.

  7. thiago-openai commented on Sep 20, 2025

    @thiago-openai
    Author

    @D-McAdams: good question - and I'd be happy to adjust the SEP to make this more clear! Here are a couple of scenarios that would benefit from pre-invocation knowledge of required authorization primitives:

    1. The rendering of a settings screen where users can see which tools are available at each level of authorization, helping them to decide whether to go through an OAuth flow

    2. Aiding a model in selecting an adequate set of tools for a user known to have certain authorization. In absence of the mapping proposed here, the model would have to try multiple tools to find all that's available, leading to a degraded experience for the user, the client and the server (all of which would be waiting for requests that will fail with a 403).

  8. fsiyavud commented on Sep 22, 2025

    @fsiyavud

    This proposal seems to have some overlap with SEP-1385. This proposal allows "oauth2" entries with scopes, while SEP-1385 has permission with subType: "scope". If both carry scopes, and if there is drift, which one takes precedence?

    It might make sense to fold securitySchemes into the SEP-1385 definition. For instance, something like this for optional requirement for OAuth2:

    "requires": [
      { "conditional": {
          "conditions": [{ "type": "capability", "name": "mcp:authenticated.oauth2" }],
          "requirement": { "type": "permission", "subType": "scope", "value": "weather.premium" }
      }}
    ]

    Here is an example for mandatory OAuth:

    "requires": [
      { "type": "capability", "name": "mcp:authenticated.oauth2" },
      { "type": "permission", "subType": "scope", "value": "payments:write" },
      { "type": "permission", "subType": "claim", "name": "role", "value": "admin" }
    ]
  9. maia-iyer commented on Oct 1, 2025

    @maia-iyer
    Contributor

    I support this proposal. With my own POCs focused on zero trust with down-scoped access tokens, I'm writing test MCP Servers where different tools require different scopes and would like clients to be able to obtain and use access tokens that are more granular and tool-specific.

    The overhead of dealing with errors for each tool when the scopes are not explicitly defined seems painful.

  10. DevasiaThomas commented on Oct 9, 2025

    @DevasiaThomas

    @thiago-openai do you think accommodating a tool that uses a different OAuth provider (different from what the server uses) can bring additional value to this proposal.

  11. clemsonfan101 commented on Nov 4, 2025

    @clemsonfan101

    This is the exact kind of update to the MCP spec I was hoping to see. I've been working on an MCP server that by design will allow some tool calls to be anonymous and some to require authorization, and it would be excellent if MCP clients could gracefully handle that transition where a user needs to now authorize the application. Additionally, it would be nice if within the UI of the application itself the user could tell which features of the connector that required authorization.

    That latter point helps users understand, "how far can I go with this before I need to sign up for an account with ?"

  12. 37 remaining items

  13. rossbuckley1990-hash commented on Oct 7, 2026

    @rossbuckley1990-hash
  14. sep-automation-bot commented on Oct 12, 2026

    @sep-automation-bot

    Maintainer Activity Check

    Hi @nickcoai!

    You're assigned to this SEP but there hasn't been any activity from you in 14 days.

    Please provide an update on:

    • Current status of your review/work
    • Any blockers or concerns
    • Expected timeline for next steps

    If you're no longer able to sponsor this SEP, please let us know so we can find another maintainer.


    This is an automated message from the SEP lifecycle bot.

  15. balabommablock-cpu commented on Oct 20, 2026

    @balabommablock-cpu
  16. maxchop commented on Oct 29, 2026

    @maxchop

    @balabommablock-cpu "the user just sees a sign-in prompt a bit earlier or later" holds when a person is there. An agent running unattended has nobody to answer the prompt. It reads "works without sign-in: yes" and calls with no token, and a later release that puts the tool behind auth breaks it. Section 7.4 of draft-morrison-mcp-tool-surface-names-registry says the same for registered surface names - an operator that changes a surface's authentication requirements "breaks callers written against the earlier requirements".

    Could the spec keep your three values and say a yes holds across releases? A server that can't promise that says partly. I think scopeHints can stay advisory since the runtime challenge always overrides them.

    Cheers

  17. rehevkor5 commented on Oct 30, 2026

    @rehevkor5

    Following up on @tawfff’s point that the catalogue itself can be sensitive, so servers should be able to keep tools/list behind auth.

    It seems like this SEP's scenario is focused on an assumption that the list is visible pre-auth. I'm seeing the same pressure from gateways. Some require server owners to leave tools/list open so they can enumerate tools centrally for search and discovery, per-tool metadata or hint customization, and tool-level policy builders. Today, because there is no standard approach by which a gateway can discover all tools, they work around it either by precluding auth, which discloses the catalog to everyone, or sometimes by borrowing a user’s identity, which yields one user’s view rather than an exhaustive catalog view.

    On @tawfff’s first question: it seems clear from the spec that list results are a function of the authenticated principal, so varying tools/list by credential is conformant:

    Servers that declare the tools capability MUST respond to tools/list requests with the set of tools currently available to the requesting client.

    But it leaves a gap, which is that there's no standard way to perform exhaustive discovery. One possibility might be standardizing an OAuth scope that grants "list all tools" (without granting invocation) which could be granted to the gateway's machine identity.

    Could standardization of such a discovery mechanism be in-scope for this SEP?

  18. balabommablock-cpu commented on Oct 31, 2026

    @balabommablock-cpu
  19. maxchop commented on Nov 1, 2026

    @maxchop

    @balabommablock-cpu I think leaving the field out works better than stretching partly to cover it. The stop-and-report line for unattended clients is the part I'd most want in the spec text.

    If you still want to write up the summary for the Tool Scopes WG I'm happy to look over a draft.

    Cheers

  20. balabommablock-cpu commented on Nov 1, 2026

    @balabommablock-cpu
  21. maxchop commented on Nov 1, 2026

    @maxchop

    @balabommablock-cpu

    Migration for servers already sending securitySchemes: [noauth] → public

    I think this line needs one change. A server sending [noauth] today promises nothing about later releases. Mapping it to public makes the point 4 promise for it. Map [noauth] to no hint and let the server move to public once it can promise it. The same holds for [noauth, oauth2] and optional.

    The rest reads right to me.

    Cheers

  22. balabommablock-cpu commented on Nov 1, 2026

    @balabommablock-cpu
  23. sep-automation-bot commented on Nov 2, 2026

    @sep-automation-bot

    Maintainer Activity Check

    Hi @nickcoai!

    You're assigned to this SEP but there hasn't been any activity from you in 20 days.

    Please provide an update on:

    • Current status of your review/work
    • Any blockers or concerns
    • Expected timeline for next steps

    If you're no longer able to sponsor this SEP, please let us know so we can find another maintainer.


    This is an automated message from the SEP lifecycle bot.

  24. sep-automation-bot commented on Nov 16, 2026

    @sep-automation-bot

    Maintainer Activity Check

    Hi @nickcoai!

    You're assigned to this SEP but there hasn't been any activity from you in 14 days.

    Please provide an update on:

    • Current status of your review/work
    • Any blockers or concerns
    • Expected timeline for next steps

    If you're no longer able to sponsor this SEP, please let us know so we can find another maintainer.


    This is an automated message from the SEP lifecycle bot.

  25. dend commented on Nov 27, 2026

    @dend
    Contributor

    Thank you for the contribution! Any proposals to the MCP specification need to go through a Working Group before an issue or pull request is opened in this repository, so that each proposal has a group of interested folks behind it by the time it's up for review.

    The best next step is to hop into the MCP Contributor Discord, find the working group closest to your proposal, and open a thread there. If you are not certain which working group that is, you can ask in #general. Our contributor communication page and contribution guidelines have more detail on the process.

    Closing this issue pending working group alignment.

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

Metadata

Metadata

Assignees

Labels

SEPauthdraftsecurity

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions