crw-mcp 0.21.3 → 0.22.0

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/bin/agents.js +14 -4
  2. package/package.json +5 -5
package/bin/agents.js CHANGED
@@ -75,6 +75,15 @@ function writeJson(file, obj) {
75
75
  * embedded binary needs no config) or {CRW_API_KEY, CRW_API_URL} for cloud.
76
76
  * Returns a short human label of what was done.
77
77
  */
78
+ // Spawn the MCP server via `npx -y crw-mcp` rather than a bare `crw-mcp`. A
79
+ // fresh `npx crw-mcp install` leaves NO `crw-mcp` on PATH (npx is ephemeral),
80
+ // so a bare command would give the agent a server it can't launch. npx resolves
81
+ // the launcher each spawn (first run downloads the native binary), so the
82
+ // config works with zero extra install steps. Matches the SaaS "MCP config"
83
+ // docs. Users who prefer the fast native binary can still swap in `crw-mcp`.
84
+ const MCP_CMD = "npx";
85
+ const MCP_ARGS = ["-y", "crw-mcp"];
86
+
78
87
  function installMcp(agent, env) {
79
88
  const m = agent.mcp;
80
89
  const hasEnv = Object.keys(env).length > 0;
@@ -82,7 +91,7 @@ function installMcp(agent, env) {
82
91
  if (m.kind === "claude-cli") {
83
92
  // add-json avoids the `-e` variadic-name pitfall and merges ~/.claude.json
84
93
  // (user scope) correctly. Idempotent-ish: remove a stale entry first.
85
- const server = { command: "crw-mcp", ...(hasEnv ? { env } : {}) };
94
+ const server = { command: MCP_CMD, args: MCP_ARGS, ...(hasEnv ? { env } : {}) };
86
95
  spawnSync("claude", ["mcp", "remove", "--scope", "user", "crw"], { stdio: "ignore" });
87
96
  const r = spawnSync(
88
97
  "claude",
@@ -101,7 +110,8 @@ function installMcp(agent, env) {
101
110
  cfg.mcpServers = cfg.mcpServers || {};
102
111
  cfg.mcpServers.crw = {
103
112
  ...(m.withType ? { type: "stdio" } : {}),
104
- command: "crw-mcp",
113
+ command: MCP_CMD,
114
+ args: MCP_ARGS,
105
115
  ...(hasEnv ? { env } : {}),
106
116
  };
107
117
  writeJson(file, cfg);
@@ -115,7 +125,7 @@ function installMcp(agent, env) {
115
125
  cfg.mcp = cfg.mcp || {};
116
126
  cfg.mcp.crw = {
117
127
  type: "local",
118
- command: ["crw-mcp"],
128
+ command: [MCP_CMD, ...MCP_ARGS],
119
129
  ...(hasEnv ? { environment: env } : {}),
120
130
  };
121
131
  writeJson(file, cfg);
@@ -137,7 +147,7 @@ function installMcp(agent, env) {
137
147
  ? "\n[mcp_servers.crw.env]\n" +
138
148
  Object.entries(env).map(([k, v]) => `${k} = "${v}"`).join("\n") + "\n"
139
149
  : "";
140
- const block = `\n[mcp_servers.crw]\ncommand = "crw-mcp"\n${envLines}`;
150
+ const block = `\n[mcp_servers.crw]\ncommand = "${MCP_CMD}"\nargs = [${MCP_ARGS.map((a) => `"${a}"`).join(", ")}]\n${envLines}`;
141
151
  fs.mkdirSync(path.dirname(file), { recursive: true });
142
152
  fs.appendFileSync(file, (toml && !toml.endsWith("\n") ? "\n" : "") + block, "utf-8");
143
153
  return `MCP → ${m.file}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crw-mcp",
3
- "version": "0.21.3",
3
+ "version": "0.22.0",
4
4
  "description": "MCP server for CRW web scraper — scrape, crawl, map, search, and PDF-parse tools for AI agents",
5
5
  "license": "AGPL-3.0",
6
6
  "homepage": "https://github.com/us/crw",
@@ -32,9 +32,9 @@
32
32
  "skills/SKILL.md"
33
33
  ],
34
34
  "optionalDependencies": {
35
- "crw-mcp-darwin-x64": "0.21.3",
36
- "crw-mcp-darwin-arm64": "0.21.3",
37
- "crw-mcp-linux-x64": "0.21.3",
38
- "crw-mcp-linux-arm64": "0.21.3"
35
+ "crw-mcp-darwin-x64": "0.22.0",
36
+ "crw-mcp-darwin-arm64": "0.22.0",
37
+ "crw-mcp-linux-x64": "0.22.0",
38
+ "crw-mcp-linux-arm64": "0.22.0"
39
39
  }
40
40
  }