Skip to content

Support clean server shutdown #1739

@maxisbey

Description

@maxisbey

Summary

Provide a reliable way to cleanly shut down a running MCP server, ensuring all resources are properly released.

Motivation

  • Currently there's no clean way to stop a running server programmatically
  • Resources (connections, tasks, file handles) may not be properly cleaned up on shutdown
  • Important for testing, graceful restarts, and production deployments

Goal

  • API for triggering graceful shutdown
  • Proper cleanup of all active sessions and transports
  • Configurable shutdown timeout / drain period

AI Disclaimer

Metadata

Metadata

Labels

P1Significant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions