mcp-timeout-demo
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-timeout-demoRun long_running_task with label 'demo', 5s work, 30s timeout."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-timeout-demo
A Claude Code MCP server that exposes a long-running tool with per-tool configurable timeouts and periodic progress notifications, so Claude Code never severs the request mid-flight.
If you have ever seen Claude Code kill an MCP tool call that was otherwise healthy — because it went silent for longer than the client's default idle window — this plugin shows the smallest possible fix and ships it as a drop-in server you can install today.
Companion article: https://claudeplugins.nicedx.com/claude-code-mcp-tool-timeout-configurable-long-running/
What you get
One MCP tool,
long_running_task, with atimeout_msparameter validated against[1, 600_000]ms.Cooperative cancellation via
asyncio.wait_for— a genuinely stuck call fails at the ceiling, it does not hang forever.Progress notifications every 250 ms via
ctx.report_progress— the Claude Code client's idle timer never fires while the tool is actually working.Per-tool timeout defaults from an env var or a JSON config file, with env vars winning over the file.
A ready-to-copy
.mcp.jsonsnippet atexamples/claude_code.mcp.json.A Claude Code plugin manifest at
.claude-plugin/plugin.jsonso the same server can install via a plugin marketplace.
Related MCP server: MCP Background Job Server
Install
The server ships as a standard Python distribution. Three install paths, in order of preference:
1. uv run (recommended, zero pre-install)
uv bootstraps a venv on the fly, so nothing has to be pre-installed
globally. Drop this into your project's .mcp.json:
{
"mcpServers": {
"mcp-timeout-demo": {
"command": "uv",
"args": ["run", "mcp-timeout-demo"],
"env": {
"MCP_TIMEOUT_DEMO_TIMEOUT_MS__LONG_RUNNING_TASK": "60000"
}
}
}
}Then restart Claude Code in that project. That is it.
2. pip install + console script
pip install mcp-timeout-demoRegister with Claude Code:
claude mcp add mcp-timeout-demo \
--env MCP_TIMEOUT_DEMO_TIMEOUT_MS__LONG_RUNNING_TASK=60000 \
-- mcp-timeout-demo3. From source
git clone https://github.com/vytharion/claude-code-mcp-tool-timeout-configurable-long-running.git
cd claude-code-mcp-tool-timeout-configurable-long-running
uv sync
uv run mcp-timeout-demo4. As a Claude Code plugin
The repository ships a .claude-plugin/plugin.json manifest, so the
server can also be published as a plugin through a Claude Code plugin
marketplace. The .claude-plugin/marketplace.json in this repo is the
minimal example marketplace entry — point your marketplace tooling at
the repository URL and Claude Code will read both files.
Configure
The tool has one default: DEFAULT_TIMEOUT_MS = 5_000. Two mechanisms
override that default, in this precedence (most-specific wins):
Environment variable
MCP_TIMEOUT_DEMO_TIMEOUT_MS__<TOOL_NAME_UPPER>Example — raise the ceiling for long_running_task to 60 seconds:
export MCP_TIMEOUT_DEMO_TIMEOUT_MS__LONG_RUNNING_TASK=60000JSON config file
Set MCP_TIMEOUT_DEMO_CONFIG to point at a JSON file with this shape:
{
"tools": {
"long_running_task": {
"timeout_ms": 60000
}
}
}Then:
export MCP_TIMEOUT_DEMO_CONFIG=/path/to/mcp-timeouts.jsonPer-call override
Clients can still pass timeout_ms on the individual call_tool
request. That per-call value always wins over the default — the
default only sets the ceiling the schema advertises.
Verify
Once the server is registered, ask Claude Code to call the tool:
"Call
long_running_taskwith label 'demo',timeout_ms=3000, andwork_duration_ms=1500."
You should see the tool return:
done:demo:worked=1500ms:timeout=3000msTo see the timeout path fire, ask for work that exceeds the deadline:
"Call
long_running_taskwith label 'over',timeout_ms=200, andwork_duration_ms=5000."
The tool returns cleanly with:
timeout:over:after=200msThe client will also receive periodic progress notifications during either call.
Troubleshooting
"Claude Code still says the tool timed out"
That is the client-side MCP timeout, not the tool's timeout_ms.
This plugin only fixes the server-side idle-timer story via progress
notifications. If Claude Code itself has a hard per-call ceiling, this
plugin cannot reach past it — file a follow-up config with the client.
"The env var is not being picked up"
The env-var key encodes the tool name in upper case with underscores
preserved. long_running_task becomes
MCP_TIMEOUT_DEMO_TIMEOUT_MS__LONG_RUNNING_TASK (note the double
underscore between prefix and tool name). Print env_key_for(tool_name)
from the mcp_timeout_demo.config module if you are unsure.
"The tool default advertised in tools/list is wrong"
The advertised default is captured at server startup. If you change
the env var or the config file, restart the MCP server (in Claude
Code: /mcp → restart the server, or just restart the client).
"I get FileNotFoundError: config file not found"
MCP_TIMEOUT_DEMO_CONFIG must point at an existing file; a missing
path is treated as operator error, not silently ignored. Check the
path and the process's working directory.
"I get ValueError: timeout ... outside [1, 600000]"
Timeout values are clamped to [1, 600_000] ms (10 minutes). A
malformed override fails loudly at startup rather than silently
degrading — fix the value in your env or config file.
Upgrade notes
Semantic Versioning applies. Minor releases may add tools or config keys; patch releases are strictly bug fixes.
The env-var prefix (
MCP_TIMEOUT_DEMO_) and key template (MCP_TIMEOUT_DEMO_TIMEOUT_MS__<TOOL_NAME_UPPER>) are part of the public API. They will not change inside a major version.The JSON config file schema (
tools.<name>.timeout_ms) is also part of the public API for the current major.
See CHANGELOG.md for the full release history.
Development
uv sync
uv run pytest -vThe suite drives the server through the SDK's in-memory transport, so no subprocess or stdio hand-off is required to run it.
License
MIT — see LICENSE.
Available Tools
1 toollong_running_taskD
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | ||
| timeout_ms | No | Deadline for the task in milliseconds. Clients override this per call to match the expected workload. | |
| work_duration_ms | No | How long the simulated work should run, in milliseconds. If this exceeds timeout_ms the worker is cooperatively cancelled. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
long_running_task
TDQS
Only one tool exists, so there is no possibility of confusion or overlap. Every available tool has a distinct purpose by virtue of being the sole tool.
With a single tool, naming consistency is trivially satisfied. The name 'long_running_task' is clear and follows a descriptive pattern, although no pattern can be established from one example.
A single tool feels thin for general use, but it is borderline acceptable for a server explicitly named 'mcp-timeout-demo' whose purpose appears to be demonstrating timeout behavior. One tool may be intentionally minimal for this narrow scope.
For a server dedicated to timeout demonstration, the 'long_running_task' tool fully covers the apparent purpose. There are no obvious gaps or dead ends given the focused domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
MCP server for generating rough-draft project plans from natural-language prompts.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows integration with Claude Desktop by creating and managing custom tools that can be executed through the MCP framework.88-
- AlicenseAqualityDmaintenanceAn MCP server that enables coding agents to execute and manage long-running shell commands asynchronously with capabilities for process monitoring, interaction, and lifecycle management.713MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that automates the continuation of AI tasks by intercepting tool calls and injecting user instructions directly back into the execution flow. It eliminates the need for manual 'continue' prompts, enabling an uninterrupted and automated code generation loop.4-
- AlicenseNot gradedqualityAmaintenanceMCP server that provides real-time rate-limit and context budget awareness to Claude Code, enabling it to plan tasks that fit within its constraints and defer work when needed.13Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vytharion/claude-code-mcp-tool-timeout-configurable-long-running'
If you have feedback or need assistance with the MCP directory API, please join our Discord server