# How to set MCP server timeouts in Claude Code

DevFeed: [How to set MCP server timeouts in Claude Code](<https://devfeed.tech/articles/how-to-set-mcp-server-timeouts-in-claude-code-150096.md>)

Original publisher: [Read original article](<https://nirmata.com/2026/11/23/how-to-set-mcp-server-timeouts-in-claude-code/>)

Author: Ritesh Patel

Published: 2026-11-23T16:00:00Z

Content type: tutorial

Language: en

Sources: [Nirmata](<https://devfeed.tech/sources/nirmata.md>)

Topics: [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [Documentation](<https://devfeed.tech/topics/documentation.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [background](<https://devfeed.tech/tags/background.md>), [blocks](<https://devfeed.tech/tags/blocks.md>), [budget](<https://devfeed.tech/tags/budget.md>), [call](<https://devfeed.tech/tags/call.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-ai](<https://devfeed.tech/tags/claude-ai.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [claude-code-mcp](<https://devfeed.tech/tags/claude-code-mcp.md>), [command](<https://devfeed.tech/tags/command.md>), [container](<https://devfeed.tech/tags/container.md>), [control](<https://devfeed.tech/tags/control.md>), [cost-management](<https://devfeed.tech/tags/cost-management.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [limits](<https://devfeed.tech/tags/limits.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [mcp-server](<https://devfeed.tech/tags/mcp-server.md>), [review](<https://devfeed.tech/tags/review.md>), [security](<https://devfeed.tech/tags/security.md>), [server](<https://devfeed.tech/tags/server.md>), [startup](<https://devfeed.tech/tags/startup.md>), [timeout](<https://devfeed.tech/tags/timeout.md>), [tool](<https://devfeed.tech/tags/tool.md>)

## AI overview

Claude Code uses separate MCP limits for server startup, total tool-call duration, and periods without activity; changing one does not extend the others. Set `MCP_TIMEOUT` in milliseconds for startup (30-second default), and use `MCP_TOOL_TIMEOUT` globally or a server's `.mcp.json` `timeout` for a hard wall-clock cap. A per-server value overrides the global tool limit for that server; values below 1000 ms are ignored. The idle timeout ends silent calls, while progress can continue until the wall-clock cap; defaults are 30 minutes for stdio and 5 minutes for HTTP, SSE, WebSocket, and claude.ai connector servers. HTTP, SSE, and connector calls also have a per-request timer before the first response byte; stdio and WebSocket do not. For review pipelines, set per-server caps above normal call duration and choose an idle window based on acceptable silence. Idle timeout requires Claude Code v2.1.187 or later; older versions exempted stdio calls.

## Source excerpt

Set MCP_TIMEOUT for server startup and a timeout field for tool calls. Covers the defaults, idle limits, and what a hung MCP call does to a review run.