Claude Code, Codex and OpenCode Find MCP Tools
MCP server tests across Claude Code, Codex, and OpenCode reveal that 99-tool catalogs fail without intent-matched names and strict 5,000-token budgets.
By Dillip Chowdary โข Oct 20, 2026 โข Source: spiritroom.app
Developer Leonid Bugaev published research dissecting how leading coding agents discover and execute tools across Model Context Protocol servers, according to spiritroom.app's report released on 16 October 2026 and updated on 19 October 2026. The technical evaluation tested production read-only workflows across a suite of ninety-nine tools using Claude Code, OpenAI Codex, OpenCode, and Grok Build. Even when an underlying protocol server returned completely accurate data, autonomous agents frequently failed to surface matching endpoints, misread structured responses, or defaulted to expensive multi-step recovery loops during routine execution.
This technical breakdown examines the architectural discovery mechanisms, payload limits, and response design strategies required to make Model Context Protocol tools reliably discoverable to coding models. The analysis is targeted at backend platform architects, agent system developers, and platform engineers deploying autonomous developer agents in production. Readers will discover why raw endpoint availability fails without vocabulary alignment, how client truncation strategies alter prompt visibility across specific client versions, and how structured continuations eliminate costly agent wandering across large data payloads.
What shipped in Claude Code, Codex and OpenCode Find MCP Tools
The benchmark inspection revealed divergent discovery and schema filtering implementations across major agent runtimes interacting with a standard ninety-nine tool deployment. Claude Code version 2.1.301 approached tool selection by initially parsing raw tool names to decide which definitions to fetch into working memory. Meanwhile, Codex version 0.161 operated in code mode, executing custom filtering scripts directly against server metadata. OpenCode demonstrated an architectural shift between releases: legacy OpenCode 1.18.34 ingested all ninety-nine tool definitions simultaneously, whereas OpenCode 2.0.31 launched with a truncated catalog exposing only sixteen tools with descriptions sliced to approximately 120 characters before querying remaining entries.
Grok Build incorporated lexical search via BM25 keyword ranking to surface relevant tools from the broader registry. These client differences mean that server tools cannot rely on standard model reasoning alone to ensure execution. When a platform engineer titles an administrative action with obscure phrasing such as ledger_dispatch, discovery mechanisms across Claude Code, Codex, and OpenCode fail to associate the request with common operational tasks. Renaming that endpoint to invoice_send and providing direct references to bills and invoices immediately aligned with agent search vectors, establishing measurable selection improvements across every evaluated runtime.
What improved in Claude Code, Codex and OpenCode Find MCP Tools
Protocol response handling saw dramatic clarity following concrete before-and-after structural revisions across tool schemas, payload sizes, and continuation hints. A baseline query returning unpaginated records on the production server generated an immense payload of 46,253 tokens, frequently provoking immediate agent refusal, client-side truncation, and prolonged failure recovery paths. By implementing default cursor-based pagination, field filtering, and a design budget capped around 5,000 tokens, tool response footprints dropped substantially while preserving operational context. Explicit error payloads that guide agents toward corrective repair functions replaced uninformative protocol error codes, preventing models from looping or abandoning tasks prematurely.
| Metric or Environment | Baseline Architecture | Optimized MCP Implementation |
|---|---|---|
| Default List Output Size | 46,253 tokens on wire | 5,000 token target budget with cursor pagination |
| OpenCode 2.0.31 Catalog Exposure | 99 tool definitions loaded | 16 initial tools with ~120-character descriptions |
| Claude Code 2.1.301 Representation | Unfiltered definition parsing | Structured content payload in tool result |
| OpenCode 1.18.34 Representation | Ingestion of raw schemas | Text content payload in tool result |
| Codex 0.161 Code Mode | Script output parsing | Filtered script printing to mitigate truncation |

Discovery reliability jumped when tool definitions adopted a front-loaded pattern combining user vocabulary, primary action, and prerequisite constraints into the opening sentence. Replacing generic boilerplate with direct constraints prevents agents from making invalid calls when clients truncate definitions. In testing, descriptions that led with concise requirements allowed OpenCode 2.0.31 to accurately select tools despite its rigid 120-character catalog limit. Furthermore, tests demonstrated that providing clear state markers such as distinguishing saved drafts from sent messages eliminated mistaken agent assumptions regarding workflow completion.
What you gain from Claude Code, Codex and OpenCode Find MCP Tools
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
Adopting structured output patterns and standardized response hints grants autonomous agent workflows immediate stability and reduced token consumption. When tools append explicit next-step instructions alongside compact payload arrays, models bypass ambiguous inference steps and invoke downstream tools with exact parameters. In successful queries, supplying a summary, compact records, and a next cursor such as c_20 tells the model exactly how to request subsequent records using invoice_list without scanning the entire database. This deterministic steering cuts unnecessary reasoning steps and confines context window consumption to required operational data.
Engineering teams also gain resilient failure recovery by transforming raw exception stack traces into actionable repair directions. Providing a structured JSON response containing the specific error, an explanation of missing prerequisites, and an explicit retryable flag allows the agent to call dependent directory tools like groups_list before repeating the original action. Rather than terminating the session or inventing unsupported arguments, the model follows the documented path back to successful execution. These small structural additions convert unpredictable agent behaviors into repeatable, auditable production transactions.
How to get Claude Code, Codex and OpenCode Find MCP Tools
Engineering teams can evaluate and configure their local agent environments using standard vendor installation tools, model switches, and pinned runtime parameters. Updating Claude Code to version 2.1.301 or verifying agent tool discovery behaviors across local projects requires running official package manager commands and terminal flags.
npm install -g @anthropic-ai/claude-code
claude updateTo switch models interactively or specify execution engines during session initialization, developers use standard slash commands and CLI configuration flags without modifying underlying server definitions.
/model claude-fable-5-1
/model fableclaude --model fable
claude config set --global model fableApplying these optimizations within server codebases requires refactoring tool schemas and response serialization logic to accommodate client capabilities. Teams running mixed agent deployments must preserve backward compatibility by maintaining text content alongside structured content representations as specified in the Model Context Protocol. Text-reliant clients such as OpenCode 1.18.34 continue reading serialized text blocks, while modern runtimes like Claude Code 2.1.301 extract structured payloads directly. Inspecting the exact terminal output generated during live test jobs guarantees that optimizations function across every target environment.
What to watch after Claude Code, Codex and OpenCode Find MCP Tools
Deploying optimized tools requires establishing continuous testing suites rather than relying on isolated unit validations or static schema linters. Because models and agent client applications update frequently, tool discovery and execution paths must be verified through realistic end-to-end task simulations. Engineering teams must record realistic user prompts, establish written outcome criteria, and track key execution metrics including discovery success rates, wrong-tool invocations, extraneous execution steps, token expenditure, and overall completion times across all client configurations in production use.
Developers must also closely monitor representation differences between wire transmission sizes and actual tokens billed by model providers. As confirmed in the research update on 19 October 2026, dual serialization across text and structured content fields does not automatically double context costs across all platforms. Teams must analyze real client traces to measure what reaches model context rather than relying on wire capture approximations. Preserving broken execution runs as regression tests ensures that subsequent naming or description adjustments do not silently compromise agent performance elsewhere.
Developer Action Items
- โ Diff the official changelog for OpenAI / Claude / Cursor 2.1.301 before you bump โ APIs, defaults, and removed flags only.
- โ Install through the vendor's documented channel in staging; keep a one-command rollback and time-box the canary.
- โ Grep your repo for old flag names, lockfile pins, and plugin versions that the notes mark as breaking.
- โ Prefer the first patch cut over the day-zero tag unless you have a reason to be on the leading edge.
- โ If HN AI Agents did not name a region, plan, or SKU, screenshot the official availability line before you promise it to users.
Claude Code, Codex and OpenCode Find MCP Tools FAQ
Why do coding agents fail to discover tools on servers with valid schemas?
Agents rely on varied discovery mechanisms such as raw name inspection in Claude Code, metadata filtering scripts in Codex, and BM25 search in Grok Build, which fail when tool names use internal jargon instead of user vocabulary.
How does OpenCode 2.0.31 handle large tool catalogs during initial discovery?
OpenCode 2.0.31 exposes an initial partial catalog containing only sixteen of ninety-nine tools, clipping descriptions to roughly 120 characters before searching for remaining definitions.
What is the recommended token budget for Model Context Protocol tool responses?
Developers should use approximately 5,000 tokens as a starting design budget, implementing default cursor pagination and field filtering to prevent client truncation and agent refusals.
Does sending both text content and structuredContent double context costs?
No, representation checks confirmed that wire size differs from model-visible context, as Claude Code extracts structured content while OpenCode 1.18.34 reads text content.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement