Crash on adding MCP Server

Resolved 💬 2 comments Opened Apr 10, 2025 by tsplude Closed May 8, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 0.2.67 (Claude Code)
  • Operating System: macOS 15.3.2 (24D81)
  • Terminal: Ghostty v1.1.3

Bug Description

When adding a new mcp server via claude mcp add ... it says you can press ESC to go back a step. If you press ESC from the first step an uncaught exception is thrown:

╭─────────────────────────────────────────────────
│                                                                                                                                                                                                                                                                                                                                                               │
│  Add MCP Server                                                                                                                                                                                                                                                                                                                                               │
│                                                                                                                                                                                                                                                                                                                                                               │
│  Set up a new MCP server to extend Claude Code with custom tools and commands.                                                                                                                                                                                                                                                                                │
│                                                                                                                                                                                                                                                                                                                                                               │
│  Choose a unique name for this server:                                                                                                                                                                                                                                                                                                                        │
│                                                                                                                                                                                                                                                                                                                                                               │
│  > mb-postgres                                                                                                                                                                                                                                                                                                                                                │
│                                                                                                                                                                                                                                                                                                                                                               │
│  Learn more: https://modelcontextprotocol.io/                                                                                                                                                                                                                                                                                                                 │
│                                                                                                                                                                                                                                                                                                                                                               │
╰─────────────────────────────────────────────────

   Enter to confirm
Error: No previous step
    at L (file:///Users/tplude/.nvm/versions/node/v22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1760:15245)
    at file:///Users/tplude/.nvm/versions/node/v22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1760:15373
    at file:///Users/tplude/.nvm/versions/node/v22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:559:1037
    at I.G.batchedUpdates (file:///Users/tplude/.nvm/versions/node/v22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:81:50733)
    at EventEmitter.Y (file:///Users/tplude/.nvm/versions/node/v22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:559:1017)
    at EventEmitter.emit (node:events:530:35)
    at EventEmitter.emit (node:domain:489:12)
    at wt.processInput (file:///Users/tplude/.nvm/versions/node/v22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:552:718)
    at Timeout.flushIncomplete [as _onTimeout] (file:///Users/tplude/.nvm/versions/node/v22.11.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:552:552)
    at listOnTimeout (node:internal/timers:594:17)

Steps to Reproduce

  1. Above

Expected Behavior

Graceful exit

Actual Behavior

Ungraceful exit

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗