Skip to content

Fix MCP OAuth authorization for ChatGPT - #711

Merged
dahlia merged 1 commit into
fedify-dev:mainfrom
dahlia:feat/mcp
Nov 29, 2026
Merged

dahlia merged 1 commit into
fedify-dev:mainfrom
dahlia:feat/mcp

Conversation

@dahlia

@dahlia dahlia commented Nov 29, 2026

Copy link
Copy Markdown
Member

When ChatGPT connects to the MCP endpoint added in #708, Hollo returns invalid_request before showing the consent screen. Hollo rejects ChatGPT's Client ID Metadata Document because the legacy token_endpoint_auth_method field declares private_key_jwt. The same document also advertises none in its supported methods list.

Hollo now checks token_endpoint_auth_methods_supported when the document provides it. A client that lists none can use Hollo's public-client authorization code flow with PKCE. When the list is absent, Hollo falls back to the legacy field and defaults to none if both fields are absent.

The updated parser accepts ChatGPT's live metadata. Completing the OAuth flow in ChatGPT web still needs verification on a Hollo instance running the patch.

Use the client metadata document's supported authentication methods
when it provides them. ChatGPT advertises none alongside its legacy
private_key_jwt preference, so Hollo can use its public-client PKCE
flow. Preserve the existing fallback for documents without a list.

Cover ChatGPT's metadata in a regression test and document the
supported method in the unreleased MCP changelog.

fedify-dev#708

Assisted-by: Codex:gpt-6.2-sol
Assisted-by: Claude Code:claude-fable-5-2
@dahlia dahlia added this to the Hollo 0.10 milestone Nov 29, 2026
@dahlia dahlia self-assigned this Nov 29, 2026
@dahlia dahlia added the bug Something isn't working label Nov 29, 2026
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The MCP client metadata loader now checks the advertised authentication methods and accepts metadata when those methods include none. Tests cover rejection and acceptance cases, and changelog entries describe the ChatGPT public-client method.

Changes: MCP client metadata

Layer / File(s) Summary
Authentication method selection and validation
src/mcp-client-metadata.ts, src/mcp-client-metadata.test.ts, CHANGES.md, changes.d/mcp-endpoint.md
The loader accepts any string for token_endpoint_auth_method. It uses token_endpoint_auth_methods_supported when present; otherwise, it uses the legacy method or defaults to none. It rejects metadata unless the selected methods include none. Tests cover rejection cases and ChatGPT metadata with private_key_jwt preferred and none supported. The changelog describes this behavior and updates issue references.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • fedify-dev/hollo#707: The issue describes the MCP OAuth flow and Client ID Metadata Documents; this change updates metadata parsing used by that flow.

Possibly related PRs

  • fedify-dev/hollo#708: This PR changes the client metadata parsing used by the MCP endpoint and OAuth flow introduced in #708.
Merge Risk: Minimal · up to 9be94

Hollo will now accept ChatGPT's OAuth client metadata for the MCP endpoint. This relies on the advertised supported-methods list that includes the public-client method. Clients that offer only private-key authentication are still rejected. No concrete merge-blocking risk was found. The author still needs to confirm the full ChatGPT flow on a patched instance.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: fixing MCP OAuth authorization for ChatGPT. The changeset updates how Hollo reads token_endpoint_auth_methods_supported, which resolves the invalid_request error ChatG…
Description check Passed The description states the problem (ChatGPT's metadata declares private_key_jwt in the legacy field and gets rejected) and the fix (checking token_endpoint_auth_methods_supported first, with fallback …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: fixing MCP OAuth authorization for ChatGPT. The changeset updates how Hollo reads token_endpoint_auth_methods_supported, which resolves the invalid_request error ChatGPT hits before consent. The title is specific and matches the objectives.

Full details: Description check

Explanation

The description states the problem (ChatGPT's metadata declares private_key_jwt in the legacy field and gets rejected) and the fix (checking token_endpoint_auth_methods_supported first, with fallback to the legacy field). It also notes that the ChatGPT web flow still needs verification. This matches the changeset.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 03739f60-a9d0-410c-a6f3-5c6ffa67b5ad
Commits

Reviewing files that changed from the base of the PR and between ed4ad2a and 9be942e.

Files selected for processing: 4

  • CHANGES.md
  • changes.d/mcp-endpoint.md
  • src/mcp-client-metadata.test.ts
  • src/mcp-client-metadata.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@dahlia
dahlia merged commit 8f7bc20 into fedify-dev:main Nov 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant