Summary
Resolved in fb5185f — MCP tool name prefixes were misaligned between what subagents were instructed to call and what was actually registered at runtime.
Background
With SCOPED_MCP_SERVERS=false (production default), all 147 tools are registered under a single monolithic MCP server as mcp__super-legal-tools__<tool>. However, MCP_FALLBACK_INSTRUCTIONS (injected into 20 research agents) taught agents to construct tool names as mcp__<domain>__<tool> — names that only exist when SCOPED_MCP_SERVERS=true.
Impact: Agents called nonexistent tools, silently failed, then fell back to raw WebFetch — bypassing the hybrid client's automatic Exa fallback. The securities-researcher hung for 57 minutes because SEC's aggressive 403-blocking made this failure mode visible; other agents survived only because their WebSearch targets don't block scrapers.
Fix Applied (v3.7.2, commit fb5185f)
| Change |
File |
Effect |
mcpToolRef(domain, tool) utility |
domainMcpServers.js |
Single source of truth for MCP tool name prefix |
MCP_PREFIX_INSTRUCTION flag-aware const |
_promptConstants.js |
Fixes prefix for all 20 research agents |
| Same for legacy path |
legalSubagents.js |
Correctness for MODULAR_SUBAGENTS=false |
10 mcpToolRef() replacements |
citation-websearch-verifier.js |
Replaces hardcoded mcp__courtlistener__ / mcp__sec__ |
1 mcpToolRef() replacement |
risk-aggregator.js |
Fixes inverse hardcoded mcp__super-legal-tools__ |
isError on success===false |
agentSdkToolAdapter.js |
Surfaces code-exec failures to hooks/server |
Ongoing Tracking
Hardening items
Related issues
Verification commands
# Domain MCP server unit tests (28 tests)
node --experimental-vm-modules node_modules/.bin/jest test/sdk/domain-mcp-servers.test.js
# Verify prefix resolves correctly
node -e "import('./src/config/legalSubagents/_promptConstants.js').then(m => {
const line = m.MCP_FALLBACK_INSTRUCTIONS.split('\n').find(l => l.includes('prefixed'));
console.log(line);
})"
# Live SEC diagnostic suite (8 tests, requires EXA_API_KEY)
node test/sdk/_live-sec-diagnostic-test.mjs
Labels
bug, mcp, subagents, resolved
Summary
Resolved in
fb5185f— MCP tool name prefixes were misaligned between what subagents were instructed to call and what was actually registered at runtime.Background
With
SCOPED_MCP_SERVERS=false(production default), all 147 tools are registered under a single monolithic MCP server asmcp__super-legal-tools__<tool>. However,MCP_FALLBACK_INSTRUCTIONS(injected into 20 research agents) taught agents to construct tool names asmcp__<domain>__<tool>— names that only exist whenSCOPED_MCP_SERVERS=true.Impact: Agents called nonexistent tools, silently failed, then fell back to raw
WebFetch— bypassing the hybrid client's automatic Exa fallback. Thesecurities-researcherhung for 57 minutes because SEC's aggressive 403-blocking made this failure mode visible; other agents survived only because their WebSearch targets don't block scrapers.Fix Applied (v3.7.2, commit fb5185f)
mcpToolRef(domain, tool)utilitydomainMcpServers.jsMCP_PREFIX_INSTRUCTIONflag-aware const_promptConstants.jslegalSubagents.jsMODULAR_SUBAGENTS=falsemcpToolRef()replacementscitation-websearch-verifier.jsmcp__courtlistener__/mcp__sec__mcpToolRef()replacementrisk-aggregator.jsmcp__super-legal-tools__isErroronsuccess===falseagentSdkToolAdapter.jsOngoing Tracking
Hardening items
.jsfile insrc/config/legalSubagents/contains a hardcodedmcp__<domain>__ormcp__super-legal-tools__string literal outside of comments,mcpToolRef(), orMCP_PREFIX_INSTRUCTION. Prevents future regressions.PreToolUsehook check or MCP-level guard that logs a WARNING when the requested tool name isn't in the registered set.MCP_FALLBACK_INSTRUCTIONSat runtime, and asserts the prefix instruction matches the actual MCP server name (monolithic or scoped depending on flag).Related issues
defer_loadingfor Agent SDK (blocked on upstream)maxThinkingTokensbreaks hooks (blocked on upstream)Verification commands
Labels
bug,mcp,subagents,resolved