Repository navigation
Description
Summary
A plugin MCP server with a large tool count (95 tools) shows as connected in the native /mcp status view (run via an interactive claude CLI terminal), but its tools are never callable from a chat session driven by t3code's GUI backend. ToolSearch/the deferred-tool index never contains any of that server's tools for the life of the session, even after the server is confirmed connected. Smaller plugin servers on the same account (2, 13, 32, 47 tools) work fine from the same GUI session.
Environment
- t3code desktop, chat session backed by
apps/server/src/provider/Layers/ClaudeAdapter.ts @anthropic-ai/claude-agent-sdkpinned at0.3.170inpnpm-lock.yaml(current upstream is0.3.224)- Comparison terminal: native
claudeCLI v2.1.224, run interactively, same machine, same~/.claude.jsonconfig
Steps to reproduce
- Configure a plugin MCP server with a large tool surface (in my case ~95 tools) alongside several smaller plugin servers (2/13/32/47 tools).
- Open the native
claudeCLI in a terminal and run/mcp. All servers, including the large one, show✓ connected · N tools. Calling the large server's tools works (e.g. a skill built on top of it resolves and executes correctly). - Open a chat session through the t3code GUI (same config, same working directory) and ask the agent to use a tool from the large server.
- The agent can invoke the skill associated with that server (skill instructions load fine), but cannot find or call any of the server's underlying MCP tools —
ToolSearchwith the exact tool name, exact composite server name (plugin:<name>:<name>), and broad keyword queries all return "No matching deferred tools found." - Meanwhile the GUI's own
/mcppanel (apparently rendered by a separate native CLI/terminal path, not the chat backend) correctly shows the server asconnected · 95 tools. - The smaller plugin servers' tools are discoverable via
ToolSearchin the same chat session throughout.
Root cause (from reading apps/server/src/provider/Layers/ClaudeAdapter.ts)
The chat backend calls the SDK's createQuery() once per session (around the queryOptions construction near line 4093). Per the SDK changelog:
Breaking: MCP servers now connect in the background by default; sessions start immediately and slow servers report
status: "pending"ininituntil ready. SetMCP_CONNECTION_NONBLOCKING=0to restore the old behavior of waiting up to 5s before the first query, or mark a serveralwaysLoad: trueto require it in turn 1.
ClaudeAdapter.ts does not set MCP_CONNECTION_NONBLOCKING anywhere in the environment it builds (claudeEnvironment), and does not mark any server alwaysLoad: true. So the SDK's default non-blocking-connect behavior applies: the session's initial tool manifest is built from whatever's ready at that instant, and a slower-to-connect server (plausibly correlated with a much larger tool count / heavier handshake) can miss the window and get excluded.
Compounding this: apps/server/src never calls the SDK's reloadPlugins(), toggleMcpServer(), or mcpServerStatus() methods anywhere (confirmed via repo-wide grep). So even after the slow server finishes connecting, nothing re-syncs the session's tool manifest — the omission is permanent for the life of the session, not just a startup race that resolves itself.
This would explain the exact symptom: the server is genuinely connected (hence /mcp reporting it correctly, and the interactive CLI terminal working fine since it doesn't have this turn-1 manifest freeze), but the chat backend's one-shot createQuery() session never learns about tools that weren't ready in time.
Suggested fix
In apps/server/src/provider/Layers/ClaudeAdapter.ts:
- Set
MCP_CONNECTION_NONBLOCKING=0in theclaudeEnvironmentpassed tocreateQuery()so the SDK waits (up to 5s) for MCP servers to connect before turn 1, and/or mark heavier plugin serversalwaysLoad: trueif that's exposed per-server. - After session start, call
reloadPlugins()(or equivalent) once outstanding servers finish connecting, so long-running sessions pick up tools from servers that missed the initial window instead of never seeing them. - Consider bumping the pinned
@anthropic-ai/claude-agent-sdkdependency from0.3.170to latest (0.3.224) — several MCP-related fixes have landed since (e.g. server-added-at-runtime tool injection, background-plugin-install disconnect handling) that may be relevant even if not a direct fix for this issue.
Impact
Any user with a plugin MCP server large/slow enough to miss the initial connect window loses access to that server's tools for the entire chat session in the GUI, with no visible error — the server just silently never gets referenced in tool discovery, while the status UI reports it as healthy. This is confusing to debug because every visible signal (/mcp, skill loading) says the server is fine.
Activity
maria-rcks commentedon Oct 9, 2026
Note
This is an automated response from a bot acting on maria's behalf.
This issue has had no activity since 2026-08-07.
Is it still relevant on the current version? If so, your version and OS would help.
juliusmarminge commentedon Oct 27, 2026
I couldn't reproduce this on current
main(71ba6b374c, Claude Agent SDK 0.3.276), and the mechanism described in the issue doesn't show up in my runs.Setup. A synthetic stdio MCP server with 95 tools that waits 10 s before answering
initialize, so it is stillpendingwhen the session starts. I loaded it two ways: as a plugin (plugin:slowplug:slowplug) and as a project.mcp.jsonserver.What I ran
mcp__slow__slow_echoand the 94 other tools, calls it, and getsSLOW-ECHO hi.ToolSearchreturns "No matching deferred tools found. Some MCP servers are still connecting: slow … try searching again". The retry in the same turn returnsmcp__slow__slow_echo, and the call works.query()directly, with T3's settings sources, using the plugin variant with ToolSearch on. I ran this against Claude Code 2.1.303 and against 2.1.224, the version you reported. In both, turn 1'sinitreports the server aspending. Turn 2'sinitreports itconnectedwith all 95 tools, andToolSearch("slow_echo")finds the tool and calls it.So a server that is slow to connect does get picked up later in the same session. Its tools are not left out for the whole session. Note that T3 runs the
claudebinary from your PATH (or the one set in Settings → Providers → Claude), so that version decides how MCP connections behave, not the SDK version in the lockfile.To dig further, could you share:
claude --versionfor the binary T3 uses. Does it still happen on current versions?claude mcp listorclaude --debugshow this.ToolSearchsays in an affected T3 thread on a second or later message. Does it report the server as "still connecting", or say nothing? Also check whether the server process is running under the T3-launchedclaudeat all (e.g.ps -ef | grep <server command>). A desktop app started outside a shell can have a differentPATHor environment than your terminal, and that can stop a plugin server from starting there even though it connects in the terminal.ahmedisam99 commentedon Nov 2, 2026
Another case of this, with a variant your repro on
maindidn't cover: acontext: forkskill sent as the first message of a new thread. In that case a ToolSearch retry doesn't help.What happened
A project skill (
context: fork,agent: general-purpose) depends on the official Atlassian plugin (plugin:atlassian:atlassian, HTTP,https://mcp.atlassian.com/v2/mcp). It runs/backend-gaps <jira link>as the first message of a new Claude thread. The forked subagent never sees anymcp__plugin_atlassian_atlassian__*tools.claude mcp listfrom the same project directory shows the server✔ Connected.Diagnosis
query.opencomes at 07:57:34.902Z. The fork'stask_startedcomes at 07:57:34.930Z, 28 ms later, before MCP servers have connected.atlassianis not on that list.select:names,+atlassian getJiraIssueand several keyword searches. Every result is empty or comes from other servers. The subagent's tool pool seems to be fixed at spawn and never gains the late server, unlike the main thread's retry behaviour you showed above.atlassian:*skills appear incommands_changed.Repro steps
claude mcp listshows it Connected.context: forkwhose instructions load Atlassian tools through ToolSearch./<skill> …as the first message. The subagent reports that the Atlassian tools are unavailable.hifirst, wait for the reply, then run the same skill. The subagent callsgetJiraIssue,executeReadandgetConfluenceContentwithout problems. The same skill also works in a terminalclaudesession, where it ran about 2.5 min after startup.Workaround (verified)
Add
MCP_CONNECTION_NONBLOCKING=0to the Claude provider instance's environment (Settings → Providers). With it, the same first-message run works. The fork again starts 32 ms afterquery.open, but the subagent gets the Atlassian tools, and no ToolSearch result says "still connecting".Environment
claudeon PATH)ANTHROPIC_BASE_URL(local gateway),ENABLE_TOOL_SEARCH=true,ENABLE_CLAUDEAI_MCP_SERVERS=falseGiven #25959 ("not making the first message wait for MCP servers"), the subagent part may belong upstream in Claude Code. A forked skill or subagent probably shouldn't freeze its tool list before pending MCP servers connect. A narrower T3 option would be to wait for MCP readiness only when the first message is a slash command for a forked skill, or to document the env var for users who depend on forked skills.
Triaged with
t3 triageby Claude Code (Claude Opus 5.5).