MCP OAuth fails with providers requiring HTTPS redirect URIs

Open 💬 9 comments Opened Mar 1, 2026 by seanbarker96

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When configuring an MCP server that uses OAuth with providers requiring HTTPS redirect URIs (like Slack, Microsoft Azure AD, etc.), Claude Code attempts to use http://localhost:PORT/callback as the redirect URI. This causes OAuth authentication to fail with an error:

redirect_uri did not match any configured URIs. Passed URI: http://localhost:3118/callback

The redirectUri field in the MCP server configuration appears to be ignored, and Claude Code always uses HTTP instead of HTTPS for the localhost callback.

What Should Happen?

Claude Code should either:

  1. Support HTTPS redirect URIs for localhost callbacks (https://localhost:PORT/callback)
  2. Honor the redirectUri field when explicitly configured in the MCP server settings
  3. Provide a documented method for using OAuth providers that enforce HTTPS-only redirect URIs

This would allow users to connect to MCP servers that use OAuth providers with HTTPS requirements.

Error Messages/Logs

When trying to set up a slack mcp for your custom slack app you get this error in your browser 


redirect_uri did not match any configured URIs. Passed URI: http://localhost:3118/callback


example slack app mcp config


{
  "type": "http",
  "url": "https://mcp.slack.com/mcp",
  "oauth": {
    "clientId": "your-client-id",
    "callbackPort": 3118
  }
}

Steps to Reproduce

  1. Create an OAuth application with a provider that requires HTTPS redirect URIs (e.g., Slack)
  2. Configure the MCP server in Claude Code with OAuth settings:
{
  "type": "http",
  "url": "https://mcp.example.com/mcp",
  "oauth": {
    "clientId": "your-client-id",
    "callbackPort": 3118
  }
}
  1. Attempt to connect to the MCP server using /mcp command
  2. Observe the redirect_uri mismatch error

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.63 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗