Skip to content

Show configured project MCP servers before the first Claude chat message - #50062

Closed
hishikit wants to merge 1 commit into
stablyai:mainfrom
hishikit:codex/claude-project-mcp-list-before-first-message
Closed

hishikit wants to merge 1 commit into
stablyai:mainfrom
hishikit:codex/claude-project-mcp-list-before-first-message

Conversation

@hishikit

@hishikit hishikit commented Nov 26, 2026 •

Copy link
Copy Markdown

ELI5

Open /mcp in a new Claude Chat and you can see which servers the project declares before you send a message. Each name starts with a “Not started” label. Once Claude connects, the panel shows what Claude reports for that session.

What Changed

When Claude has no active connection and the panel requests its status, the session host looks for a regular .mcp.json file in the chat's launch directory. It uses the existing bounded config reader and inspector and returns valid server names as project rows. Authentication, reconnect and toggle controls are available only when the live provider advertises them. If there are no usable declarations, the panel keeps its existing first-message hint.

On desktop, choosing /mcp while the host is still creating the chat records the open request and displays the panel as soon as the existing session-ready signal arrives. Previously the panel could ask for the list before the host had a record for that chat, then keep showing an “Update Orca” hint until the user opened it again.

Why

Seeing a name answers a question the user can ask before a conversation exists: did Orca find my project server? Starting a Claude turn to answer that question would also start the session. The Codex provider already surfaces configured servers before a turn in #44673.

Linked Issue

Partially addresses #46441, item 1. This implements discovery of project server names before the first message in Claude Chat. Pre-send connection checks and the mode picker remain open.

Visual Proof

The top capture is the current Windows release (1.4.277), opened on the same project in a fresh chat after selecting /mcp. Its hint says that servers connect when you send the next message. The middle and bottom captures show the patched Windows build, before and after its first message. The panel stayed open. All captures are at 1:1 scale.

windows-comparison

Testing

Windows 11, using a local test repository with one stdio server named orca-probe and a single tool named ping.

  1. Open a new Claude Chat and select /mcp before sending anything.
  2. Look under Project for orca-probe with status Not started. The message history is empty.
  3. Leave the panel open, send a short message, and check the project row once Claude connects.

The first selection worked in three fresh chats, including the first chat after a cold start. In one of them, Claude replied OK. The same open panel went from Project / orca-probe / Not started with zero messages to Project / orca-probe / 1 tool with two messages and one connected server. Claude discovered the fixture from the project's own .mcp.json.

Twelve focused host checks passed on the submitted source. Ten covered the idle path, including missing or malformed config, multiple names, exclusion of config values from the response, and read-only behavior. Two used a stub provider to check that live inventory replaces the preview even when that inventory is empty. The existing panel and parser are reused, so the Windows interaction was exercised through the real app rather than adding a component test.

All 40 checks selected by Orca's check:changed passed on Windows against base bb6f08b9de17, including 7 affected unit tests across 4 files and all 4 selected TypeScript projects.

Performance

A status request with no active Claude connection can read one file, capped at 256 KiB. The inspector also limits the number of declarations to 256. The preview uses no polling, provider process or network request. The existing live status path handles running sessions.

Risk

Low. A declaration may be visible before Claude applies the user's approval or managed policy. The preview labels it “Not started” and offers no connection controls. Missing, invalid, oversized and symlinked files fall back to the existing hint. The change only reads project settings and can be reverted in one commit.

AI Disclosure

OpenAI Codex (GPT-6 family) helped reproduce the issue on Windows, implement and review the patch, run checks and prepare this description. Claude Code was the provider under test. Claude Code (Claude Opus 5.5) applied the patch on a second Windows machine, confirmed the identical Git tree and a clean merge with the current main, and opened this pull request.

Review

The host-side change is specific to Claude. The desktop panel also observes the shared session-ready signal for all providers. The existing desktop and mobile row format carries the name, source and status. Connection details, commands, URLs and environment variables stay out of the preview response. The host resolves its own workspace using the existing execution-location guard and platform path library. Windows desktop was exercised directly. macOS, Linux, mobile and SSH were reviewed in code only.

Agent skill upstream boundary

  • Not applicable.

Notes

The preview covers the project file directly in the chat's launch directory. The live session supplies the effective inventory, including user-level and managed servers.

Checklist

  • One user-facing improvement, scoped to Claude's project server list.
  • User-facing change, implementation, risk and performance described above.
  • Reviewed platform, host boundaries and compatibility.
  • Before/after images attached in the PR editor.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When the Claude session is unavailable, the status operation can now report project MCP servers read from the workspace configuration. The runtime passes workspace-path resolution into the session adapter. The MCP tray stays hidden while the transport session is pending. The workspace MCP config candidate is now exported.

Merge Risk: Minimal · up to 87c3a

Claude Chat now shows declared project MCP servers as "Not started" before the first message and switches to live status once the session connects. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: configured project MCP servers become visible in Claude Chat before the first message. It matches the summarized changes, which add a preview read of the project .mcp.…
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.
Description check Passed The description is detailed and covers most template sections: ELI5, What Changed, Why, Linked Issue (partial, referencing #46441 item 1), Visual Proof (before/after Windows captures), Testing (manual…
Full details: Title check

Explanation

The title names the main change: configured project MCP servers become visible in Claude Chat before the first message. It matches the summarized changes, which add a preview read of the project .mcp.json when no Claude connection is active. The title is concise and specific.

Full details: Description check

Explanation

The description is detailed and covers most template sections: ELI5, What Changed, Why, Linked Issue (partial, referencing #46441 item 1), Visual Proof (before/after Windows captures), Testing (manual Windows steps and automated check results), Performance, Risk (Low, with revert path), AI Disclosure, Review, Agent skill boundary (checked N/A), Notes, and Checklist. The Linked Issue section uses 'Partially addresses' rather than 'Fixes #', which is acceptable because the author states the PR only partly resolves the issue. The Performance section is written as a reasoned paragraph rather than the single-sentence 'None, because...' form, but it still explains the trade-off. The Risk section names the riskiest behavior (declarations visible before approval or managed policy) and the revert path. Minor gaps: the Testing checklist boxes are not ticked, the Risk level is given as 'Low' in prose rather than the template's Level field format, and the Visual Proof images are described as attached in the PR editor, so their presence cannot be verified from the text alone. The Linked Issue section is marked partial, and the template asks for an actual linked issue for outside contributors, which this PR appears to have.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 968c0445-06c2-403e-8366-286b45457083
Commits

Reviewing files that changed from the base of the PR and between dff9da6 and 87c3a30.

Files selected for processing: 7

  • src/main/claude/structured/claude-structured-session-adapter.ts
  • src/main/claude/structured/claude-structured-session-state.ts
  • src/main/claude/structured/lifecycle/claude-project-mcp-servers.ts
  • src/main/claude/structured/lifecycle/claude-structured-mcp.ts
  • src/main/runtime/agent-session/installation/structured-claude-runtime-adapter.ts
  • src/renderer/src/components/native-chat/pane/actions/NativeChatStructuredComposerTabStrips.tsx
  • src/shared/mcp/configuration/mcp-config.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

Thank you @hishikit, this was a great catch and a really clear write-up. Seeing a chat's servers before the first message is exactly what we wanted, and your Windows walkthrough made the gap easy to see.

We've landed it in #50908, built on Orca's own MCP server resolver so Claude, Codex and the other chat agents all list their servers before the first message, on desktop and phone. Your renderer fix (waiting for the host to create the chat before the tray asks) is in there as is, and the PR credits you.

Closing this one in favour of #50908. Thanks again for digging into it!

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.

2 participants