Repository navigation
Report upstream authentication failures clearly in forward discovery - #2170
Merged
Merged
Conversation
An MCP server that requires authentication, such as the GitHub MCP server, failed discovery with an opaque rmcp transport error when the forward had no credential binding. Map HTTP 401 and 403 challenges from the rmcp transport to typed McpClientError variants. When a forward without a discovery binding gets a 401, the status message points to a credential binding in wanaku.yaml. Document a GitHub MCP server example and the related status messages. Closes #2167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HHEiwjZFf35g1drdCNGad
Reviewer's GuideThe PR replaces opaque rmcp handshake failures with typed 401/403 errors, propagates them into consistent and actionable forward discovery status messages, and documents GitHub MCP authentication configuration and troubleshooting. Flow diagram for configuring authenticated MCP discoveryflowchart LR
Token[Create GitHub personal access token]
Env[Set GITHUB_PAT]
Binding[Add discovery credential binding in wanaku.yaml]
Discover[Forward discovery]
Tools[Discover tools resources and prompts]
Failure[Show actionable authentication status]
Token --> Env --> Binding --> Discover
Discover -->|Credential accepted| Tools
Discover -->|401 without binding| Failure
Discover -->|401 with rejected credential| Failure
Discover -->|403 insufficient scope| Failure
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Integration Test Results
Test Results
|
This branch was successfully 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.
Closes #2167
Summary
Adding an MCP server that requires authentication (for example the GitHub MCP server) through the admin UI, the management API, or the CLI failed with an opaque rmcp transport error. This change makes the failure clear and points to the fix.
infra/src/mcp_client.rs: map HTTP 401 and 403 challenges from the rmcp transport to typedMcpClientError::AuthRequiredandMcpClientError::InsufficientScopevariants. All eight handshake sites use oneconnect_errorhelper.server/src/management/handlers.rs: create, refresh, and startup discovery build the status message in one place. When a forward without a discovery binding gets a 401, the message tells the operator to add a credential binding inwanaku.yaml.docs/credential-brokerage.md: add a GitHub MCP server example and a table of authentication status messages.Status message before:
After:
Credential entry through the UI or the API is out of scope. That is #809, and it needs a security decision first (see #2167).
Testing
cargo test -p wanaku-infra mcp_clientandcargo test -p wanaku-server forward_helpers_testspass.cargo clippy --workspace --all-targetsadds no warnings compared withmain.github-mcp-serverv2.0.2 inhttpmode. Without a binding, the forward shows the new message. With awanaku.yamlbearer binding, discovery finds 46 tools, 9 resources, and 2 prompts, andtools/callworks through/<namespace>/mcp.Generated by Claude Code
Summary by Sourcery
Report actionable upstream authentication failures during MCP forward discovery and guide operators to configure the required credential bindings.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: