Skip to content
BENIBIX Learn

MAX_MCP_OUTPUT_TOKENS

AI⌨️ Claude CodeConfiguration

Also known as MAX_MCP_OUTPUT_TOKENS environment variable

It sets how big an MCP tool's answer may be.

Think of it like

It is like a voice note. It can only be so long.

Example

Jack's database server returns big query results that get cut off. He raises the limit, and Claude sees the whole table.

Why it matters

A tool that returns too much can fill the chat in one call. This keeps that in check.

Definition

MAX_MCP_OUTPUT_TOKENS sets how many tokens an MCP tool's answer may hold. The default is 25,000, and Claude Code warns once an answer goes over 10,000. A text answer over 50,000 characters, from a tool that sets no size of its own, is saved to a file instead.

Example code

bash
export MAX_MCP_OUTPUT_TOKENS=50000
claude
Allow bigger answers from MCP tools.
The MCP cap is the right bar.

Common mistake

Raising it to fix one noisy tool. Better to make that tool return less, or page its results.

Key takeaways

  1. 1
    Default 25,000. Tokens per answer.
  2. 2
    Warns at 10,000. So you notice.
  3. 3
    Huge text. Goes to a file.