#2689·mcp-use

cli: mcp-use servers env --help displays root servers help instead of env command help

Author: rohith500Created Sep 28, 2026Updated Sep 28, 2026
LabelsTypeScriptserver

Summary

When running mcp-use servers env --help or mcp-use servers env -h, the CLI outputs the top-level mcp-use servers commands help rather than the documented env command help (COMMAND_HELP.env).

Reproduction

Execute:

bash
mcp-use servers env --help

Expected output:

Usage: mcp-use servers env <list|set|unset> [options]

Commands:
  list <server>             List keys and metadata; values are never returned
  set <server> <KEY=VALUE> Create or update a value
  unset <server> <key>     Delete a value

Run mcp-use servers env <command> --help for all options.

Actual output:

Usage: mcp-use servers <command> [options]

Manage cloud servers and environment variables.

Commands:
  list                         List servers
  get <id-or-slug>             Show one server
  update <id-or-slug>          Update server metadata or build configuration
  delete <id-or-slug>          Delete a server
  env list <server>            List environment variable metadata
  env set <server> <KEY=VALUE> Create or update an environment variable
  env unset <server> <key>     Delete an environment variable

Run mcp-use servers <command> --help for all options.
...

The user is shown the generic commands list, which says Run mcp-use servers <command> --help for all options, creating an unhelpful loop.

Root Cause

In libraries/typescript/packages/cli/src/commands/servers.ts:

typescript
if (argv.some((token) => token === "--help" || token === "-h")) {
  const key =
    argv[0] === "env" && argv[1] !== undefined
      ? `env ${argv[1]}`
      : (argv[0] ?? "");
  process.stdout.write(`${COMMAND_HELP[key] ?? HELP}\n`);
  return 0;
}

When argv is ["env", "--help"], argv[1] is "--help". The condition argv[1] !== undefined is true, computing key = "env --help". Since COMMAND_HELP["env --help"] is undefined, it defaults to root HELP. As a consequence, COMMAND_HELP.env is unreachable.