Skip to content

fix: set client_name in OAuth DCR and add --oauth-client-name flag - #41

Merged
knowsuchagency merged 2 commits into
knowsuchagency:mainfrom
jdormit:jdormit/set-client-name-in-oauth-registration
Apr 5, 2026
Merged

fix: set client_name in OAuth DCR and add --oauth-client-name flag#41
knowsuchagency merged 2 commits into
knowsuchagency:mainfrom
jdormit:jdormit/set-client-name-in-oauth-registration

Conversation

@jdormit

@jdormit jdormit commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Sets client_name="mcp2cli" as the default in the OAuthClientMetadata used for OAuth Dynamic Client Registration (DCR)
  • Adds --oauth-client-name flag to allow overriding the client name for servers that require a specific value

Problem

Some MCP servers require the client_name field in the RFC 7591 Dynamic Client Registration request body, but mcp2cli wasn't setting it:

  • Honeycomb (mcp.honeycomb.io): returns 400 {"error":"invalid_client_metadata"} without client_name
  • Figma (mcp.figma.com): restricts DCR to an allowlist of known client names — returns 403 Forbidden unless client_name matches an approved value (e.g. "Claude Code (figma)")

Fix

Commit 1: Always send client_name="mcp2cli" by default. This fixes servers like Honeycomb that just require the field to be present.

Commit 2: Add --oauth-client-name CLI flag (default: "mcp2cli") to allow overriding the value. This fixes servers like Figma that require a specific client name. The flag is also threaded through bake create/config so baked tools can persist a custom client name.

# Honeycomb works with the default
mcp2cli --mcp https://mcp.honeycomb.io/mcp --oauth --list

# Figma requires a specific client name
mcp2cli --mcp https://mcp.figma.com/mcp --oauth --oauth-client-name "Claude Code (figma)" --list

Verified that Notion (which already worked) continues to work with the default.

jdormit and others added 2 commits April 3, 2026 16:21
Some MCP servers (e.g. Honeycomb) require the client_name field in the
OAuth 2.0 Dynamic Client Registration request body per RFC 7591. Without
it, the registration fails with invalid_client_metadata.

Co-authored-by: opencode <noreply@opencode.ai>
Some MCP servers (e.g. Figma) restrict Dynamic Client Registration to
specific client names. This flag allows users to set the client_name
sent during OAuth DCR, defaulting to 'mcp2cli'.

Example: mcp2cli --mcp https://mcp.figma.com/mcp --oauth --oauth-client-name 'Claude Code (figma)' --list

Also threads the option through bake create/show/install so baked
configs can persist a custom client name.

Co-authored-by: opencode <noreply@opencode.ai>
@jdormit jdormit changed the title fix: set client_name in OAuth DCR registration request fix: set client_name in OAuth DCR and add --oauth-client-name flag Apr 3, 2026
@knowsuchagency

Copy link
Copy Markdown
Owner

Thanks for the submission @jdormit !

@knowsuchagency
knowsuchagency merged commit 194c5a6 into knowsuchagency:main Apr 5, 2026
@Christian-Sidak

Copy link
Copy Markdown
Contributor

Opened a fix in #69 -- changes tool.get("inputSchema", {}) to tool.get("inputSchema") or {} so that an explicit null value (not just a missing key) is also treated as an empty schema, preventing the AttributeError crash. Two regression tests are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants