Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
@mcp-use/agent
@mcp-use/cli
@mcp-use/client
create-mcp-use-app
@mcp-use/inspector
mcp-use
@mcp-use/tunnel
commit: |
tonxxd
force-pushed
the
fix/inspector-hosted-oauth-state
branch
from
September 4, 2026 13:12
0500440 to
e3a5e07
Compare
Contributor
There was a problem hiding this comment.
All reported issues were addressed
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
tonxxd
force-pushed
the
fix/inspector-hosted-oauth-state
branch
2 times, most recently
from
September 4, 2026 13:45
3669290 to
20aae4c
Compare
tonxxd
force-pushed
the
fix/inspector-hosted-oauth-state
branch
from
September 4, 2026 14:08
20aae4c to
f5f051c
Compare
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
Supersedes #2357 with a current-
mainimplementation of the Inspector hosted OAuth/state foundation and the relay security boundary.This keeps the existing self-hosted CLI behavior while making hosted deployment choices explicit:
disabled,memory, and encryptedredisOAuth state-store modes.connect+PINGreadiness, reconnect-safe lazy readiness, a dedicated CAS connection, serialized local WATCH transactions, cross-replica conflict handling, and bounded graceful shutdown.updatedAthandling and atomicsetIfNewersemantics so stale durable state cannot overwrite fresher local state.client_secret_expires_at: 0is represented as no expiry.authorizationServersinstead of widening scope.client_secreton malformed, primitive, array, or otherwise browser-visible responses.DPoP.Authorizationremains a separate header and is forwarded only to the upstream request./inspector/healthactively probes the configured state store (including RedisPING) and returns 503 when it is unavailable; health timeouts are bounded and cleaned up.logPrefixand development API architecture are preserved.Hosted Cloud contract / rollout boundary
This SDK intentionally does not invent browser authentication. Exact CORS is not authentication, and a static relay bearer token would require exposing a shared secret to every browser. Hosted Cloud/edge must provide:
authenticate(c, target)callback to the mounted relay routes (ormountInspector) that verifies a short-lived, user/session- and target-bound signed capability. The verifier should bind the capability to the target origin/path, HTTP method, expiry, and replay policy; false returns 401. The upstreamAuthorizationheader must remain independent. Redirect destinations are re-authenticated before their upstream fetch.oauthProxyAllowedOriginsandmcpProxyAllowedOriginscontaining exact trusted origins. Do not omit them or use a wildcard in hosted production.INSPECTOR_OAUTH_STATE_STORE=redis,INSPECTOR_OAUTH_REDIS_URL(orREDIS_URL), a base64-encoded 32-byteINSPECTOR_OAUTH_ENCRYPTION_KEY, and an environment-specific key prefix. Optional key ID and previous-key JSON support rotation without exposing key material.The callback is invoked as
(c, target), while existing one-argumentcallbacks remain source-compatible.
targetis{ origin, pathname, method }for a valid requested upstream target (query, fragment, and credentials are
omitted), or
undefinedfor malformed/missing input. Hosted verifiers shouldbind the short-lived capability to this target context without cloning or
parsing the OAuth relay body. Browsers send that capability in the distinct
X-Inspector-Relay-Tokenheader; both relay preflights allow it, and bothrelays strip it before upstream forwarding. Upstream
Authorizationremainsindependent.
Cloud should gate readiness on
/inspector/healthand wait for Redis readiness. This PR does not claim that currently deployed public aliases are cut over: existing hosted services remain a separate image/configuration concern until Cloud supplies the auth, exact-origin, Redis, and distributed-limiter configuration.The default-off consumer is mcp-use-cloud PR #1651. Keep #1651 disabled until this package is released and deployed, and until its capability-auth, exact-origin, Redis/readiness, distributed-rate-limit, and live runtime gates all pass.
PR #2260 was not cherry-picked: it targets
canaryand is DIRTY. Its safe target-key behavior is represented here without importing its unrelated state.Verification
Run from
libraries/typescript:Results:
redis:7-alpine,INSPECTOR_REDIS_TEST_URL=... pnpm --filter @mcp-use/inspector exec vitest run tests/unit/oauth-state-store-redis.test.tspassed the live encrypted round-trip, wrong/rotated-key, cross-store CAS, delete, and close checks.initial-readyfollowed byreconnected-readyfrom the same store process./inspector/healthsuccessfully and shut down cleanly on SIGINT.git diff --checkpassed.Residual risks
setIfNeweruse a compatibility get/set fallback and are not cross-process atomic. Production hosted deployments should use the bundled Redis store or provide an atomic implementation.