Skip to content

Created a lot of processes on MacOS #56

Closed

Description

@tzutoo

I have only 3 MCPs setup. However, it creates a lot of processes for each of the MCP.

Activity

  1. tzutoo commented on Sep 13, 2025

    @tzutoo
    Author

    2025-09-13T15:41:48.522+08:00 | INFO | managed/client.go:88 | Starting connection attempt | {"server": "zai-mcp-server", "transport": "stdio", "url": "", "command": "npx", "protocol": ""}
    2025-09-13T15:42:18.522+08:00 | ERROR | core/connection.go:276 | MCP initialize JSON-RPC call failed | {"server": "zai-mcp-server", "error": "transport error: context deadline exceeded"}
    2025-09-13T15:42:18.523+08:00 | ERROR | managed/client.go:88 | Connection failed | {"server": "zai-mcp-server", "transport": "stdio", "error": "MCP initialize failed for stdio transport: MCP initialize failed: transport error: context deadline exceeded"}
    2025-09-13T15:42:18.524+08:00 | INFO | managed/client.go:88 | Starting connection attempt | {"server": "zai-mcp-server", "transport": "stdio", "url": "", "command": "npx", "protocol": ""}
    2025-09-13T15:42:28.525+08:00 | ERROR | core/connection.go:276 | MCP initialize JSON-RPC call failed | {"server": "zai-mcp-server", "error": "transport error: context deadline exceeded"}
    2025-09-13T15:42:28.525+08:00 | ERROR | managed/client.go:88 | Connection failed | {"server": "zai-mcp-server", "transport": "stdio", "error": "MCP initialize failed for stdio transport: MCP initialize failed: transport error: context deadline exceeded"}
    2025-09-13T15:42:35.660+08:00 | INFO | managed/client.go:88 | Starting connection attempt | {"server": "zai-mcp-server", "transport": "stdio", "url": "", "command": "npx", "protocol": ""}
    2025-09-13T15:43:05.661+08:00 | ERROR | core/connection.go:276 | MCP initialize JSON-RPC call failed | {"server": "zai-mcp-server", "error": "transport error: context deadline exceeded"}
    2025-09-13T15:43:05.661+08:00 | ERROR | managed/client.go:88 | Connection failed | {"server": "zai-mcp-server", "transport": "stdio", "error": "MCP initialize failed for stdio transport: MCP initialize failed: transport error: context deadline exceeded"}


    every failure creates a new process

  2. Dumbris commented on Sep 13, 2025

    @Dumbris
    Member

    @tzutoo Thank you for opening this issue!

    Could you please share your configuration for the specific MCP server(s) that are experiencing this issue? Particularly the zai-mcp-server configuration mentioned in your logs.
    Unfortunately, I haven't been able to reproduce this issue locally on mcpproxy v0.8.2 with other servers

    A few questions that would help:

    1. What version of mcpproxy are you running? (/Applications/mcpproxy.app/Contents/MacOS/mcpproxy --version)
    2. Does this happen with all stdio servers or just specific ones?

    The issue appears to be that when stdio servers fail to initialize (timeout after 30s), the retry mechanism creates new processes without properly terminating the previous ones.

  3. tzutoo commented on Sep 13, 2025

    @tzutoo
    Author

    @Dumbris Thanks for your reply.

    1. I am using this one. https://github.com/smart-mcp-proxy/mcpproxy-go/releases/download/v0.8.2/mcpproxy-0.8.2-darwin-arm64.dmg
    2. For now I only encountered this one:
      zai-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
      "-y",
      "@z_ai/mcp-server"
      ],
      "env": {
      "Z_AI_API_KEY": "xxx-xxxxxx",
      "Z_AI_MODE": "ZAI"
      }
      }
    3. In addition, it seems if the mcp is a local cmdline like this:
      "RepoPrompt": {
      "command": "/Users/tzutoo/RepoPrompt/repoprompt_cli",
      "args": []
      },
      The process which mcpproxy forks (in this case repoprompt-mcp) does not have proper parent and process group, and if I exit mcpproxy app, the process will become zombie.
  4. Dumbris commented on Sep 15, 2025

    @Dumbris
    Member

    @tzutoo I have tried to reproduce the bug with zai-mcp-server. I caught only one case when mcpproxy didn’t stop the first container before starting the second. Unfortunately, I haven’t found a reliable way to reproduce this issue. However, I improved Docker termination handling.
    A new version is available:
    v0.8.3 give it a try.

    Config for z_ai server that works for me:

    "mcpServers": [
        {
          "name": "zai-mcp-server",
          "command": "npx",
          "args": [
            "-y",
            "@z_ai/mcp-server"
          ],
          "env": {
            "Z_AI_API_KEY": "xxx-xxxxxx",
            "Z_AI_MODE": "ZAI"
          },
          "enabled": true,
          "quarantined": false,
          "created": "2025-09-05T16:19:48.736497+03:00",
          "updated": "2025-09-15T21:25:30.795705+03:00",
          "isolation": {
            "enabled": true,
            "image": "node:22"
          }
        }
      ],
    
    

    Docker isolation is enabled by default if you have Docker installed. If it’s not available, isolation will be skipped with warnings in the logs.

    If you want to disable Docker isolation, you can change the isolation section for specific server:

    "isolation": {
      "enabled": false
    }
    

    For me, this also works.

    Regarding 3:

    The mcp-go library’s stdio transport doesn’t expose process group management. I have PR #61 with process group assignment and proper termination. I will release it after testing.

  5. Dumbris commented on Sep 16, 2025

    @Dumbris
    Member

    Released version 0.8.4 with process group management

  6. Dumbris commented on Dec 21, 2025

    @Dumbris
    Member

    Closing this issue due to inactivity. Feel free to reopen it if you’re still experiencing the issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions