-
Notifications
You must be signed in to change notification settings - Fork 295
Open
Description
Summary
Currently, the session lifetime feature (added in PR #175) uses an absolute timeout from session creation time. This means a session will be terminated after the configured duration regardless of whether it's actively being used.
Current behavior:
- Session created at 10:00
- Lifetime = 30 minutes
- Session terminated at 10:30, even if actively used at 10:29
Proposed behavior (sliding/idle timeout):
- Session created at 10:00
- Lifetime = 30 minutes (idle timeout)
- Each request resets the timer
- If last request was at 10:25, session terminates at 10:55
Use Case
When using MetaMCP with AI coding assistants (Claude Code, Cursor, GitHub Copilot, etc.), sessions can be long-lived with intermittent activity. The current absolute timeout forces session recreation during active work sessions, which:
- Interrupts ongoing work
- Requires clients to handle session expiration and reconnection
- May cause tool state loss in stateful MCP servers
A sliding/idle timeout would only terminate truly inactive sessions while keeping active ones alive.
Question
Does this approach make sense for MetaMCP? I'd be happy to submit a PR if this feature aligns with the project's goals.
Related Issues
- [Bug/Question] Connection Timeout (5 mins) in LAN via Kilo Code - Missing Heartbeat mechanism? #215 - Connection Timeout (related to keep-alive, different issue)
- Expired sessions don't appear to be handled according to spec #166 - Expired sessions handling (related to reconnection logic)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels