Enable Programmatic Authentication for MCP Servers Without Browser Redirects

Open
#19 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale

Research direction

No implementation files, tests, or entry points are named. Start by reading the linked MCP Authorization Specification, RFC8414, and OAuth 2.0 for First-Party Applications draft; done would require identifying the target repository and agreeing how the optional metadata endpoint and challenge flow should be specified or implemented.

Written by the indexing model from the issue text.

Description

enhancement
Problem Definition

Concrete Implementation Challenge: We are building a voice-based healthcare agent that needs to authenticate patients over phone calls. The current MCP OAuth specification requires browser-based redirects, which is impossible in a voice channel.

Validation: This affects any MCP implementation where:

  • Users interact through voice (IVR systems, voice assistants)
  • CLI tools need authentication without launching browsers
  • Embedded devices without browser capabilities
Current Blocker

MCP specification mandates OAuth 2.1 with browser redirects:

Client -> Redirect to Authorization Endpoint -> Browser -> Callback

This flow cannot work when:

  1. No browser is available (phone calls)
  2. Browser interruption breaks user experience (CLI tools)
Minimal Proposed Change

Allow MCP servers to optionally support programmatic authentication by adopting the OAuth 2.0 for First-Party Applications specification:

  1. Add an optional field to Authorization Server Metadata (RFC8414):
{
  "issuer": "https://mcp.example.com",
  "authorization_endpoint": "https://mcp.example.com/authorize",
  "authorization_challenge_endpoint": "https://mcp.example.com/authorize/challenge",  // NEW
  "token_endpoint": "https://mcp.example.com/token",
  // ... other standard fields
}
  1. When authorization_challenge_endpoint is present, clients can use the challenge/response flow as defined in the First-Party Apps draft.
Why This Is Minimal
  1. Single metadata addition: Just one optional endpoint in server metadata
  2. Existing specification: Follows an established IETF draft rather than inventing new patterns
  3. Backwards compatible: Only active when server advertises the endpoint
  4. No protocol changes: Still uses authorization codes and standard token exchange
Security Considerations

Per the First-Party Apps specification:

  • MUST only be used by first-party applications
  • Authorization servers SHOULD restrict this endpoint to specific trusted client IDs
  • All security requirements from Section 9 of the draft apply
Use Case Example

A voice agent could authenticate callers using knowledge-based authentication:

  • Collect identity information (name, DOB, SSN last 4)
  • POST to the challenge endpoint
  • Receive authorization code
  • Exchange for access token using standard flow
  • Access MCP resources with the token
Alternative Considered

We considered using custom extensions, but that would fragment the ecosystem. Adopting an existing IETF draft enables broad use cases while maintaining compatibility.

Prototype

tell me which repo(s), if any, you want a protoytype created in, and I can make a PR.

References

Co authored by gregorySDTaylor and claude-sonnet-4

Dominant language
MDX
Stars
164
Forks
54
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/ext-auth

All issues in modelcontextprotocol/ext-auth

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.