Skip to content

Comments

fix: handle parent process exit to ensure MCP Server shutdown#33

Merged
cfc4n merged 1 commit intomasterfrom
claude-closed-moling-cannot-exit
Apr 22, 2025
Merged

fix: handle parent process exit to ensure MCP Server shutdown#33
cfc4n merged 1 commit intomasterfrom
claude-closed-moling-cannot-exit

Conversation

@cfc4n
Copy link
Member

@cfc4n cfc4n commented Apr 22, 2025

When the Claude Desktop process exits, it does not send the syscall.SIGTERM signal to the MoLing MCP Server, causing MoLing to be unable to exit.

Other MCP Clients do not have this issue, for example, Cherry Studio operates normally.

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
@cfc4n cfc4n added the bug Something isn't working label Apr 22, 2025
@cfc4n cfc4n linked an issue Apr 22, 2025 that may be closed by this pull request
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 22, 2025
@cfc4n cfc4n requested a review from Copilot April 22, 2025 14:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the MCP Server fails to shut down when the Claude Desktop process exits by adding a goroutine that monitors the parent process and signals shutdown.

  • Added a goroutine to periodically check for parent process exit
  • Sends a SIGTERM signal to trigger MCP Server shutdown when the parent process is detected as exited

@cfc4n cfc4n merged commit f13951d into master Apr 22, 2025
6 checks passed
@cfc4n cfc4n deleted the claude-closed-moling-cannot-exit branch April 22, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After Claude Desktop is closed, the moling MCP server cannot exit normally

1 participant