Skip to content

Spec problem with authorization and streaming? #1076

@djMax

Description

@djMax

Is your feature request related to a problem? Please describe.
If I have a single MCP server that intends to expose both authenticated and unauthenticated tools, and uses multi-message transports like streamable HTTP, how is a tool supposed to indicate that auth is required for a tool call?

Describe the solution you'd like
A declarative method to say "this tool needs auth" or a way to throw an error that tells the server to tell the client auth is required.

Describe alternatives you've considered
I can't see one, but I'm no protocol expert. I tried sending 401 to the response directly, but headers have already been sent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequest for a new feature that's not currently supported

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions