Skip to content

fix: add OAuth 2.0 discovery endpoint for Claude Code#44

Open
Loule95450 wants to merge 1 commit into
datagouv:mainfrom
Loule95450:fix/oauth-discovery
Open

fix: add OAuth 2.0 discovery endpoint for Claude Code#44
Loule95450 wants to merge 1 commit into
datagouv:mainfrom
Loule95450:fix/oauth-discovery

Conversation

@Loule95450
Copy link
Copy Markdown

Summary

Fixes #26 - Add OAuth 2.0 Authorization Server Metadata endpoint.

Problem

Claude Code HTTP transport performs OAuth discovery by hitting:

GET /.well-known/oauth-authorization-server

The production server returns 404, causing Claude Code to fail.

Solution

Added /.well-known/oauth-authorization-server endpoint returning valid OAuth 2.0 Authorization Server Metadata (RFC 8414).

References:

  • RFC 8414: OAuth 2.0 Authorization Server Metadata
  • MCP Specification: Transport Security

Fixes #26

Add /.well-known/oauth-authorization-server endpoint returning valid
OAuth 2.0 Authorization Server Metadata (RFC 8414).

This fixes issue #26 where Claude Code HTTP transport fails because
the OAuth discovery endpoint returns 404.

Fixes #26
Comment thread main.py
await send({"type": "http.response.body", "body": body})
return

# OAuth 2.0 discovery endpoint (for Claude Code HTTP transport)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds a bit verbose and not very agnostic for a specific code tool, is this the recommended solution? Do we have any documentation on that?

@bolinocroustibat bolinocroustibat added 3 - Low priority Nice-to-have and removed 3 - Low priority Nice-to-have labels Mar 31, 2026
@bolinocroustibat
Copy link
Copy Markdown
Collaborator

@Loule95450

We installed it with Claude using the Claude Code command claude mcp add --transport http datagouv_test https://mcp.data.gouv.fr/mcp and we couldn't reproduce.

Can you give more info about how to reproduce?

@bolinocroustibat bolinocroustibat added bug Something isn't working question Further information is requested and removed bug Something isn't working labels Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Code HTTP transport fails: OAuth discovery endpoint returns 404

2 participants