Skip to content

fix(server): pass mcpServers and plugins to Claude Agent SDK#1336

Closed
AssahBismarkabah wants to merge 2 commits intopingdotgg:mainfrom
AssahBismarkabah:fix/1271-pass-mcp-servers-to-claude-sdk
Closed

fix(server): pass mcpServers and plugins to Claude Agent SDK#1336
AssahBismarkabah wants to merge 2 commits intopingdotgg:mainfrom
AssahBismarkabah:fix/1271-pass-mcp-servers-to-claude-sdk

Conversation

@AssahBismarkabah
Copy link

@AssahBismarkabah AssahBismarkabah commented Mar 23, 2026

What Changed

The Claude adapter now forwards mcpServers and plugins from provider options to the SDK's query() call. Previously these were missing from queryOptions, so every Claude Agent session started with empty mcp_servers and plugins regardless of what the caller passed in.

Changes:

  • Extended ClaudeProviderStartOptions with optional mcpServers and
    plugins fields (packages/contracts/src/orchestration.ts)
  • Conditionally assign both to queryOptions when present
    (apps/server/src/provider/Layers/ClaudeAdapter.ts)
  • Added three tests covering forwarding and omission
    (apps/server/src/provider/Layers/ClaudeAdapter.test.ts)

Follows the same pattern as the existing binaryPath, permissionMode, and maxThinkingTokens passthrough.

Why

Fixes #1271

The SDK supports mcpServers and plugins in its Options type but makeClaudeAdapter never wires them through. This means MCP tools are completely unavailable when using the Claude Agent provider, even if the caller includes them in providerOptions.

Note: this unblocks MCP support on the adapter side. The web UI does not currently populate these fields that can be addressed separately once the team decides how MCP configuration should surface (settings UI, filesystem loading via settingSources, etc.).

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A — no UI changes
  • N/A — no animation changes

Note

Pass mcpServers and plugins from provider options to Claude Agent SDK query options

  • Adds two optional fields, mcpServers and plugins, to the ClaudeProviderStartOptions schema in orchestration.ts.
  • The startSession handler in ClaudeAdapter.ts now conditionally forwards these fields into the query options when present.
  • New tests in ClaudeAdapter.test.ts cover forwarding each field and omitting both when not provided.

Macroscope summarized 0677433.

@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 23, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9147e71b-6052-4bf4-8c23-733f1c9e35ac

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@juliusmarminge
Copy link
Member

#1334

@AssahBismarkabah
Copy link
Author

Got it @juliusmarminge Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Agent provider does not pass MCP servers or plugins to the SDK

2 participants