BigRead MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add bigread -- npx -y github:r3xsean/bigread-mcp
README.md

Fixes Claude Code's Output too large file truncation problem.

bigread-mcp

Fixes Claude Code's "Output too large" file truncation problem.

When Claude Code reads a file larger than ~50K characters, the persisted-output mechanism truncates the result to a 2KB preview — the AI loses access to the full content. bigread calculates optimal chunk offsets so Claude can re-read the file in correctly-sized pieces using its built-in Read tool, preserving full Read/Edit/Write compatibility.

No file content is returned — just the reading plan (offsets, limits, chunk count). Claude's own Read tool does the actual reading, so you keep full editing capabilities on the file.

Install

claude mcp add --transport stdio --scope user bigread -- npx -y github:r3xsean/bigread-mcp

One command. Works on Windows, macOS, and Linux.

Setup

Add this to your CLAUDE.md so the AI uses it automatically when truncation occurs:

# File Reading

When using the Read tool, do NOT pass a `limit` parameter unless the file is known to be
extremely large (10,000+ lines). Omitting `limit` reads the entire file, which is almost
always what the user wants.

When a Read tool result shows `Output too large` with a `persisted-output` tag, the full
content was NOT loaded into your context — you only received a ~2KB preview. To get the full
file, call the `bigread` MCP tool with the file path — it returns pre-calculated chunk offsets
and limits sized to fit under the truncation threshold. Then read all chunks in parallel using
the Read tool with the returned `offset` and `limit` values. Do NOT tell the user the file was
truncated or ask them to split it — just seamlessly call bigread and re-read in chunks.

Recommended environment variables

Add these to ~/.claude/settings.json alongside bigread for complete coverage:

{
  "env": {
    "CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS": "500000",
    "MAX_MCP_OUTPUT_TOKENS": "500000",
    "BASH_MAX_OUTPUT_LENGTH": "200000"
  }
}

These raise separate, earlier limits (token cap and bash output cap) that can also cause truncation. bigread fixes the persisted-output character cap — the one that's not configurable via env vars.

The Problem

Claude Code has a hardcoded 50,000 character per-tool output cap. Any tool result exceeding this triggers persisted-output:

  • Full content is saved to a temp file on disk
  • The AI receives only a 2KB preview (2,000 characters)
  • The AI cannot see the rest of the file in its context
  • Reading the temp file triggers the same cap — infinite loop

Setting CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS does not fix this — that controls a separate, earlier token limit. The 50K character cap is a different system entirely and has no env var override.

How It Works

AI tries to read large-file.md → gets "Output too large" with 2KB preview
                                    ↓
AI calls bigread({ filePath: "/path/to/large-file.md" })
                                    ↓
bigread returns: {
  totalLines: 756,
  totalChars: 60428,
  charsPerLine: 80,
  linesPerChunk: 500,
  chunks: [
    { offset: 1, limit: 500 },
    { offset: 501, limit: 256 }
  ]
}
                                    ↓
AI reads all chunks in parallel using built-in Read tool with those offsets
                                    ↓
Full file in context. No truncation. Full edit/write capability preserved.
  1. Reads the file to get total character count and line count
  2. Calculates average characters-per-line for that specific file
  3. Computes how many lines fit in 40K characters (safe margin under the 50K threshold)
  4. Returns chunk definitions with 1-based offset and limit matching the Read tool's API

If the file is small enough to fit in one read (<40K chars), it says so — no unnecessary chunking.

Why Not Just Use offset/limit Manually?

You could instruct the AI to run wc, calculate chunk sizes, and build offset/limit pairs itself. But that's 4 steps the AI has to execute and get right every time, burning context and tool calls on arithmetic. bigread does it in one call and returns exactly what the Read tool needs.

Why Not Return File Content Directly?

Claude Code only tracks files for editing when they're read through the built-in Read tool. If an MCP server returns file content directly, Claude can read it but can't Edit or Write to it afterward. By returning only the reading plan, Claude uses its own Read tool for the actual reading — keeping full read/edit/write compatibility intact.

Technical Details

Constant Value What it controls
Persisted-output threshold 50,000 chars When tool results get truncated to 2KB preview
Preview size 2,000 chars How much of the truncated result the AI can see
bigread chunk target 40,000 chars Safe size per chunk (10K margin under threshold)
Token estimation ~4 chars/token How Claude Code estimates tokens from character count

License

MIT

Tools (1)

bigreadCalculates optimal chunk offsets and limits for large files to fit under the 50K character truncation threshold.

Environment Variables

CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENSSets the token cap for file reads.
MAX_MCP_OUTPUT_TOKENSSets the maximum MCP output tokens.
BASH_MAX_OUTPUT_LENGTHSets the maximum bash output length.

Configuration

claude_desktop_config.json
{"mcpServers": {"bigread": {"command": "npx", "args": ["-y", "github:r3xsean/bigread-mcp"]}}}

Try it

I'm getting an 'Output too large' error when reading this file. Can you use bigread to help me read it in chunks?
Use bigread to calculate the offsets for this large log file so I can read the whole thing without truncation.
The file is too big to read at once. Please use the bigread tool to get a reading plan and then read the file in chunks.

Frequently Asked Questions

What are the key features of BigRead?

Calculates optimal chunk offsets and limits for large files. Bypasses the 50,000 character per-tool output cap. Maintains native Read/Edit/Write compatibility by using Claude's built-in Read tool. Returns a reading plan instead of file content to preserve editing capabilities.

What can I use BigRead for?

Reading large source code files that exceed the 50K character limit. Processing massive log files without losing context due to truncation. Maintaining full file edit/write capabilities for files that are too large to load into context at once.

How do I install BigRead?

Install BigRead by running: claude mcp add --transport stdio --scope user bigread -- npx -y github:r3xsean/bigread-mcp

What MCP clients work with BigRead?

BigRead works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep BigRead docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare