Class ClaudeDesktopConfigMerger

java.lang.Object
com.eqixiac.equinix.mcp.server.ClaudeDesktopConfigMerger

public final class ClaudeDesktopConfigMerger extends Object
Registers this server in a Claude Desktop claude_desktop_config.json by merging into the mcpServers.equinix entry. connect-claude-desktop.ps1 (Windows) and connect-claude-desktop.sh (macOS, Linux) both run it from the built server jar, so the merge behaves the same on every platform:
java -cp equinix-sdk-java-<v>-mcp-server.jar com.eqixiac.equinix.mcp.server.ClaudeDesktopConfigMerger \
     --config <claude_desktop_config.json> --jar <server jar> --repo <repository dir> [--embed-credentials]

Merge rules for mcpServers.equinix:

  • every other server, top-level setting and unknown field is kept;
  • command is kept when set (for example an absolute java path), else java;
  • args: the value after -jar is replaced with the new jar (or -jar <jar> is prepended); other arguments (--toolsets, JVM options) are kept; a previous --env-file pair is replaced;
  • env: every variable is kept (EQUINIX_SANDBOX, EQUINIX_MCP_TOOLSETS, ...) except the two credential keys, which are removed by default;
  • by default no secret is written: cwd is set to the repository and --env-file <repo>/.env.local is added, so the server reads the credentials from .env.local (the flag also covers hosts that ignore cwd). With --embed-credentials the two keys are copied into env instead, in plain text.

Before writing, the existing file is copied to <config>.bak-<timestamp>. A file that is not a JSON object is left untouched and the run fails. No credential value is ever printed.

  • Field Details

  • Method Details

    • main

      public static void main(String[] args)
      Runs the merge; exits non-zero with a message on stderr on failure.
      Parameters:
      args - --config <file> --jar <file> --repo <dir> [--embed-credentials]