fix(auth-transport): forward authenticated users, skip per-tool checks#2801
Open
fix(auth-transport): forward authenticated users, skip per-tool checks#2801
Conversation
…ool checks
Authenticated users (browser session or MCP OAuth) are now forwarded
directly to downstream MCP servers without per-tool permission checks.
The downstream server handles its own authorization.
Granular per-tool AccessControl checks are preserved for API keys only,
where fine-grained permissions (e.g., { "conn_<id>": ["TOOL_A"] }) are
the expected access control model.
This fixes "Access denied" errors when Claude Code CLI (which uses MCP
OAuth) tries to call tools on connections. The user is already
authenticated — Mesh shouldn't second-guess which tools they can use
on connections they have access to.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
Contributor
Release OptionsShould a new version be published when this PR is merged? React with an emoji to vote on the release type:
Current version: Deployment
|
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.
Summary
AccessControlchecks are preserved only for API keysThe Problem
AuthTransport.authorizeToolCall()ran per-tool permission checks for ALL callers, including authenticated users. For MCP OAuth sessions (Claude Code CLI), the org context wasn't properly resolved, causingAccessControlto deny access.The Fix
If the caller has a
user.id(authenticated via browser session or MCP OAuth), just forward the call — the downstream MCP server handles its own auth. Only run granularAccessControlchecks for API keys, where fine-grained permissions are the expected model.Test plan
🤖 Generated with Claude Code
Summary by cubic
Authenticated users are now forwarded directly to downstream MCP servers; per-tool checks only run for API keys. Fixes "Access denied" for Claude Code CLI via MCP OAuth over Mesh.
AccessControlwhen auser.idis present and no API key is used.apiKey.userId.Written for commit 54d330b. Summary will update on new commits.