Repository navigation
Conversation
Claude Code configs can carry an oauth block per server (clientId, clientSecret, scopes, callbackPort, authServerMetadataUrl), but the import parser ignored it, so those servers arrived without OAuth and needed manual setup. Parse the block, map it to OAuthConfig and warn on the parts that do not translate. Field mapping: - clientId, clientSecret and authServerMetadataUrl map 1:1. - scopes arrives as a space-separated string and becomes a list. - callbackPort pins only a port; mcpproxy pins the whole redirect URL, so the port is dropped with a warning instead of half-applied. - An empty clientId stays empty: mcpproxy falls back to DCR or public-client PKCE, which is what a server without a static client needs. - Unknown keys in the block warn and are ignored rather than refused: this is a foreign file format, and new Claude Code fields should surface as ignored, not break the import. Daemon-mode apply needs the AddServerRequest oauth field from smart-mcp-proxy#1972; config-file mode and the parse and map pipeline are complete here.
felipecrs
added a commit
to felipecrs/mcpproxy-go
that referenced
this pull request
Nov 23, 2026
) Squash of upstream PR smart-mcp-proxy#2018 (not yet merged upstream).
Member
|
Thanks for this, Felipe — the direction is right and the mapping of scopes / authServerMetadataUrl / empty clientId looks good. Early notes since it's a draft:
Also: CI hasn't run (fork workflows await approval); please run |
Dumbris
requested changes
Nov 24, 2026
Dumbris
left a comment
Member
There was a problem hiding this comment.
Requesting changes per the review above (#2018 (comment)). The direction is good; the daemon-mode part depends on #1972, which is close to merging. Thanks!
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Author
felipecrs
added a commit
to felipecrs/mcpproxy-go
that referenced
this pull request
Nov 24, 2026
) Squash of upstream PR smart-mcp-proxy#2018 (not yet merged upstream).
This branch has not been deployed
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.
Pull Request
Description
upstream importcan read Claude Code config files, but it silently dropped theoauthblock. The parser struct had no oauth field, so a server exported or pasted from Claude Code arrived without OAuth and needed manual setup in config or the web UI before sign-in worked.Claude Code documents the block in its MCP config reference:
clientId,scopes(a space-separated string there, not a list),callbackPortandauthServerMetadataUrl. The client secret is kept in the keychain, not in the config, so a block with aclientIdwarns that the secret has to be set again.Changes:
oauthblock per server and pass it through the mapper asOAuthConfig.clientIdandauthServerMetadataUrlmap 1:1. AnauthServerMetadataUrlmcpproxy would not accept is dropped with a warning.scopesbecomes a list viastrings.Fields.clientIdstays empty: mcpproxy falls back to DCR or public-client PKCE, which is what a server without a static client needs anyway.callbackPorthas no mcpproxy equivalent.redirect_uripins the whole callback URL, so a port-only pin can't be half-applied; it's dropped with a warning that names the field, also when it is the only key. Claude Code also allocates that port for its own callback rather than expecting a fixed one at the IdP.oauthwarn and are ignored instead of refusing the import. This is a foreign file format; when Claude Code grows a field mcpproxy doesn't know, the import should say "ignored", not fail. A malformedoauthvalue is also a warning for that server only; the other servers still import.oauthobject counts as a Claude Code indicator in format detection (Gemini's hasenabled).In daemon mode the parsed block reaches the daemon through the
AddServerRequestoauth field from #1972. The parser, mapper and config-file mode work without it.Testing
New tests:
TestClaudeCodeParser_Parse/oauth_blockTestClaudeCodeParser_Parse/oauth_unknown_keys_warnedTestClaudeCodeParser_Parse/oauth_malformed_keeps_serversTestMapToServerConfig/claude_code_oauthTestMapToServerConfig/claude_code_oauth_without_client_idTestMapToServerConfig/claude_code_oauth_callback_port_onlyTestMapToServerConfig/claude_code_oauth_invalid_metadata_url_droppedTestDetectFormat/claude_code_sse_with_oauthandgemini_oauth_is_not_claude_codego test ./internal/configimport/and the relatedcmd/mcpproxytests pass.golangci-lintis clean oninternal/configimport.