Skip to content

feat(mcp): cap MCP tool descriptions and server instructions at 2KB to prevent context bloat #2450

@bug-ops

Description

@bug-ops

Gap Source

Claude Code v2.1.x (March 2026) added 2KB cap on MCP tool descriptions and server instructions. Competitive parity scan CI-307.

Problem

Verbose MCP server descriptions (some can be several KB each) waste context window tokens. With many MCP servers, this compounds per-turn. Zeph passes MCP tool descriptions to the LLM as-is.

Fix

In MCP tool registration / context injection:

  • Cap tool description field at 2048 bytes with graceful truncation (preserve start, append "...")
  • Cap per-server instructions at 2048 bytes
  • Make limits configurable in [mcp] config section

Priority

P3 — token efficiency optimization, not a correctness issue.

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions