Skip to content

fix(mcp): self-exit after idle timeout (prototype for #633)#634

Merged
dmtrKovalenko merged 2 commits into
mainfrom
triage-bot/issue-633
Jun 26, 2026
Merged

fix(mcp): self-exit after idle timeout (prototype for #633)#634
dmtrKovalenko merged 2 commits into
mainfrom
triage-bot/issue-633

Conversation

@gustav-fff

@gustav-fff gustav-fff commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

closes #633
closes #497

Some MCP clients (e.g. Claude Code) spawn fff-mcp per session but don't
close stdin on session end, leaving orphan processes consuming CPU
(#633, #497).

Add an idle watchdog: each tool call bumps a last-activity timestamp, a
background task ticks every 60s and exits(0) after --idle-timeout-secs
(default 900) without activity. Set to 0 to disable. Also configurable
via FFF_MCP_IDLE_TIMEOUT_SECS.

Stopgap before the daemon-based process model. Notifications/pings do
not count as activity, so a chatty-but-dead client cannot keep the
process alive forever.
@dmtrKovalenko dmtrKovalenko force-pushed the triage-bot/issue-633 branch 3 times, most recently from ff53acf to 51a8b3c Compare June 26, 2026 20:54
@dmtrKovalenko dmtrKovalenko force-pushed the triage-bot/issue-633 branch from 51a8b3c to c46c114 Compare June 26, 2026 23:06
@dmtrKovalenko dmtrKovalenko merged commit b55a566 into main Jun 26, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants