cannot connect to MCP after fresh install using terminal CLI

Resolved 💬 2 comments Opened Oct 17, 2025 by mankboy Closed Oct 17, 2025

Description

Unable to configure MCP servers after fresh install using the terminal CLI. Multiple attempts to add an MCP server result in "No MCP servers configured" message when running /mcp command.

Environment

  • OS: macOS (Darwin 25.0.0)
  • Node version: v22.17.0
  • Claude Code installation: /Users/simonandrews/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code
  • Date: 2025-10-17

Steps to Reproduce

  1. Fresh install of Claude Code via terminal CLI
  2. Attempt to add MCP server using various command formats:

``bash
claude mcp add https://iqskpspkht.eu-west-2.awsapprunner.com/mcp
claude mcp add --transport http Enumerait https://iqskpspkht.eu-west-2.awsapprunner.com/mcp
claude mcp add --transport http Enumerai https://iqskpspkht.eu-west-2.awsapprunner.com/mcp
claude mcp add --transport http Enumerait https://iqskpspkht.eu-west-2.awsapprunner.com/mcp
``

  1. Run /mcp command to verify
  2. Result: "No MCP servers configured. Please run /doctor if this is unexpected."

Error Logs

Critical Error from Debug Logs

[ERROR] Failed to save config with lock: Error: ENOENT: no such file or directory, lstat '/Users/simonandrews/.claude.json'

JSON Parsing Error (recurring)

[ERROR] SyntaxError: SyntaxError: Unexpected token '\`', "'\`\`\`json
{
"... is not valid JSON
    at JSON.parse (<anonymous>)
    at file:///Users/simonandrews/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719
    at Q (file:///Users/simonandrews/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)
    at Zn2 (file:///Users/simonandrews/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1056:20444)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Additional Error

[ERROR] RangeError: RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded
    at Socket.onChildStdout (node:child_process:482:14)
    at Socket.emit (node:events:518:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)

Current Configuration

~/.claude/settings.json:

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "alwaysThinkingEnabled": true,
  "feedbackSurveyState": {
    "lastShownTime": 1754039989841
  }
}

Debug Information

  • Debug logs location: ~/.claude/debug/
  • History location: ~/.claude/history.jsonl
  • Config file: ~/.claude.json (exists with 33672 bytes)
  • The "ide" MCP server appears to be working correctly in debug logs
  • All attempts to add the custom MCP server fail silently

Expected Behavior

MCP server should be added to configuration and appear when running /mcp command.

Actual Behavior

MCP server is not saved to configuration. Each /mcp command returns "No MCP servers configured."

Additional Context

  • The .claude.json file does exist (33KB), but there's an error suggesting it cannot be accessed during config save
  • Multiple command variations attempted with no success
  • No error messages shown to user during claude mcp add command execution

Generated with Claude Code

View original on GitHub ↗

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