[BUG] TypeError: Cannot read properties of undefined (reading 'split') when using Repomix MCP server
Resolved 💬 8 comments Opened Mar 21, 2025 by slavakurilyak Closed Jan 4, 2026
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Claude Code CLI
- Claude CLI version: 0.2.52 (Claude Code)
- Operating System: macOS 15.4 Beta (24E5228e)
- Terminal: iTerm2
Bug Description
When trying to use Claude Code CLI with a connected Repomix MCP server, I get a TypeError related to the 'split' method. The error occurs when attempting to package specific files from my codebase.
Steps to Reproduce
- Run Repomix MCP server:
repomix --mcp - Start Claude Code CLI:
claude - Verify MCP server connection with
/mcp(shows "repomix: connected") - Try to package files with either of these commands:
Package the codebase with these specific files: app/graph/executor.py, tests/conftest.py, tests/api/test_agents_api.py, tests/api/test_workflow_runs_api.py, tests/api/test_workflows_api.pyUse Repomix to package these files: app/graph/executor.py, tests/conftest.py, tests/api/test_agents_api.py, tests/api/test_workflow_runs_api.py, tests/api/test_workflows_api.py
Expected Behavior
Claude should use the Repomix MCP server to package the specified files and display the results or provide an analysis of the files.
Actual Behavior
Claude Code produces an error:
TypeError: Cannot read properties of undefined (reading 'split')
at file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1340:12107
at Array.map (<anonymous>)
at Object.renderToolResultMessage (file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1340:11854)
at cm2 (file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1277:1722)
at Tz (file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:79:19245)
at u51 (file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:42532)
at S4 (file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:38099)
at P51 (file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:38026)
at HJ (file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:37878)
at jk (file:///Users/slava/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:34985)
Additional Context
- The MCP server connection appears to be established correctly (shows as "connected")
- The same Repomix MCP server works when used with Claude web interface
- The error seems to be in the rendering of tool results in Claude Code, not in the Repomix implementation
- Node.js version: v22.14.0
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗