Skip to content

Conversation

@sgaunet
Copy link
Owner

@sgaunet sgaunet commented Dec 7, 2025

  • Add signal handling for SIGTERM and SIGINT with context cancellation
  • Implement cleanup function with detailed logging for shutdown events
  • Log server startup and shutdown signals with version information
  • Use context-aware StdioServer for graceful shutdown support
  • Ensure database connections are properly closed on termination

This makes the server Docker/Kubernetes friendly and prevents connection leaks
during shutdown.

Implements #38

- Add signal handling for SIGTERM and SIGINT with context cancellation
- Implement cleanup function with detailed logging for shutdown events
- Log server startup and shutdown signals with version information
- Use context-aware StdioServer for graceful shutdown support
- Ensure database connections are properly closed on termination

This makes the server Docker/Kubernetes friendly and prevents connection leaks
during shutdown.

Implements #38
@sgaunet sgaunet self-assigned this Dec 7, 2025
@sgaunet sgaunet added the feature New feature label Dec 7, 2025
@sgaunet sgaunet linked an issue Dec 7, 2025 that may be closed by this pull request
9 tasks
@sgaunet sgaunet merged commit bc1a18a into main Dec 7, 2025
4 of 5 checks passed
@sgaunet sgaunet deleted the 38-add-graceful-shutdown-handling-for-mcp-server branch December 7, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add graceful shutdown handling for MCP server

2 participants