crw-mcp 0.40.0 → 0.42.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.
- package/bin/install.js +19 -1
- package/package.json +5 -5
- package/skills/SKILL.md +37 -1
package/bin/install.js
CHANGED
|
@@ -15,7 +15,11 @@ const {
|
|
|
15
15
|
home,
|
|
16
16
|
} = require("./agents.js");
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
// `--api-key=value` and `--api-key value` mean the same thing.
|
|
19
|
+
const args = process.argv.slice(2).flatMap((a) => {
|
|
20
|
+
const m = /^(--api-key|--api-url)=(.*)$/.exec(a);
|
|
21
|
+
return m ? [m[1], m[2]] : [a];
|
|
22
|
+
});
|
|
19
23
|
|
|
20
24
|
function argValue(flag) {
|
|
21
25
|
const i = args.indexOf(flag);
|
|
@@ -45,6 +49,20 @@ registers the "crw" MCP server. Run \`crw-mcp init\` for the skill only.
|
|
|
45
49
|
process.exit(0);
|
|
46
50
|
}
|
|
47
51
|
|
|
52
|
+
// Anything unrecognised stops here: ignoring it would turn a typo, or a flag
|
|
53
|
+
// this command does not have (such as --dry-run), into a real install.
|
|
54
|
+
const VALUE_FLAGS = ["--api-key", "--api-url"];
|
|
55
|
+
const KNOWN_FLAGS = ["--all", "--from-config", ...AGENTS.map((a) => a.flag)];
|
|
56
|
+
for (let i = 0; i < args.length; i++) {
|
|
57
|
+
if (VALUE_FLAGS.includes(args[i])) {
|
|
58
|
+
i++;
|
|
59
|
+
} else if (!KNOWN_FLAGS.includes(args[i])) {
|
|
60
|
+
console.error(`crw-mcp install: unknown argument "${args[i]}". Nothing was installed.`);
|
|
61
|
+
console.error("Run `npx crw-mcp@latest install --help` to see the options.");
|
|
62
|
+
process.exit(2);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
48
66
|
const fromConfig = args.includes("--from-config");
|
|
49
67
|
const apiKey = fromConfig ? null : getApiKey(args);
|
|
50
68
|
const apiUrl = argValue("--api-url") || (apiKey ? "https://api.fastcrw.com" : null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crw-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "MCP server for CRW web scraper — scrape, crawl, map, extract, search, and PDF-parse tools for AI agents",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"author": "fastCRW <hello@fastcrw.com>",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"skills/SKILL.md"
|
|
39
39
|
],
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"crw-mcp-darwin-x64": "0.
|
|
42
|
-
"crw-mcp-darwin-arm64": "0.
|
|
43
|
-
"crw-mcp-linux-x64": "0.
|
|
44
|
-
"crw-mcp-linux-arm64": "0.
|
|
41
|
+
"crw-mcp-darwin-x64": "0.42.0",
|
|
42
|
+
"crw-mcp-darwin-arm64": "0.42.0",
|
|
43
|
+
"crw-mcp-linux-x64": "0.42.0",
|
|
44
|
+
"crw-mcp-linux-arm64": "0.42.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/skills/SKILL.md
CHANGED
|
@@ -45,7 +45,7 @@ Scrape a single URL and return clean content.
|
|
|
45
45
|
|
|
46
46
|
Parameters:
|
|
47
47
|
- `url` (required) — The URL to scrape
|
|
48
|
-
- `formats` — Output formats: `markdown` (default), `html`, `links`, `images`
|
|
48
|
+
- `formats` — Output formats: `markdown` (default), `html`, `plainText`, `links`, `images`
|
|
49
49
|
- `onlyMainContent` — Strip navs/footers/sidebars. Default: `true`
|
|
50
50
|
- `includeTags` — Only include content matching these CSS selectors (e.g. `["article", "main"]`)
|
|
51
51
|
- `excludeTags` — Exclude content matching these CSS selectors (e.g. `["nav", "footer"]`)
|
|
@@ -154,6 +154,36 @@ Parameters:
|
|
|
154
154
|
- `parsers` — Document parsers to apply. Default: `["pdf"]`
|
|
155
155
|
- `maxLength` — Truncate output to this many chars. `0` = unbounded. Default: ~15 000
|
|
156
156
|
|
|
157
|
+
### crw_find_data
|
|
158
|
+
|
|
159
|
+
Cloud (proxy) mode only. Find structured data sources from named public APIs (papers, packages, registries, music metadata). Use it before `crw_get_data`; use `crw_search` for open web search instead.
|
|
160
|
+
|
|
161
|
+
Parameters:
|
|
162
|
+
- `query`: Words to match against source names and descriptions
|
|
163
|
+
- `category`: Only sources in this category (e.g. `"Research"`)
|
|
164
|
+
- `provider`: Only this provider
|
|
165
|
+
- `limit`: Results per page (1 to 50). Default: `10`
|
|
166
|
+
- `offset`: Results to skip; pass `nextOffset` for the next page
|
|
167
|
+
|
|
168
|
+
Returns: `{ "items": [{ "provider", "capability", "requiredOptions", "optionalOptions", "keyRequired", "keyConfigured", ... }], "total", "nextOffset" }`. `keyConfigured` appears on sources that run on the user's machine with their own key, and says whether that key is stored.
|
|
169
|
+
|
|
170
|
+
### crw_get_data
|
|
171
|
+
|
|
172
|
+
Cloud (proxy) mode only. Call one data source capability and get its JSON.
|
|
173
|
+
|
|
174
|
+
Parameters:
|
|
175
|
+
- `provider` (required): Provider id from `crw_find_data`
|
|
176
|
+
- `capability` (required): Capability id from `crw_find_data`
|
|
177
|
+
- `options`: Object of string, number or boolean values; include every name in `requiredOptions`
|
|
178
|
+
|
|
179
|
+
Returns: `{ "provider", "capability", "creditsUsed", "provenance": { "source", "upstreamUrl", "licence", "attributionText", ... }, "data": ... }`. Pass `provenance.licence` and `attributionText` on when you use the data.
|
|
180
|
+
|
|
181
|
+
Errors start with a code in brackets. When the source needs the user's own key:
|
|
182
|
+
- `[connector_key_missing]` or `[connector_origin_not_approved]`: Do not retry. Tell the user to run the command the error names in their own terminal (for example `npx -y crw-mcp connectors set-key <provider>`, or `crw connectors set-key <provider>` with the `crw` CLI). It shows where the key will be sent, asks them to approve, and reads the key from a hidden prompt. Never ask the user to paste the key into the chat. Once it is stored, call `crw_get_data` again; no restart is needed.
|
|
183
|
+
- `[invalid_options]`: Fix the options using `requiredOptions` / `optionalOptions` from `crw_find_data`.
|
|
184
|
+
- `[result_too_large]`: Narrow the options (a filter, fewer fields, a smaller page) and call again.
|
|
185
|
+
- `[data_sources_unavailable]`: The API has no data sources right now (or it is a self-hosted server); use `crw_search` or `crw_scrape` instead.
|
|
186
|
+
|
|
157
187
|
## Common Patterns
|
|
158
188
|
|
|
159
189
|
**Scrape a page for context:**
|
|
@@ -174,6 +204,12 @@ crw_check_crawl_status(id="...") → poll until completed
|
|
|
174
204
|
crw_search(query="your search query", limit=5)
|
|
175
205
|
```
|
|
176
206
|
|
|
207
|
+
**Get structured data from a named API (cloud mode):**
|
|
208
|
+
```
|
|
209
|
+
crw_find_data(query="economic time series") → provider, capability, requiredOptions
|
|
210
|
+
crw_get_data(provider="...", capability="...", options={...}) → data + provenance
|
|
211
|
+
```
|
|
212
|
+
|
|
177
213
|
**Search from the CLI (one-shot LLM-ready output):**
|
|
178
214
|
|
|
179
215
|
When the `crw` binary is available, prefer the native field projection
|