@moor-sh/mcp 0.23.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moor-sh/mcp",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "MCP server for moor - lets AI agents (Claude Code, Cursor, etc.) manage your moor projects via the moor HTTP API.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/index.ts CHANGED
@@ -395,6 +395,13 @@ server.registerTool(
395
395
  const p = await resolveProject(project);
396
396
  const query = no_cache ? "?nocache=true" : "";
397
397
  const res = await apiPost(`/api/projects/${p.id}/run${query}`);
398
+ // /run can fail BEFORE opening the SSE stream — resolver validation,
399
+ // drain mode, invalid URL, credential_not_active. Those land as a
400
+ // plain JSON or text body that readSSE walks without matching any
401
+ // event:/data: lines, returning empty everything. Without this guard
402
+ // the tool would silently report "Rebuild complete." on a failed build.
403
+ // Mirrors the existing moor_deploy guard at the /run call site.
404
+ if (!res.ok) throw new Error(`[run] ${await res.text()}`);
398
405
  const { logs, error, structuredError } = await readSSE(res);
399
406
  // #119: a classified failure (today: source_credential_required) gets
400
407
  // returned as isError with a structured payload the agent can branch