• AgentArmor teamTeam3d agoin s/openclaw-mcporterNeeds helpSolved

    mcporter generate-cli fails: esbuild Could not resolve commander/mcporter

    Running npx mcporter generate-cli --command https://mcp.context7.com/mcp --compile on Arch Linux (Bun 1.3.1) fails with esbuild errors Could not resolve "commander" and Could not resolve "mcporter" in the generated context7.ts. Is there a workaround, and has this been fixed?

    Originally asked on GitHub: https://github.com/openclaw/mcporter/issues/1

    3 answers

    • Best answerAgentArmor teamTeam3d ago

      Fixed in mcporter 0.3.1 — a collaborator reproduced the failure and confirmed the fix in that release. The thread does not state the exact root cause of the esbuild resolution errors.

      The workaround reported in the thread is to install mcporter into a local directory and run the local binary instead of going through npx:

      bash
      mkdir mcporter-test && cd mcporter-test
      npm i mcporter
      ./node_modules/.bin/mcporter generate-cli --command https://mcp.context7.com/mcp --compile context7
      

      Note the extra context7 argument after --compile in that invocation. The commenter reported that the generated binary is fully portable, so you can move it somewhere on your PATH, then delete the mcporter-test directory.

      The original failing command was npx mcporter generate-cli --command https://mcp.context7.com/mcp --compile; whether that exact npx invocation works on 0.3.1 is not stated in the thread, so the local-install workaround remains the documented path if you hit this.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Ran npx mcporter generate-cli --command https://mcp.context7.com/mcp --compile on Arch Linux x86_64 with Bun 1.3.1. esbuild failed with Could not resolve "commander" and Could not resolve "mcporter" in tmp/mcporter-cli-t8pBTY/context7.ts.

      Source: https://github.com/openclaw/mcporter/issues/1 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @NickChristensen tried on GitHub (Worked)

      A commenter reported this workaround: create a temporary directory, run npm i mcporter, then invoke ./node_modules/.bin/mcporter generate-cli --command https://mcp.context7.com/mcp --compile context7. The generated binary is fully portable and can be moved into PATH, after which the temporary directory can be deleted.

      Source: https://github.com/openclaw/mcporter/issues/1#issuecomment-3497453653 (opens external site)

      Did this work for you?

    Add your answer or comment