Claude Code 2.1.274: MCP Reliability Overhaul, Gateway Postgres Config, and Self-Healing Transcripts

Claude Code 2.1.274 fixes six MCP failure modes that silently break production tool sessions, adds store.connect_timeout_seconds and CLAUDE_CODE_GATEWAY_DRAIN_TIMEOUT_MS to the Claude apps gateway, and makes corrupted transcripts self-heal instead of looping forever.

TheRouter Newsroomvia Anthropic
Claude Code 2.1.274 reliability improvements for gateway operators showing MCP connection stability and transcript recovery configuration diagram

Claude Code 2.1.274 shipped on September 17. Its 80-plus-item changelog covers a lot of surface, but the items that matter for operators fall into three clusters: MCP failures that silently break production tool sessions, Claude apps gateway configuration gaps, and session-state bugs that loop forever without a clear error.

Six MCP fixes for production tool sessions

MCP reliability is where agentic sessions fail in ways that look like user error until you dig into logs. 2.1.274 closes six of those failure modes.

Legacy HTTP+SSE servers returning 422 on first probe. MCP servers configured as "type": "http" that speak the older HTTP+SSE protocol would fail to connect silently if the initial handshake probe got a 422 or other 4xx. Many servers behind auth proxies send exactly this on the first request. The client now falls through to the legacy protocol path instead of treating the 4xx as a permanent failure.

Streamable HTTP tool calls timing out at five minutes. Any Streamable HTTP MCP tool call hit a hard five-minute ceiling regardless of the per-server timeout config. Long-running backend operations — code synthesis, test execution — silently failed at this limit. The per-server timeout is now respected.

list_changed notifications ignored unless capability is declared. When an MCP server sent a list_changed notification without explicitly declaring listChanged: true in its capability manifest, Claude Code served stale tool lists for the rest of the session. Fixed: the notification is now processed regardless of the declaration.

403 insufficient_scope misreported as expired sign-in. A tool call refused with 403 insufficient_scope would tell users their login expired, sending them through full re-authentication for a problem that was actually a missing OAuth scope. The error now names the missing permissions and points to /mcp for scope re-authorization.

MCP v2 now default on Bedrock, Vertex, Foundry, and telemetry-disabled installs. These installs were still using the v1 client and pre-2026-07-28 protocol negotiation. All other installs had already moved to MCP 2026-07-28. 2.1.274 aligns them. If your MCP servers require the legacy protocol, set MCP_SDK_GENERATION=v1 or MCP_PROTOCOL_NEGOTIATION=legacy.

Secret leakage in MCP errors. MCP connection errors and the login tool description were exposing resolved values from ${VAR} placeholders in MCP configs. Fixed.

The 422 and list_changed issues are the kind that pass local testing and surface in production when a server is behind an auth proxy or deploys new tooling mid-session.

Gateway config: three new dials

store.connect_timeout_seconds: Sets the maximum wait for a Postgres connection at gateway startup. Default is 5 seconds. Gateways connected to serverless or cold-start Postgres instances (RDS Aurora Serverless, Supabase on cold tier) would fail to boot if the database wasn't reachable within that window. The boot error now explicitly names store.postgres_url and the configured timeout.

CLAUDE_CODE_GATEWAY_DRAIN_TIMEOUT_MS: Before this release, SIGTERM cut all open streams immediately. A rolling deploy or load balancer drain would terminate active long-running requests mid-stream. The gateway now waits up to 25 seconds for in-flight requests to complete before exiting. Set CLAUDE_CODE_GATEWAY_DRAIN_TIMEOUT_MS=0 to restore the old behavior if your orchestrator expects a fast exit.

256-upstream-request saturation warning: A new startup log line announces the per-replica upstream concurrency ceiling (256). If a replica exceeds it, a warning fires. The ceiling existed before 2.1.274 — the new part is the visibility: unexplained latency or dropped streams under load now have a named signal.

Transcript self-healing and session-state fixes

Self-healing corrupted transcripts. Sessions that received an unexpected tool_use_id 400 error were retrying the same request indefinitely — a corrupted tool use ID in conversation history causes this, and it was previously unrecoverable. 2.1.274 detects these and self-heals where possible. Where it can't repair automatically, a clear error with a /rewind hint ends the loop.

/goal compaction loop. Sessions using /goal hook-driven tracking could hit a loop: context overflows, reactive compaction fires, context overflows again, repeat. This surfaced as "Prompt is too long" with no way out. Fixed. Related: an active /goal was being silently dropped when resuming (--continue / --resume) a session that had compacted. That data loss is also fixed.

claude agents flags dropped after auto-update. When Claude Code performed an auto-update relaunch mid-agents session, --model, --effort, --permission-mode, --allow-dangerously-skip-permissions, and --agent flags were all dropped. The relaunched process ran with different parameters than the one that started. Fixed.

Observability additions

enduser.sub: The IdP subject identifier from your SSO provider is now included in telemetry for Claude Desktop and Cowork sessions proxied through a Claude apps gateway. This is the stable cross-system key for correlating Claude Code spend against SSO identities in billing or audit pipelines.

effort on the claude_code.llm_request OTel span: Effort level is now an attribute on the trace span, matching the api_request event. Useful for splitting cost attribution by effort tier in your tracing UI.

claude_code.managed_settings_resolved event: Records which managed-settings sources were applied and what the policy state was. Set OTEL_LOG_MANAGED_SETTINGS=1 to include actual settings values. This turns policy-layering diagnosis from log archaeology into a single OTel event lookup.

What to check after updating

For Claude apps gateway operators: set store.connect_timeout_seconds if your Postgres has a cold-start delay; verify your deployment platform's drain tolerance against the new 25-second default; watch startup logs for the replica saturation ceiling message.

For Bedrock/Vertex/Foundry users: MCP 2026-07-28 with the v2 client is now your default. Check that your MCP servers negotiate the 2026-07-28 protocol or set the legacy env vars before updating.

For everyone running tool-heavy agentic sessions: no config change needed for the MCP fixes. If you had sessions silently stalling at the five-minute mark, or tool lists going stale after a server deploy, those should resolve with the update.

If you route Claude Code through TheRouter, the drain timeout and Postgres timeout changes apply to any self-hosted Claude apps gateway behind the router layer. The effort OTel attribute improves per-request cost attribution across any tracing setup that captures requests.

Help & contact