What this thread does
MCP tool "<name>" response (N tokens) exceeds maximum allowed tokens (25000). Please use pagination, filtering, or limit parameters to reduce the response size. First action: raise the limit for one session with MAX_MCP_OUTPUT_TOKENS=50000 claude, and fix the cause in the MCP server by returning less per call (filters, a limit parameter, pagination).
Do first: MAX_MCP_OUTPUT_TOKENS=50000 claude.
Not for: how an MCP server should page its own list results (see mcp-server-pagination-tools-resources-prompts-list-nextcursor).
Evidence status: the variable name, default, warning threshold and file-saving rule are from the official Claude Code MCP page, checked 2026-10-30. The error string comes from a public issue. No lab run; raising the limit is untested here.
Diagnostic: MCP tool "<name>" response (N tokens) exceeds maximum allowed tokens (25000). Please use pagination, filtering, or limit parameters to reduce the response size.
Verbatim example from a public report: MCP tool "chrome_screenshot" response (137411 tokens) exceeds maximum allowed tokens (25000). Please use pagination, filtering, or limit parameters to reduce the response size. (issue 9152, opened 2025-10-08 by nickyli98, closed as a duplicate of 4002).
What the docs say
- Claude Code "limits output to 25,000 tokens by default."
- It "displays a warning when MCP tool output exceeds 10,000 tokens"; per the docs this warning threshold is fixed and not changed by the variable.
- The variable is
MAX_MCP_OUTPUT_TOKENS; the docs' example value isMAX_MCP_OUTPUT_TOKENS=50000. - Separately, text results longer than 50,000 characters are saved to a file "regardless of this variable", unless the server raises the tool's own limit. The file goes in the session's
tool-resultsdirectory under~/.claude/projects/, and the conversation gets a message naming the file path instead; Claude reads the file when needed. A server author can raise one tool's threshold (up to 500,000 characters) with_meta["anthropic/maxResultSizeChars"]intools/list, independent of the variable.
Do first
1. Set the variable when you start Claude Code, in the same shell:
MAX_MCP_OUTPUT_TOKENS=50000 claude
2. Re-run the tool call. A larger value costs more context per call, so raise it only as far as needed. 3. Then reduce what the tool returns: ask for fewer rows or fields, add a limit or filter argument, and page through results. The error text itself suggests pagination, filtering or limit parameters. If you own the server, see mcp-server-pagination-tools-resources-prompts-list-nextcursor.
Images and screenshots
Issue 9152 asked for base64 image data to be exempt from the text-token limit; the page shows no maintainer answer or workaround and it was closed as a duplicate. Per the docs, tools that return image data are still subject to MAX_MCP_OUTPUT_TOKENS (the per-tool maxResultSizeChars does not apply to image data), so raise the variable or return a smaller screenshot (region or lower resolution) from the server.
Related variables from the same docs page
MCP_TIMEOUT: server startup timeout; the example isMCP_TIMEOUT=10000 claudefor 10 seconds.MCP_TOOL_TIMEOUT: tool-call timeout across servers; the docs say the default is about 28 hours when unset. A per-servertimeoutin milliseconds in a.mcp.jsonentry overrides it for that server only (values below 1000 are ignored).
Evidence
Issue 9152 gives the exact error string and a real failing case (137,411 tokens against 25,000). It contains no fix. The docs are the source for the variable.
Limits
Untested: persistence of the variable in a settings env block, and the exact spill-to-file behavior. The docs state the 50,000-character rule is character-based, whatever the token count. Issue 9152 was on v2.0.10, so its error string may be version-bound. checked 2026-10-30.
Started from a post by @Anthropic (Claude Code docs), packaged by the editor. Original post