Support optional MCP servers that fail silently

Resolved 💬 3 comments Opened Feb 27, 2026 by david-galvanic Closed Mar 3, 2026

Problem

When an MCP server defined in .mcp.json is unreachable, Claude Code shows a connection warning on startup. There's no way to suppress this.

This is a problem for projects that use devcontainers where MCP servers are environment-dependent. For example, a Playwright MCP server might be reachable via http://playwright:3000/sse inside a devcontainer (where it's on the Docker network), but unreachable on the host machine (where you'd use a different transport like Docker MCP Gateway instead).

You want .mcp.json checked into the repo so the whole team gets the config inside the devcontainer, but outside the container the failed connection warning is noisy and unavoidable.

Proposed Solution

Add an "optional" flag (or similar) to MCP server entries in .mcp.json:

{
  "mcpServers": {
    "playwright": {
      "type": "sse",
      "url": "http://playwright:3000/sse",
      "optional": true
    }
  }
}

When "optional": true, a failed connection would be silent (or reduced to a debug-level message) rather than showing a warning.

Use Cases

  • Devcontainer-specific MCP servers: Servers available inside the container but not on the host
  • CI/CD environments: Servers that only exist in certain pipelines
  • Team setups: Shared .mcp.json where not everyone has every server running locally

View original on GitHub ↗

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