[mcp] Surface OAuth at add time so netclaw mcp auth precedes permissions - #1773
Merged
Conversation
… 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.
Merged
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.
What
netclaw mcp addnow surfaces thenetclaw mcp authstep beforenetclaw mcp permissionsfor an HTTP/SSE server. A user authorizes an OAuth-protected server first, because the permissions step needs a connected server.The daemon owns RFC 9728 OAuth discovery (
McpOAuthClientRegistrar). An earlier revision of this PR added a second discovery path in the CLI (McpOAuthProbe). A second implementation drifts from the daemon's, so this revision removes it. The CLI prints an unconditional hint instead of a probe.Closes #1772.
Changes
mcp addprints an unconditional next-step hint for an HTTP/SSE server without an explicitAuthorizationheader:netclaw mcp auth <name>netclaw mcp permissionsAuthorizationheader, keeps the permissions-only guidance.--authruns the OAuth flow right after the add. It delegates to the daemon (netclaw mcp auth). A stdio server ignores it. The command prints a fallback hint when the daemon is not available.McpOAuthProbe) and its RFC 9728 / RFC 8414 discovery. The daemon stays the single owner of OAuth discovery.Tests
--authtests.Notes
mcp-oauthcapability, so this is a conformance fix.