Repository navigation
feat: improve MCP operator workflows - #88467
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 6:51 PM ET / 22:51 UTC. Summary PR surface: Source +1197, Tests +694, Docs +65. Total +1956 across 28 files. Reproducibility: not applicable. as a bug reproduction: this is a new MCP operator workflow feature rather than a report of broken existing behavior. The PR body provides focused test and Crabbox live E2E proof for the intended paths. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Review and explicitly accept the new MCP operator contract, then land it with the included docs, tests, and Crabbox proof if maintainers agree this should be core behavior. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this is a new MCP operator workflow feature rather than a report of broken existing behavior. The PR body provides focused test and Crabbox live E2E proof for the intended paths. Is this the best way to solve the issue? Yes, if maintainers want this in core: the implementation keeps MCP management in the existing CLI/config/runtime paths and adds docs plus focused coverage. The remaining decision is whether the broad persisted operator surface is the desired stable contract. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against d05e4a4bc6f2. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1197, Tests +694, Docs +65. Total +1956 across 28 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b86c491825
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (nextResolved?.kind === "http" && nextResolved.url === previousResolved.url) { | ||
| return; |
There was a problem hiding this comment.
Clear stale OAuth cache when metadata changes
When an OAuth MCP server is replaced or reconfigured with the same URL but different oauth.clientMetadataUrl, redirect URL, or scope, this early return keeps the old mcp-oauth store. The MCP SDK auth flow loads cached clientInformation before consulting clientMetadataUrl or dynamic registration, so future openclaw mcp login and runtime auth can continue using the previous client registration/token despite the new OAuth settings. Include the OAuth metadata in the staleness check, or clear credentials on any OAuth config change.
Useful? React with 👍 / 👎.
Summary
Verification
Behavior addressed: MCP operators can manage configured servers, tune runtime behavior, authorize OAuth-backed HTTP servers, clear stored OAuth credentials, and project the same config into agent runtimes safely.
Real environment tested: local focused tests/typecheck; Crabbox AWS Linux for live MCP server E2E and changed-gate proof.
Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/agents/mcp-oauth.test.ts src/agents/mcp-http-fetch.test.ts src/agents/mcp-transport.test.ts src/cli/mcp-cli.test.tsnode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfogit diff --check.agents/skills/autoreview/scripts/autoreview --mode localrun_4d0ac1a4b74brun_3925ad1a00a5withgit fetch origin main --deepen=100000 || git fetch origin main --depth=100000; pnpm check:changedEvidence after fix: autoreview clean; focused tests passed; core typecheck passed;
run_3925ad1a00a5exited 0; live E2E run exercised add/probe/filter/disable/enable/timeout/parallel/OAuth config/reload flows against real MCP servers.Observed result after fix: configured MCP servers honor operator controls in runtime and CLI flows, OAuth credentials are scoped and cleaned on auth clear/unset/replacement, and HTTP TLS/header behavior stays scoped to the MCP resource origin.
What was not tested: full browser-based third-party OAuth callback with a real provider; the SDK-backed login/exchange and local credential lifecycle are covered by unit/transport tests.