[mcp] Surface OAuth at add time so netclaw mcp auth precedes permissions - #1773
Open
Aaronontheweb wants to merge 3 commits into
Open
[mcp] Surface OAuth at add time so netclaw mcp auth precedes permissions#1773Aaronontheweb wants to merge 3 commits into
Aaronontheweb wants to merge 3 commits into
Conversation
Comment on lines
+80
to
+84
| foreach (var server in servers.EnumerateArray()) | ||
| { | ||
| if (server.ValueKind == JsonValueKind.String && !string.IsNullOrWhiteSpace(server.GetString())) | ||
| return server.GetString(); | ||
| } |
| if (headers.Keys.Any(key => string.Equals(key, "Authorization", StringComparison.OrdinalIgnoreCase))) | ||
| return null; | ||
|
|
||
| var client = httpClientFactory?.Invoke() |
… add The daemon owns RFC 9728/8414 OAuth discovery through McpOAuthClientRegistrar. The CLI must not run a second, client-side discovery. This commit removes McpOAuthProbe and the add-time probe call in McpCommand. netclaw mcp add no longer probes the endpoint. It now prints an unconditional hint for HTTP/SSE servers added without an Authorization header: run netclaw mcp auth first if the server needs OAuth. stdio servers and servers with an explicit Authorization header keep the permissions-only guidance. The --auth flag keeps its behavior. It still starts the OAuth flow through the daemon after add. Deletes: - src/Netclaw.Cli/Mcp/McpOAuthProbe.cs - src/Netclaw.Cli.Tests/Mcp/McpOAuthProbeTests.cs Refs #1772, #1773.
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.
[mcp] Surface OAuth at add time so
netclaw mcp authprecedes permissions for OAuth-protected serversChanges
netclaw mcp addnow probes HTTP/SSE endpoints for RFC 9728 protected-resource metadata (best-effort; never fails the add) and printsnetclaw mcp auth <name>as step 1, beforenetclaw mcp permissions, when OAuth is required.registration_endpoint, the output says to re-add with a pre-registered--client-idinstead of letting the auth flow fail later.--authflag runs the OAuth flow immediately after adding; prints a fallback hint when the daemon is unavailable, and is ignored for stdio.Authorizationheader and stdio transports skip the probe entirely — their output is unchanged.McpOAuthProbeis a self-contained static class mirroring the daemon's existing RFC 9728 discovery; tests are theory-based and fully hermetic viaFakeHttpMessageHandler.Closes #1772.
--auth,--client-id, probe behavior)McpServerName