Skip to content

fix(chat): load user MCP servers in Claude chats (parity with CLI) - #580

Merged
arul28 merged 3 commits into
mainfrom
ade/claude-harness-issues-24185a69
Jun 15, 2026
Merged

fix(chat): load user MCP servers in Claude chats (parity with CLI)#580
arul28 merged 3 commits into
mainfrom
ade/claude-harness-issues-24185a69

Conversation

@arul28

@arul28 arul28 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

What

ADE's Work-tab Claude chat (Agent SDK) locked MCP to managed-only
(allowManagedMcpServersOnly: true + empty allowedMcpServers) — a context/perf
trim from #294. That silently stripped the user's configured MCP servers
(~/.claude.json, project .mcp.json) from chats, making the SDK chat strictly
less capable than an ade CLI session for the same task (e.g. iOS
automation / WebDriverAgent, where an Xcode/Appium MCP would be present in the
CLI but absent in the chat).

Why now

ENABLE_TOOL_SEARCH now defers large tool catalogs on demand, so the original
context/perf rationale for the lock no longer outweighs the capability loss.

Change

  • Remove the unconditional managed-only MCP lock in buildClaudeQueryOptions so
    normal chats load the user's MCP servers via settingSources — parity with a
    terminal/CLI claude session.
  • Keep lightweight side-jobs (auto-title / lane-naming) lean via strictMcpConfig
    (they have no settingSources, and the SDK loads all MCP sources when
    unconstrained — this preserves their pre-change behavior).
  • Orchestration sessions are unchanged — they re-apply managed-only isolation
    in their own block.

Tests

  • Updated the test that pinned the old lock → now asserts managedSettings
    undefined + project setting source enabled (user MCP loadable).
  • Added a regression test: lightweight session → strictMcpConfig: true.
  • Full agentChatService.test.ts green (425 tests); typecheck clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Corrected MCP server configuration handling for chat sessions; lightweight sessions now properly ignore on-disk configurations while standard sessions maintain expected setting sources.

Greptile Summary

This PR removes the blanket managed-only MCP lock (allowManagedMcpServersOnly: true + empty allowedMcpServers) that was previously applied to every Claude chat session, restoring parity between SDK chats and terminal claude sessions for user-configured MCP servers. The rationale (context/perf savings) is superseded by ENABLE_TOOL_SEARCH.

  • Normal chats now load ~/.claude.json and project .mcp.json servers via settingSources; managedSettings is no longer injected at the base level.
  • Lightweight sessions (auto-title / lane-naming) and orchestration lead sessions (read-only planners) receive strictMcpConfig: true to keep them from spawning the user's full MCP fleet; bundled leads additionally retain the orchestration block's allowManagedMcpServersOnly constraint.
  • Test suite is updated with symmetric assertions: normal chats assert strictMcpConfig is absent; lightweight and lead sessions assert it is present.

Confidence Score: 5/5

Safe to merge — the change is well-scoped and all three session categories (normal, lightweight, orchestration lead) are correctly handled with matching test coverage.

The removed managed-only lock is cleanly replaced by a targeted strictMcpConfig spread that only fires for lightweight and orchestration-lead sessions. Normal chats regain user MCP access through settingSources, which is the intended parity. Bundled orchestration leads still receive the existing allowManagedMcpServersOnly guard from the orchestration block. The symmetry is verified by new regression tests in both directions.

No files require special attention.

Important Files Changed

Filename Overview
apps/desktop/src/main/services/chat/agentChatService.ts Removes the unconditional managed-only MCP lock from buildClaudeQueryOptions; replaces it with a conditional strictMcpConfig: true spread for lightweight sessions and orchestration-lead sessions, while normal chats now load user/project MCP servers via settingSources.
apps/desktop/src/main/services/chat/agentChatService.test.ts Updates the existing MCP-lock test to verify the lock is gone and strictMcpConfig is absent in normal chats; adds regression tests for lightweight sessions (strictMcpConfig: true) and read-only orchestration leads (strictMcpConfig: true).

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[buildClaudeQueryOptions] --> B{isLightweightSession?}
    B -- Yes --> C[strictMcpConfig: true\nno settingSources]
    B -- No --> D{isOrchestrationLeadSession?}
    D -- Yes --> E[strictMcpConfig: true\nsettingSources: user/project/local\ndisallowedTools applied]
    D -- No --> F[Normal chat\nsettingSources: user/project/local\nuser MCP servers load]
    E --> G{orchestrationMcpServer exists?}
    F --> G
    G -- Yes --> H[managedSettings:\nallowManagedMcpServersOnly: true\nallowedMcpServers: orch-server only]
    G -- No --> I[no managedSettings\nstrictMcpConfig alone guards leads]
Loading

Reviews (3): Last reviewed commit: "ship: iter 2 — isolate MCP for orchestra..." | Re-trigger Greptile

ADE's Work-tab Claude chat (Agent SDK) locked MCP to managed-only
(allowManagedMcpServersOnly + empty allowlist) — a context/perf trim from
#294 that silently stripped the user's configured MCP servers
(~/.claude.json, project .mcp.json) from chats, making the SDK chat
strictly less capable than an `ade` CLI session for the same task (e.g.
iOS automation / WebDriverAgent). ENABLE_TOOL_SEARCH now keeps large tool
catalogs cheap, so the trim is no longer worth the capability loss.

- Remove the unconditional lock so normal chats load user MCP via settingSources.
- Keep lightweight side-jobs (auto-title / lane-naming) lean via strictMcpConfig.
- Orchestration sessions keep managed-only isolation in their own block.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Jun 15, 2026 4:22pm

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@arul28, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 22 minutes and 18 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f7987507-4021-4cc3-84d3-0c24accd9a31

📥 Commits

Reviewing files that changed from the base of the PR and between e9e04e2 and cde738a.

📒 Files selected for processing (2)
  • apps/desktop/src/main/services/chat/agentChatService.test.ts
  • apps/desktop/src/main/services/chat/agentChatService.ts
📝 Walkthrough

Walkthrough

agentChatService.ts removes the unconditional managed-only MCP server isolation (managedSettings with allowManagedMcpServersOnly: true) and replaces it with a conditional that sets strictMcpConfig: true only for lightweight sessions. Normal sessions now load user/project MCP servers. Tests are updated to assert both behaviors.

Changes

MCP Session Configuration Rework

Layer / File(s) Summary
Conditional strictMcpConfig in agentChatService
apps/desktop/src/main/services/chat/agentChatService.ts
Removes the managedSettings block that enforced allowManagedMcpServersOnly: true with an empty allowedMcpServers. Adds a conditional that sets strictMcpConfig: true only when lightweight is true; non-lightweight sessions receive no MCP isolation.
Updated and new MCP session tests
apps/desktop/src/main/services/chat/agentChatService.test.ts
Renames the normal-chat test to reflect the removed managed-only lock and updates assertions to expect settingSources includes "project", mcpServers absent, and managedSettings undefined. Adds a lightweight-session test that writes a .mcp.json to disk and asserts strictMcpConfig: true with settingSources and managedSettings both undefined.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

desktop

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: enabling user MCP servers in Claude chats to achieve CLI parity, which aligns with the core objective of removing the managed-only MCP lock.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/claude-harness-issues-24185a69

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arul28 arul28 changed the title Claude Harness Issues fix(chat): load user MCP servers in Claude chats (parity with CLI) Jun 15, 2026
@arul28

arul28 commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

Comment thread apps/desktop/src/main/services/chat/agentChatService.test.ts
@mintlify

mintlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ade-ac1c6011 🟢 Ready View Preview Jun 15, 2026, 3:48 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Assert strictMcpConfig is absent in the normal-chat test, guarding against
it leaking into non-lightweight sessions (which would silently re-block the
user's MCP servers). Mirrors the lightweight test's positive assertion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arul28

arul28 commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f720f7ed99

ℹ️ 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".

Comment thread apps/desktop/src/main/services/chat/agentChatService.ts Outdated
Removing the base MCP lock let draft / role-marked orchestration leads
(no bundle yet → orchestration MCP block skipped) load user/project MCP
servers, which could restore tool capability the read-only lead is denied
via disallowedTools. Apply strictMcpConfig whenever isOrchestrationLeadSession
is true, not only when the orchestration MCP server exists. strictMcpConfig
still permits the programmatic orchestration server for bundled leads.
Workers/validators do real work and keep user MCP.

Regression tests: draft-lead and role-marked-lead now assert strictMcpConfig.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arul28

arul28 commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: cde738afa9

ℹ️ 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".

@arul28
arul28 merged commit 9b79c48 into main Jun 15, 2026
5 checks passed
@arul28
arul28 deleted the ade/claude-harness-issues-24185a69 branch June 15, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant