From c535e4a7c8195caedb5cc589677dfe420828df7c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 25 May 2026 17:15:09 +0000 Subject: [PATCH] Recommend npm install / npm run build / node build/index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most stdio Node/TS MCP repos (linkedin-mcpserver, typical fastmcp projects, etc.) follow the same pattern: tsc compiles src/*.ts to build/*.js and the executable entry is build/index.js. Surface that as the recommended setup so users don't paste `npm run start:dev` (a long-running server command) into Build commands and break startup. - Wizard repository step: spawn-command placeholder is now `node build/index.js`; the Build commands help text recommends `npm install` + `npm run build`; one-click "⚡ Pre-fill Node/TS" button populates all three at once. - README "Part 3.5" walkthrough: new "Recommended for Node/TypeScript repos" callout with the field/value table, and an explicit warning not to put long-running server commands in Build commands. - README YAML example: switched to `node build/index.js` and the real LINKEDIN_CLIENT_ID / LINKEDIN_CLIENT_SECRET keys from the repo. --- README.md | 23 +++++++++++++++++------ frontend/app.py | 29 +++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7727e6c..f180c43 100755 --- a/README.md +++ b/README.md @@ -748,15 +748,26 @@ use a **repository provider**. mcpproxy will: - **Provider name** — e.g. `linkedin`. - **Git URL** — `https://github.com/felipfr/linkedin-mcpserver` (https or ssh). - **Ref** *(optional)* — branch, tag, or commit SHA. Defaults to the repo's default branch. - - **Build commands** — one per row, e.g. `npm install`, then `npm run build`. - - **Spawn command** — the stdio MCP launch command, e.g. `node dist/main.js`. Runs inside the workdir. + - **Build commands** — one per row. For most Node/TypeScript MCP repos: `npm install`, then `npm run build`. Click **⚡ Pre-fill Node/TS** to drop these in automatically along with the spawn command. + - **Spawn command** — the stdio MCP launch command. For the compiled-TS pattern above, use `node build/index.js` (the `npm run build` step compiles `src/*.ts` → `build/*.js`). Runs inside the workdir. 3. Click **Next** — mcpproxy clones, builds, and introspects. The tool list is auto-populated. +> **Recommended for Node/TypeScript repos** (covers `linkedin-mcpserver` and most fastmcp-style projects): +> +> | Field | Value | +> |---|---| +> | Build commands | `npm install`
`npm run build` | +> | Spawn command | `node build/index.js` | +> +> The **⚡ Pre-fill Node/TS** button in the wizard's Build commands header populates all three at once. + +> **Do not** put `npm run start:dev`, `npm start`, or any other long-running server command in **Build commands** — those go in **Spawn command**. Build commands must terminate; mcpproxy enforces a `MCPPROXY_BUILD_TIMEOUT` (default 600s) and aborts a hanging build. + #### YAML produced ```yaml package: - command: node dist/main.js # spawn command, run inside the workdir + command: node build/index.js # spawn command, run inside the workdir repository: url: https://github.com/felipfr/linkedin-mcpserver ref: main # optional @@ -765,9 +776,9 @@ repository: - npm install - npm run build env_keys: # auto-discovered from .env.example - - LINKEDIN_EMAIL # values live in MCP_ENV_FILE - - LINKEDIN_PASSWORD # (the proxy's .env) and are written - - LINKEDIN_LI_AT # into /.env on every build / spawn + - LINKEDIN_CLIENT_ID # values live in MCP_ENV_FILE + - LINKEDIN_CLIENT_SECRET # (the proxy's .env) and are written + # into /.env on every build / spawn tools: - name: search_jobs # advertised as linkedin__search_jobs description: Search LinkedIn job postings. diff --git a/frontend/app.py b/frontend/app.py index 9f2741e..a5a68af 100644 --- a/frontend/app.py +++ b/frontend/app.py @@ -1198,16 +1198,21 @@ async def index():
- +
-
e.g. npm install, npm run build. Do not put the long-running server start here (e.g. npm run start:dev) — that goes in Spawn command. Build commands re-run on every server start so ephemeral containers rebuild.
+
+ Recommended for Node/TypeScript repos: npm install then npm run build (then spawn with node build/index.js). Do not put a long-running server start here (e.g. npm run start:dev) — that goes in Spawn command. Build commands re-run on every server start so ephemeral containers rebuild. +
-
The long-running command that launches the stdio MCP server, run from inside the workdir after the build commands complete.
+ placeholder="node build/index.js"> +
The long-running command that launches the stdio MCP server, run from inside the workdir after the build commands complete. Common values: node build/index.js (compiled TS), npx tsx src/main.ts (un-compiled TS), python -m my_server.
Clicking Next clones the repo, parses .env.example (so its keys appear as secrets on the next step), runs the build commands, then introspects the spawn command to populate the tool list. If the build fails because secrets aren't set yet, you can still continue — the next server restart will re-build with the secrets in place.
@@ -2090,6 +2095,22 @@ async def index(): function wzAddRepoBuild() { _wzListAdd('wz-repo-builds-container', 'npm install'); } +// One-click Node/TypeScript defaults — covers the common case (e.g. the +// linkedin-mcpserver / typical fastmcp-style TS repos). +function wzPrefillRepoNodeTs() { + const container = document.getElementById('wz-repo-builds-container'); + container.innerHTML = ''; + _wzListAdd('wz-repo-builds-container', 'npm install'); + _wzListAdd('wz-repo-builds-container', 'npm run build'); + // Populate the two input slots we just appended + const inputs = container.querySelectorAll('input'); + if (inputs.length >= 2) { + inputs[0].value = 'npm install'; + inputs[1].value = 'npm run build'; + } + document.getElementById('wz-repo-cmd').value = 'node build/index.js'; +} + function wzSelectType(type) { wzType = type; document.querySelectorAll('.wizard-choice').forEach(el => el.classList.remove('selected'));