@acprompt/join 0.1.5 → 0.1.6

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.
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ const program = new Command();
15
15
  program
16
16
  .name("acprompt-join")
17
17
  .description("Smart installer for ACPrompt — wire any agent harness into the ACPrompt network via MCP.")
18
- .version("0.1.5");
18
+ .version("0.1.6");
19
19
  program
20
20
  .command("install")
21
21
  .description("Interactive: detect harness, mint token, write config, verify.")
@@ -1,3 +1,12 @@
1
1
  import type { HarnessInstaller } from "./shared.js";
2
+ /**
3
+ * Build the Claude-Desktop-compatible MCP server entry for ACPrompt. See
4
+ * the file-top comment for why this shape (and not `{type:"http",...}`).
5
+ * Exported for unit testing.
6
+ */
7
+ export declare function buildClaudeDesktopEntry(opts: {
8
+ mcpUrl: string;
9
+ token: string;
10
+ }): Record<string, unknown>;
2
11
  export declare const claudeCodeInstaller: HarnessInstaller;
3
12
  //# sourceMappingURL=claude-code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/install/claude-code.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAoBpD,eAAO,MAAM,mBAAmB,EAAE,gBAwCjC,CAAC"}
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/install/claude-code.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAW1B;AAmBD,eAAO,MAAM,mBAAmB,EAAE,gBA4CjC,CAAC"}
@@ -8,10 +8,55 @@
8
8
  //
9
9
  // We always try (1) if a config path is known. If the user ALSO has the
10
10
  // CLI, we print the CLI hint after the file write as a second option.
11
+ //
12
+ // ============================================================================
13
+ // Claude Desktop config-shape trap (F6, 2026-04-20)
14
+ // ============================================================================
15
+ // Claude Desktop (Electron app) does NOT support the native `{type:"http",
16
+ // url, headers}` MCP shape that Claude Code CLI accepts. As of Apr 2026 the
17
+ // Desktop app is stdio-only; remote HTTP MCP servers must go through the
18
+ // `mcp-remote` shim which the Desktop app spawns as a local child process.
19
+ //
20
+ // v0.1.0–v0.1.5 wrote the Claude Code CLI shape into the Desktop config and
21
+ // Desktop silently skipped the entry with a dialog reading: "Some MCP
22
+ // servers could not be loaded — The following entries in
23
+ // claude_desktop_config.json are not valid MCP server configurations and
24
+ // were skipped: acprompt". No MCP tools surfaced inside Claude Desktop.
25
+ //
26
+ // Fix (v0.1.6): emit the `command: "npx"` + `args: [mcp-remote, url,
27
+ // --header, "Authorization:Bearer <token>"]` shape.
28
+ //
29
+ // Windows-safety notes baked into this shape:
30
+ // - Header separator is `:` with NO space before the value (mcp-remote
31
+ // splits on first colon, then trims). A missing space doesn't break
32
+ // HTTP parsing on the server side (RFC 7230 says OWS is optional).
33
+ // - Token is inlined in `args`, not substituted via `${ENV}` — Claude
34
+ // Desktop doesn't document env-var substitution in args, and relying on
35
+ // mcp-remote's internal substitution would make the config brittle
36
+ // across mcp-remote versions.
37
+ // - `-y` on npx auto-accepts the on-disk install prompt so first run
38
+ // doesn't hang waiting for stdin.
11
39
  import pc from "picocolors";
12
40
  import { promises as fs } from "node:fs";
13
41
  import path from "node:path";
14
42
  import { claudeDesktopConfigPath } from "../detect/claude-code.js";
43
+ /**
44
+ * Build the Claude-Desktop-compatible MCP server entry for ACPrompt. See
45
+ * the file-top comment for why this shape (and not `{type:"http",...}`).
46
+ * Exported for unit testing.
47
+ */
48
+ export function buildClaudeDesktopEntry(opts) {
49
+ return {
50
+ command: "npx",
51
+ args: [
52
+ "-y",
53
+ "mcp-remote",
54
+ opts.mcpUrl,
55
+ "--header",
56
+ `Authorization:Bearer ${opts.token}`,
57
+ ],
58
+ };
59
+ }
15
60
  async function mergeConfig(configPath, entry) {
16
61
  let current = {};
17
62
  try {
@@ -36,16 +81,14 @@ export const claudeCodeInstaller = async (ic) => {
36
81
  platform: ic.platform,
37
82
  env: process.env,
38
83
  });
39
- const entry = {
40
- type: "http",
41
- url: ic.mcpUrl,
42
- headers: { Authorization: `Bearer ${ic.token}` },
43
- };
84
+ const entry = buildClaudeDesktopEntry({ mcpUrl: ic.mcpUrl, token: ic.token });
44
85
  if (!ic.dryRun) {
45
86
  await mergeConfig(configPath, entry);
46
87
  }
47
88
  wrote.push(configPath);
48
89
  console.log(pc.green(`Wrote ACPrompt MCP server entry to ${configPath}.`));
90
+ console.log(pc.dim(" Shape: mcp-remote stdio shim (Claude Desktop does not accept native HTTP MCP yet)."));
91
+ console.log(pc.dim(" Restart Claude Desktop to load the new server."));
49
92
  const cliHit = (ic.detection.evidence ?? []).some((e) => e.includes("Claude Code CLI"));
50
93
  if (cliHit) {
51
94
  console.log("");
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/install/claude-code.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,2BAA2B;AAC3B,8DAA8D;AAC9D,oEAAoE;AACpE,uEAAuE;AACvE,yEAAyE;AACzE,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AAEtE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,KAAK,UAAU,WAAW,CACxB,UAAkB,EAClB,KAA8B;IAE9B,IAAI,OAAO,GAA4B,EAAE,CAAC;IAC1C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,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C;QAChB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CACT,EAAE,CAAC,GAAG,CACJ,6BAA6B,EAAE,CAAC,MAAM,sDAAsD,CAC7F,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acprompt/join",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Smart installer for ACPrompt — one-shot MCP config for any agent harness.",
5
5
  "keywords": [
6
6
  "acprompt",