fix: complete OAuth config extraction in API responses (fixes #155) #164
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.
Problem
PR #156 attempted to fix OAuth detection in
auth statusbut had an incomplete implementation. While it added theOAuthfield tocontracts.Serverand implemented extraction inConvertServerConfig(), it missed adding OAuth extraction toConvertGenericServersToTyped()- the function actually used by the HTTP API.This caused
auth statusto still report "No servers with OAuth configuration found" even when servers had"oauth": {}in their config.Root Cause
The HTTP API endpoint
/api/v1/serversusesConvertGenericServersToTyped()to serialize server data. This function extracted all server fields (name, url, env, headers, timestamps, isolation config) except OAuth configuration, causing it to be silently dropped from API responses.Changes
Core Fix
ConvertGenericServersToTyped()(converters.go:238-269)auth_url,token_url,client_id,scopes,extra_params,redirect_portscopes([]interface{}) andextra_params(map[string]interface{})Testing
converters_test.gowith 3 comprehensive test cases:Verification
Before Fix
After Fix
$ mcpproxy auth status ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔐 OAuth Authentication Status ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Server: sentry Status: ❌ Authentication Failed Error: failed to connect: all authentication strategies failed, last error: OAuth authorization required - deferred for background processingAPI Response
Testing
Impact
This completes the OAuth visibility work started in PR #156, enabling:
auth statuscorrectly detects OAuth-configured serversextra_paramssupport (Phase 1+ of Autodetect OAuth without explicit oauth settings #155)Related
Note: This PR focuses solely on fixing the OAuth config extraction bug. The full
extra_paramsimplementation (allowing custom OAuth parameters like RFC 8707resource) is tracked separately and will follow the plan indocs/plans/2025-11-27-oauth-extra-params.md.