fix: set client_name in OAuth DCR and add --oauth-client-name flag - #41
Merged
knowsuchagency merged 2 commits intoApr 5, 2026
Conversation
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>
Owner
|
Thanks for the submission @jdormit ! |
3 tasks
Contributor
|
Opened a fix in #69 -- changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
client_name="mcp2cli"as the default in theOAuthClientMetadataused for OAuth Dynamic Client Registration (DCR)--oauth-client-nameflag to allow overriding the client name for servers that require a specific valueProblem
Some MCP servers require the
client_namefield in the RFC 7591 Dynamic Client Registration request body, but mcp2cli wasn't setting it:mcp.honeycomb.io): returns400 {"error":"invalid_client_metadata"}withoutclient_namemcp.figma.com): restricts DCR to an allowlist of known client names — returns403 Forbiddenunlessclient_namematches 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-nameCLI 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.Verified that Notion (which already worked) continues to work with the default.