Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
CRITICAL BUG: cursor-agent CLI MCP STDIO Transport Failure
Summary
cursor-agent CLI completely fails to handle structured MCP responses over STDIO transport that work perfectly in Cursor IDE, causing indefinite hangs for any production MCP server that returns content arrays.
Impact
- CRITICAL: CLI MCP unusable for any real-world MCP server
- BLOCKS: Production CLI agent workflows and automation
- INCONSISTENT: Same MCP server works in IDE but fails in CLI
- SILENT FAILURE: CLI hangs indefinitely with no error messages
Root Cause
The CLI and IDE use different MCP STDIO transport implementations. CLI cannot process structured MCP responses ({"result": {"content": [...]}}) over STDIO that are standard in the MCP specification and work perfectly in IDE.
Evidence
MCP Server Response (Standard Format)
Any MCP server returning structured content causes this bug:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "This is a standard MCP response that works in IDE"
},
{
"type": "resource",
"resource": {
"uri": "example:data",
"text": "Additional structured data"
}
}
]
}
}
IDE Behavior (Working)
- Discovers MCP server correctly
- Calls tools successfully
- Renders structured content arrays perfectly
- Shows formatted text, handles resources, supports full MCP spec
CLI Behavior (Broken)
- Discovers MCP server correctly

- Calls tools successfully

- Hangs indefinitely on structured responses

- No error messages, no timeout, requires manual kill
- Same response that works in IDE causes complete failure
Technical Analysis
STDIO Transport Layer Mismatch
- IDE MCP STDIO Client: Handles full MCP specification including content arrays over STDIO
- CLI MCP STDIO Client: Expects plain text responses over STDIO, cannot process structured content
- Server STDIO Response: Valid MCP JSON-RPC with content arrays sent via STDIO (per spec)
- CLI STDIO Processing: Fails silently, waits indefinitely for different format over STDIO
Key Evidence Points
- Same server, same response: Works in IDE, fails in CLI
- Standard MCP format: Response follows MCP specification exactly
- No error handling: CLI provides no feedback about processing failure
- Infinite hang: No timeout mechanism, requires manual termination
Required Fix
Immediate (Critical)
- Add timeout: Prevent infinite hangs (30s default)
- Extract text content: Basic fallback for structured responses
- Parse
response.result.contentarray - Extract
textfield from items withtype: "text" - Display concatenated text content to user
- Ignore other content types (resources, images) for now
- Parse
Complete (Long-term)
- Unified MCP STDIO client: Use same STDIO transport layer as IDE
- Full content array support: Handle text, resources, images per MCP spec over STDIO
- Error reporting: Show meaningful errors instead of silent hangs on STDIO
Workaround
Currently, the only workaround is to use Cursor IDE instead of CLI for any MCP functionality.
Validation
After fix, this should work without hanging:
cursor-agent --print "use any MCP tool that returns structured content"- Should output: rendered text from content arrays
- Should NOT: hang indefinitely
Success Criteria
- CLI doesn’t hang on structured MCP responses
- CLI renders text content from MCP content arrays
- CLI shows errors instead of silent failures
- CLI has reasonable timeout for MCP operations
- CLI achieves feature parity with IDE MCP handling
This is a STDIO transport layer bug affecting all production MCP servers. The MCP specification requires structured content arrays over STDIO, but CLI cannot process them while IDE handles them perfectly.
Reporter
- Environment: macOS, Node.js v23.6.0, Latest Cursor
- Reproduction: 100% reproducible with any MCP server returning content arrays
- Urgency: High - blocks CLI adoption for MCP workflows
Steps to Reproduce
Reproduction Steps
The Bug Pattern
- Create any MCP server that returns structured content arrays in the standard MCP format
- Configure it in ~/.cursor/mcp.json with STDIO transport (standard setup)
- Test in Cursor IDE: Works perfectly - renders content arrays correctly
- Test in cursor-agent CLI: Hangs indefinitely on the same structured responses
Observable Behavior
- IDE Success: Same MCP server and responses work flawlessly in Cursor IDE chat
- CLI Failure:
cursor-agent --print "any MCP command"hangs forever - STDIO Transport: Both IDE and CLI use STDIO to communicate with MCP server
- Response Format: Server returns valid
{"result": {"content": [...]}}JSON-RPC - CLI Processing: CLI receives response but cannot process structured content arrays
Expected Behavior
Expected vs Actual Behavior
| Component | Expected | Actual |
|---|---|---|
| MCP Server | Returns structured content | |
| IDE Agent | Renders content arrays | |
| CLI Agent | Renders content arrays |
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.7.44 (Universal)
VSCode Version: 1.99.3
Commit: 9d178a4■■■89981b62546448bb32920a8219a5d0
Date: 2025-10-10T15:43:37.500Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0
Does this stop you from using Cursor
No - Cursor works, but with this issue