Skip to content

Support clean server shutdown #1739

Open

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

Activity

  1. added
    v2
    enhancement
    P1
    on Dec 5, 2025
  2. Kludex commented on Apr 5, 2026

    @Kludex
    Member

    What is the motivation for this? Can you share an example of a resource that will not be released on shutdown?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1enhancementv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions