shantycrawl-mcp 0.1.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/LICENSE +21 -0
- package/README.md +116 -0
- package/dist/firecrawl.d.ts +9 -0
- package/dist/firecrawl.d.ts.map +1 -0
- package/dist/firecrawl.js +90 -0
- package/dist/firecrawl.js.map +1 -0
- package/dist/handlers.d.ts +3 -0
- package/dist/handlers.d.ts.map +1 -0
- package/dist/handlers.js +61 -0
- package/dist/handlers.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas.d.ts +8 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +69 -0
- package/dist/schemas.js.map +1 -0
- package/dist/state.d.ts +6 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +20 -0
- package/dist/state.js.map +1 -0
- package/dist/tools.d.ts +5 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +280 -0
- package/dist/tools.js.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 schlemperdev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# shantycrawl-mcp
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/shantycrawl-mcp)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
**A lean MCP server for Firecrawl with lazy-loading tool architecture.**
|
|
7
|
+
|
|
8
|
+
Replaces the official `firecrawl-mcp` (28 tools loaded upfront) with just **5 base tools** always visible — advanced tools load **only when you enable them** via `tool_enable`. Drastically reduces context consumption in AI coding sessions.
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Run directly with npx — no install needed
|
|
14
|
+
FIRECRAWL_API_URL=http://localhost:3002 npx shantycrawl-mcp
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Point `FIRECRAWL_API_URL` at your own Firecrawl instance (Docker, cloud, or self-hosted). Defaults to `http://localhost:3002`.
|
|
18
|
+
|
|
19
|
+
## Tools
|
|
20
|
+
|
|
21
|
+
### Always Available (5)
|
|
22
|
+
|
|
23
|
+
| Tool | Description |
|
|
24
|
+
|------|-------------|
|
|
25
|
+
| `scrape` | Extract markdown from a URL |
|
|
26
|
+
| `crawl` | Crawl a website for page content |
|
|
27
|
+
| `search` | Search the web |
|
|
28
|
+
| `tool_enable` | Load an advanced tool into the session |
|
|
29
|
+
| `tool_disable` | Unload an advanced tool from the session |
|
|
30
|
+
|
|
31
|
+
### Lazy-Loaded via `tool_enable` (23)
|
|
32
|
+
|
|
33
|
+
`tool_enable map` adds `map` to your tool list for the session. Works for any of:
|
|
34
|
+
|
|
35
|
+
**Discovery:** `map`, `extract`, `parse`, `check_crawl_status`
|
|
36
|
+
|
|
37
|
+
**AI Agent:** `agent`, `agent_status`
|
|
38
|
+
|
|
39
|
+
**Browser Interaction:** `interact`, `interact_stop`
|
|
40
|
+
|
|
41
|
+
**Feedback:** `search_feedback`, `feedback`
|
|
42
|
+
|
|
43
|
+
**Research (arXiv):** `research_search_papers`, `research_inspect_paper`, `research_read_paper`, `research_related_papers`, `research_search_github`
|
|
44
|
+
|
|
45
|
+
**Monitoring:** `monitor_create`, `monitor_check`, `monitor_checks`, `monitor_delete`, `monitor_get`, `monitor_list`, `monitor_run`, `monitor_update`
|
|
46
|
+
|
|
47
|
+
## Configuration
|
|
48
|
+
|
|
49
|
+
### Claude Desktop
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"firecrawl": {
|
|
55
|
+
"command": "npx",
|
|
56
|
+
"args": ["shantycrawl-mcp"],
|
|
57
|
+
"env": {
|
|
58
|
+
"FIRECRAWL_API_URL": "http://localhost:3002"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### OpenCode
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcp": {
|
|
70
|
+
"firecrawl": {
|
|
71
|
+
"type": "local",
|
|
72
|
+
"command": ["npx", "shantycrawl-mcp"],
|
|
73
|
+
"environment": {
|
|
74
|
+
"FIRECRAWL_API_URL": "http://localhost:3002"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Environment Variables
|
|
82
|
+
|
|
83
|
+
| Variable | Default | Description |
|
|
84
|
+
|----------|---------|-------------|
|
|
85
|
+
| `FIRECRAWL_API_URL` | `http://localhost:3002` | Your Firecrawl API base URL |
|
|
86
|
+
|
|
87
|
+
## Why shantycrawl-mcp?
|
|
88
|
+
|
|
89
|
+
The official `firecrawl-mcp` registers all 28 tool schemas upfront in every `tools/list` response. Each schema carries verbose descriptions and niche parameters. Over a session, this burns significant context tokens.
|
|
90
|
+
|
|
91
|
+
**shantycrawl-mcp** solves this with a simple pattern:
|
|
92
|
+
|
|
93
|
+
1. By default, only 5 essential tools appear — minimal schemas, minimal tokens.
|
|
94
|
+
2. Run `tool_enable <name>` to activate any advanced tool for the session.
|
|
95
|
+
3. The server emits `notifications/tools/list_changed`, and the client sees only what you need.
|
|
96
|
+
|
|
97
|
+
## Development
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
git clone https://github.com/shanty/shantycrawl-mcp.git
|
|
101
|
+
cd shantycrawl-mcp
|
|
102
|
+
npm install
|
|
103
|
+
npm run build
|
|
104
|
+
npm start
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Architecture
|
|
108
|
+
|
|
109
|
+
- **Stdio transport** — pure `@modelcontextprotocol/sdk`, no FastMCP
|
|
110
|
+
- **In-memory state** — tracks active tools per session
|
|
111
|
+
- **HTTP bridge** — calls your Firecrawl API via native `fetch`
|
|
112
|
+
- **Zero runtime dependencies** beyond the MCP SDK
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function hasRoute(toolName: string): boolean;
|
|
2
|
+
export declare function executeTool(toolName: string, args: Record<string, unknown>): Promise<{
|
|
3
|
+
content: {
|
|
4
|
+
type: "text";
|
|
5
|
+
text: string;
|
|
6
|
+
}[];
|
|
7
|
+
isError?: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=firecrawl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firecrawl.d.ts","sourceRoot":"","sources":["../src/firecrawl.ts"],"names":[],"mappings":"AA0DA,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA+C5J"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const API_BASE = process.env.FIRECRAWL_API_URL ?? "http://localhost:3002";
|
|
2
|
+
const ROUTES = {
|
|
3
|
+
scrape: { method: "POST", path: "/v2/scrape", extractData: (d) => d?.markdown ?? "" },
|
|
4
|
+
crawl: { method: "POST", path: "/v1/crawl", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
5
|
+
search: { method: "POST", path: "/v2/search", extractData: formatSearchResults },
|
|
6
|
+
map: { method: "POST", path: "/v1/map", extractData: (d) => d?.links?.join("\n") ?? "" },
|
|
7
|
+
extract: { method: "POST", path: "/v2/extract", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
8
|
+
parse: { method: "POST", path: "/v2/parse", extractData: (d) => d?.markdown ?? "" },
|
|
9
|
+
feedback: { method: "POST", path: "/v2/feedback", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
10
|
+
search_feedback: { method: "POST", path: "/v2/feedback", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
11
|
+
check_crawl_status: { method: "GET", path: (a) => `/v1/crawl/${a.id}`, extractData: (d) => serializeCrawlStatus(d) },
|
|
12
|
+
agent: { method: "POST", path: "/v2/agent", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
13
|
+
agent_status: { method: "GET", path: (a) => `/v2/agent/${a.id}`, extractData: (d) => JSON.stringify(d, null, 2) },
|
|
14
|
+
interact: { method: "POST", path: (a) => `/v2/browser/${a.scrapeId}/interact`, extractData: (d) => JSON.stringify(d, null, 2) },
|
|
15
|
+
interact_stop: { method: "POST", path: (a) => `/v2/browser/${a.scrapeId}/stop`, extractData: (d) => JSON.stringify(d, null, 2) },
|
|
16
|
+
research_search_papers: { method: "POST", path: "/v1/research/papers", extractData: (d) => formatPapers(d) },
|
|
17
|
+
research_inspect_paper: { method: "POST", path: "/v1/research/inspect", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
18
|
+
research_read_paper: { method: "POST", path: "/v1/research/read", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
19
|
+
research_related_papers: { method: "POST", path: "/v1/research/related", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
20
|
+
research_search_github: { method: "POST", path: "/v1/research/github", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
21
|
+
monitor_create: { method: "POST", path: "/v2/monitor", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
22
|
+
monitor_list: { method: "GET", path: "/v2/monitor", extractData: (d) => JSON.stringify(d, null, 2) },
|
|
23
|
+
monitor_get: { method: "GET", path: (a) => `/v2/monitor/${a.id}`, extractData: (d) => JSON.stringify(d, null, 2) },
|
|
24
|
+
monitor_delete: { method: "DELETE", path: (a) => `/v1/monitor/${a.id}`, extractData: () => "Monitor deleted." },
|
|
25
|
+
monitor_run: { method: "POST", path: (a) => `/v2/monitor/${a.id}/run`, extractData: (d) => JSON.stringify(d, null, 2) },
|
|
26
|
+
monitor_update: { method: "PATCH", path: (a) => `/v2/monitor/${a.id}`, extractData: (d) => JSON.stringify(d, null, 2) },
|
|
27
|
+
monitor_checks: { method: "GET", path: (a) => `/v2/monitor/${a.id}/checks`, extractData: (d) => JSON.stringify(d, null, 2) },
|
|
28
|
+
monitor_check: { method: "GET", path: (a) => `/v2/monitor/${a.id}/checks/${a.checkId}`, extractData: (d) => JSON.stringify(d, null, 2) },
|
|
29
|
+
};
|
|
30
|
+
function formatSearchResults(data) {
|
|
31
|
+
const web = data?.web;
|
|
32
|
+
if (!web || web.length === 0)
|
|
33
|
+
return "No results found.";
|
|
34
|
+
return web.map((r) => `## [${r.title}](${r.url})\n${r.description}`).join("\n\n");
|
|
35
|
+
}
|
|
36
|
+
function serializeCrawlStatus(data) {
|
|
37
|
+
const d = data;
|
|
38
|
+
const pages = d.data ?? [];
|
|
39
|
+
const content = pages.map((p) => p?.markdown ?? JSON.stringify(p, null, 2)).join("\n\n---\n\n");
|
|
40
|
+
return `Status: ${d.status ?? "unknown"} (${d.completed ?? 0}/${d.total ?? 0})\n\n${content}`;
|
|
41
|
+
}
|
|
42
|
+
function formatPapers(data) {
|
|
43
|
+
const results = data?.results;
|
|
44
|
+
if (!results || results.length === 0)
|
|
45
|
+
return "No papers found.";
|
|
46
|
+
return results.map((p) => `## ${p.title}\nID: ${p.arxivId ?? "N/A"}\n${p.abstract ?? ""}`).join("\n\n");
|
|
47
|
+
}
|
|
48
|
+
export function hasRoute(toolName) {
|
|
49
|
+
return toolName in ROUTES;
|
|
50
|
+
}
|
|
51
|
+
export async function executeTool(toolName, args) {
|
|
52
|
+
const route = ROUTES[toolName];
|
|
53
|
+
if (!route) {
|
|
54
|
+
return { content: [{ type: "text", text: `Unknown tool: ${toolName}` }], isError: true };
|
|
55
|
+
}
|
|
56
|
+
const path = typeof route.path === "function" ? route.path(args) : route.path;
|
|
57
|
+
const url = `${API_BASE}${path}`;
|
|
58
|
+
try {
|
|
59
|
+
const fetchOptions = { method: route.method, headers: {} };
|
|
60
|
+
if (route.method === "POST" || route.method === "PATCH") {
|
|
61
|
+
fetchOptions.headers["Content-Type"] = "application/json";
|
|
62
|
+
fetchOptions.body = JSON.stringify(args);
|
|
63
|
+
}
|
|
64
|
+
const response = await fetch(url, fetchOptions);
|
|
65
|
+
if (!response.ok) {
|
|
66
|
+
const text = await response.text();
|
|
67
|
+
return { content: [{ type: "text", text: `HTTP ${response.status}: ${text}` }], isError: true };
|
|
68
|
+
}
|
|
69
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
70
|
+
let result;
|
|
71
|
+
if (contentType.includes("application/json")) {
|
|
72
|
+
result = await response.json();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
result = await response.text();
|
|
76
|
+
}
|
|
77
|
+
const jsonResult = result;
|
|
78
|
+
if (jsonResult && typeof jsonResult === "object" && "success" in jsonResult && jsonResult.success === false) {
|
|
79
|
+
return { content: [{ type: "text", text: jsonResult.error ?? "Request failed." }], isError: true };
|
|
80
|
+
}
|
|
81
|
+
const data = jsonResult?.data ?? jsonResult;
|
|
82
|
+
const text = route.extractData ? route.extractData(data) : JSON.stringify(data, null, 2);
|
|
83
|
+
return { content: [{ type: "text", text }] };
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
87
|
+
return { content: [{ type: "text", text: `Request failed: ${msg}` }], isError: true };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=firecrawl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firecrawl.js","sourceRoot":"","sources":["../src/firecrawl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,uBAAuB,CAAC;AAU1E,MAAM,MAAM,GAA0B;IACpC,MAAM,EAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAQ,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAA2B,EAAE,QAAQ,IAAI,EAAE,EAAE;IAC7H,KAAK,EAAU,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAS,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,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O,EAAE,IAAI,EAAE,CAAC;IACxF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAUxE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2DlD"}
|
package/dist/handlers.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ListToolsRequestSchema, CallToolRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { baseTools } from "./schemas.js";
|
|
3
|
+
import { getAdvancedTool, hasAdvancedTool } from "./tools.js";
|
|
4
|
+
import { getActiveTools, activateTool, deactivateTool } from "./state.js";
|
|
5
|
+
import { executeTool, hasRoute } from "./firecrawl.js";
|
|
6
|
+
export function setupHandlers(server) {
|
|
7
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
8
|
+
const tools = [...baseTools];
|
|
9
|
+
for (const name of getActiveTools()) {
|
|
10
|
+
const tool = getAdvancedTool(name);
|
|
11
|
+
if (tool)
|
|
12
|
+
tools.push(tool);
|
|
13
|
+
}
|
|
14
|
+
return { tools };
|
|
15
|
+
});
|
|
16
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
17
|
+
const { name, arguments: args } = request.params;
|
|
18
|
+
switch (name) {
|
|
19
|
+
case "tool_enable": {
|
|
20
|
+
const toolName = args?.tool_name;
|
|
21
|
+
if (!toolName || !hasAdvancedTool(toolName)) {
|
|
22
|
+
return {
|
|
23
|
+
content: [{ type: "text", text: `Unknown tool: ${toolName}` }],
|
|
24
|
+
isError: true,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
if (activateTool(toolName)) {
|
|
28
|
+
await server.sendToolListChanged();
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: "text", text: `Tool '${toolName}' activated.` }],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
case "tool_disable": {
|
|
35
|
+
const toolName = args?.tool_name;
|
|
36
|
+
if (!toolName) {
|
|
37
|
+
return {
|
|
38
|
+
content: [{ type: "text", text: "Missing tool_name argument." }],
|
|
39
|
+
isError: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (deactivateTool(toolName)) {
|
|
43
|
+
await server.sendToolListChanged();
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
content: [{ type: "text", text: `Tool '${toolName}' deactivated.` }],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
default: {
|
|
50
|
+
if (!hasRoute(name)) {
|
|
51
|
+
return {
|
|
52
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
53
|
+
isError: true,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return executeTool(name, (args ?? {}));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,KAAK,GAAG,CAAC,GAAG,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,EAAE,6BAA6B,EAAE,CAAC;wBAChE,OAAO,EAAE,IAAI;qBACd,CAAC;gBACJ,CAAC;gBACD,IAAI,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC7B,MAAM,MAAM,CAAC,mBAAmB,EAAE,CAAC;gBACrC,CAAC;gBACD,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,QAAQ,gBAAgB,EAAE,CAAC;iBACrE,CAAC;YACJ,CAAC;YAED,OAAO,CAAC,CAAC,CAAC;gBACR,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpB,OAAO;wBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,IAAI,EAAE,EAAE,CAAC;wBAC1D,OAAO,EAAE,IAAI;qBACd,CAAC;gBACJ,CAAC;gBACD,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAA4B,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { setupHandlers } from "./handlers.js";
|
|
5
|
+
const serverInfo = {
|
|
6
|
+
name: "shantycrawl-mcp",
|
|
7
|
+
version: "0.1.0",
|
|
8
|
+
};
|
|
9
|
+
const server = new Server(serverInfo, {
|
|
10
|
+
capabilities: {
|
|
11
|
+
tools: {},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
setupHandlers(server);
|
|
15
|
+
async function main() {
|
|
16
|
+
const transport = new StdioServerTransport();
|
|
17
|
+
await server.connect(transport);
|
|
18
|
+
}
|
|
19
|
+
main().catch((error) => {
|
|
20
|
+
console.error("Fatal error:", error);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,EAAE;IACpC,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAC;AAEH,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtB,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
export declare const scrapeTool: Tool;
|
|
3
|
+
export declare const crawlTool: Tool;
|
|
4
|
+
export declare const searchTool: Tool;
|
|
5
|
+
export declare const toolEnableTool: Tool;
|
|
6
|
+
export declare const toolDisableTool: Tool;
|
|
7
|
+
export declare const baseTools: Tool[];
|
|
8
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D,eAAO,MAAM,UAAU,EAAE,IAaxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,IAYvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,IAWxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,IAU5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,IAU7B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,IAAI,EAM3B,CAAC"}
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const scrapeTool = {
|
|
2
|
+
name: "scrape",
|
|
3
|
+
description: "Extract markdown from a URL",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
url: { type: "string", description: "Target URL" },
|
|
8
|
+
formats: { type: "array", items: { type: "string" }, description: "Output format(s)" },
|
|
9
|
+
onlyMainContent: { type: "boolean", description: "Main content only" },
|
|
10
|
+
waitFor: { type: "number", description: "JS wait (ms)" },
|
|
11
|
+
},
|
|
12
|
+
required: ["url"],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export const crawlTool = {
|
|
16
|
+
name: "crawl",
|
|
17
|
+
description: "Crawl a website for page content",
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
url: { type: "string", description: "Start URL" },
|
|
22
|
+
maxDepth: { type: "number", description: "Max depth" },
|
|
23
|
+
limit: { type: "number", description: "Max pages" },
|
|
24
|
+
},
|
|
25
|
+
required: ["url"],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export const searchTool = {
|
|
29
|
+
name: "search",
|
|
30
|
+
description: "Search the web",
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
query: { type: "string", description: "Search query" },
|
|
35
|
+
limit: { type: "number", description: "Max results" },
|
|
36
|
+
},
|
|
37
|
+
required: ["query"],
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const toolEnableTool = {
|
|
41
|
+
name: "tool_enable",
|
|
42
|
+
description: "Activate an advanced tool for this session",
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
tool_name: { type: "string", description: "Tool name" },
|
|
47
|
+
},
|
|
48
|
+
required: ["tool_name"],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
export const toolDisableTool = {
|
|
52
|
+
name: "tool_disable",
|
|
53
|
+
description: "Deactivate an advanced tool for this session",
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
tool_name: { type: "string", description: "Tool name" },
|
|
58
|
+
},
|
|
59
|
+
required: ["tool_name"],
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
export const baseTools = [
|
|
63
|
+
scrapeTool,
|
|
64
|
+
crawlTool,
|
|
65
|
+
searchTool,
|
|
66
|
+
toolEnableTool,
|
|
67
|
+
toolDisableTool,
|
|
68
|
+
];
|
|
69
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,EAAE,EAA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,EAAE,4CAA4C;IACzD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE;SACxD;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,8CAA8C;IAC3D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE;SACxD;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAW;IAC/B,UAAU;IACV,SAAS;IACT,UAAU;IACV,cAAc;IACd,eAAe;CAChB,CAAC"}
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function getActiveTools(): string[];
|
|
2
|
+
export declare function isToolActive(name: string): boolean;
|
|
3
|
+
export declare function activateTool(name: string): boolean;
|
|
4
|
+
export declare function deactivateTool(name: string): boolean;
|
|
5
|
+
export declare function resetTools(): void;
|
|
6
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIlD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC"}
|
package/dist/state.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const activeTools = new Set();
|
|
2
|
+
export function getActiveTools() {
|
|
3
|
+
return Array.from(activeTools);
|
|
4
|
+
}
|
|
5
|
+
export function isToolActive(name) {
|
|
6
|
+
return activeTools.has(name);
|
|
7
|
+
}
|
|
8
|
+
export function activateTool(name) {
|
|
9
|
+
if (activeTools.has(name))
|
|
10
|
+
return false;
|
|
11
|
+
activeTools.add(name);
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
export function deactivateTool(name) {
|
|
15
|
+
return activeTools.delete(name);
|
|
16
|
+
}
|
|
17
|
+
export function resetTools() {
|
|
18
|
+
activeTools.clear();
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;AAEtC,MAAM,UAAU,cAAc;IAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,WAAW,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
export declare function getAdvancedTool(name: string): Tool | undefined;
|
|
3
|
+
export declare function getAdvancedToolNames(): string[];
|
|
4
|
+
export declare function hasAdvancedTool(name: string): boolean;
|
|
5
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAuS/D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAE9D;AAED,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
const ADVANCED_TOOLS = {
|
|
2
|
+
map: {
|
|
3
|
+
name: "map",
|
|
4
|
+
description: "Discover all URLs on a site",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
url: { type: "string", description: "Site URL" },
|
|
9
|
+
search: { type: "string", description: "Filter by search" },
|
|
10
|
+
},
|
|
11
|
+
required: ["url"],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
search_feedback: {
|
|
15
|
+
name: "search_feedback",
|
|
16
|
+
description: "Rate search result quality",
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
searchId: { type: "string", description: "Search job ID" },
|
|
21
|
+
rating: { type: "string", description: "good|bad|partial" },
|
|
22
|
+
},
|
|
23
|
+
required: ["searchId", "rating"],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
feedback: {
|
|
27
|
+
name: "feedback",
|
|
28
|
+
description: "Send feedback on a job result",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: "object",
|
|
31
|
+
properties: {
|
|
32
|
+
endpoint: { type: "string", description: "search|scrape|parse|map" },
|
|
33
|
+
jobId: { type: "string", description: "Job ID" },
|
|
34
|
+
rating: { type: "string", description: "good|bad|partial" },
|
|
35
|
+
note: { type: "string", description: "Context note" },
|
|
36
|
+
},
|
|
37
|
+
required: ["endpoint", "jobId", "rating"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
check_crawl_status: {
|
|
41
|
+
name: "check_crawl_status",
|
|
42
|
+
description: "Check crawl job progress",
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
id: { type: "string", description: "Crawl job ID" },
|
|
47
|
+
},
|
|
48
|
+
required: ["id"],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
extract: {
|
|
52
|
+
name: "extract",
|
|
53
|
+
description: "Extract structured data from URLs",
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
urls: { type: "array", items: { type: "string" }, description: "URLs to extract from" },
|
|
58
|
+
prompt: { type: "string", description: "Extraction prompt" },
|
|
59
|
+
},
|
|
60
|
+
required: ["urls"],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
agent: {
|
|
64
|
+
name: "agent",
|
|
65
|
+
description: "Autonomous web research agent",
|
|
66
|
+
inputSchema: {
|
|
67
|
+
type: "object",
|
|
68
|
+
properties: {
|
|
69
|
+
prompt: { type: "string", description: "Research goal" },
|
|
70
|
+
urls: { type: "array", items: { type: "string" }, description: "Seed URLs" },
|
|
71
|
+
},
|
|
72
|
+
required: ["prompt"],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
agent_status: {
|
|
76
|
+
name: "agent_status",
|
|
77
|
+
description: "Check agent job status",
|
|
78
|
+
inputSchema: {
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
id: { type: "string", description: "Agent job ID" },
|
|
82
|
+
},
|
|
83
|
+
required: ["id"],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
interact: {
|
|
87
|
+
name: "interact",
|
|
88
|
+
description: "Click/fill/navigate a scraped page",
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: "object",
|
|
91
|
+
properties: {
|
|
92
|
+
scrapeId: { type: "string", description: "Scrape session ID" },
|
|
93
|
+
prompt: { type: "string", description: "Action description" },
|
|
94
|
+
},
|
|
95
|
+
required: ["scrapeId"],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
interact_stop: {
|
|
99
|
+
name: "interact_stop",
|
|
100
|
+
description: "End an interact session",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: "object",
|
|
103
|
+
properties: {
|
|
104
|
+
scrapeId: { type: "string", description: "Scrape session ID" },
|
|
105
|
+
},
|
|
106
|
+
required: ["scrapeId"],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
parse: {
|
|
110
|
+
name: "parse",
|
|
111
|
+
description: "Parse a local file to markdown",
|
|
112
|
+
inputSchema: {
|
|
113
|
+
type: "object",
|
|
114
|
+
properties: {
|
|
115
|
+
filePath: { type: "string", description: "Local file path" },
|
|
116
|
+
formats: { type: "array", items: { type: "string" }, description: "Output format(s)" },
|
|
117
|
+
},
|
|
118
|
+
required: ["filePath"],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
research_inspect_paper: {
|
|
122
|
+
name: "research_inspect_paper",
|
|
123
|
+
description: "Get paper metadata by ID",
|
|
124
|
+
inputSchema: {
|
|
125
|
+
type: "object",
|
|
126
|
+
properties: {
|
|
127
|
+
paperId: { type: "string", description: "arXiv/PMC/DOI ID" },
|
|
128
|
+
},
|
|
129
|
+
required: ["paperId"],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
research_read_paper: {
|
|
133
|
+
name: "research_read_paper",
|
|
134
|
+
description: "Read paper passages by topic",
|
|
135
|
+
inputSchema: {
|
|
136
|
+
type: "object",
|
|
137
|
+
properties: {
|
|
138
|
+
paperId: { type: "string", description: "arXiv/PMC/DOI ID" },
|
|
139
|
+
question: { type: "string", description: "What to find" },
|
|
140
|
+
},
|
|
141
|
+
required: ["paperId", "question"],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
research_related_papers: {
|
|
145
|
+
name: "research_related_papers",
|
|
146
|
+
description: "Find related papers via citations",
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: "object",
|
|
149
|
+
properties: {
|
|
150
|
+
seed_ids: { type: "array", items: { type: "string" }, description: "Anchor paper IDs" },
|
|
151
|
+
intent: { type: "string", description: "Research angle" },
|
|
152
|
+
},
|
|
153
|
+
required: ["seed_ids", "intent"],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
research_search_github: {
|
|
157
|
+
name: "research_search_github",
|
|
158
|
+
description: "Search GitHub issues and READMEs",
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: "object",
|
|
161
|
+
properties: {
|
|
162
|
+
query: { type: "string", description: "Search query" },
|
|
163
|
+
},
|
|
164
|
+
required: ["query"],
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
research_search_papers: {
|
|
168
|
+
name: "research_search_papers",
|
|
169
|
+
description: "Search arXiv papers by topic",
|
|
170
|
+
inputSchema: {
|
|
171
|
+
type: "object",
|
|
172
|
+
properties: {
|
|
173
|
+
query: { type: "string", description: "Topic description" },
|
|
174
|
+
k: { type: "number", description: "Max results" },
|
|
175
|
+
},
|
|
176
|
+
required: ["query"],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
monitor_check: {
|
|
180
|
+
name: "monitor_check",
|
|
181
|
+
description: "Get page-level diff for a check",
|
|
182
|
+
inputSchema: {
|
|
183
|
+
type: "object",
|
|
184
|
+
properties: {
|
|
185
|
+
id: { type: "string", description: "Monitor ID" },
|
|
186
|
+
checkId: { type: "string", description: "Check ID" },
|
|
187
|
+
},
|
|
188
|
+
required: ["id", "checkId"],
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
monitor_checks: {
|
|
192
|
+
name: "monitor_checks",
|
|
193
|
+
description: "List historical checks for a monitor",
|
|
194
|
+
inputSchema: {
|
|
195
|
+
type: "object",
|
|
196
|
+
properties: {
|
|
197
|
+
id: { type: "string", description: "Monitor ID" },
|
|
198
|
+
},
|
|
199
|
+
required: ["id"],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
monitor_create: {
|
|
203
|
+
name: "monitor_create",
|
|
204
|
+
description: "Create a page change monitor",
|
|
205
|
+
inputSchema: {
|
|
206
|
+
type: "object",
|
|
207
|
+
properties: {
|
|
208
|
+
page: { type: "string", description: "URL to watch" },
|
|
209
|
+
pages: { type: "array", items: { type: "string" }, description: "Multiple URLs" },
|
|
210
|
+
goal: { type: "string", description: "What changes matter" },
|
|
211
|
+
name: { type: "string", description: "Monitor name" },
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
monitor_delete: {
|
|
216
|
+
name: "monitor_delete",
|
|
217
|
+
description: "Permanently delete a monitor",
|
|
218
|
+
inputSchema: {
|
|
219
|
+
type: "object",
|
|
220
|
+
properties: {
|
|
221
|
+
id: { type: "string", description: "Monitor ID" },
|
|
222
|
+
},
|
|
223
|
+
required: ["id"],
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
monitor_get: {
|
|
227
|
+
name: "monitor_get",
|
|
228
|
+
description: "Get monitor details by ID",
|
|
229
|
+
inputSchema: {
|
|
230
|
+
type: "object",
|
|
231
|
+
properties: {
|
|
232
|
+
id: { type: "string", description: "Monitor ID" },
|
|
233
|
+
},
|
|
234
|
+
required: ["id"],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
monitor_list: {
|
|
238
|
+
name: "monitor_list",
|
|
239
|
+
description: "List all monitors",
|
|
240
|
+
inputSchema: {
|
|
241
|
+
type: "object",
|
|
242
|
+
properties: {
|
|
243
|
+
limit: { type: "number", description: "Max results" },
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
monitor_run: {
|
|
248
|
+
name: "monitor_run",
|
|
249
|
+
description: "Trigger a monitor check now",
|
|
250
|
+
inputSchema: {
|
|
251
|
+
type: "object",
|
|
252
|
+
properties: {
|
|
253
|
+
id: { type: "string", description: "Monitor ID" },
|
|
254
|
+
},
|
|
255
|
+
required: ["id"],
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
monitor_update: {
|
|
259
|
+
name: "monitor_update",
|
|
260
|
+
description: "Update a monitor's config",
|
|
261
|
+
inputSchema: {
|
|
262
|
+
type: "object",
|
|
263
|
+
properties: {
|
|
264
|
+
id: { type: "string", description: "Monitor ID" },
|
|
265
|
+
body: { type: "object", description: "Fields to patch" },
|
|
266
|
+
},
|
|
267
|
+
required: ["id", "body"],
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
export function getAdvancedTool(name) {
|
|
272
|
+
return ADVANCED_TOOLS[name];
|
|
273
|
+
}
|
|
274
|
+
export function getAdvancedToolNames() {
|
|
275
|
+
return Object.keys(ADVANCED_TOOLS);
|
|
276
|
+
}
|
|
277
|
+
export function hasAdvancedTool(name) {
|
|
278
|
+
return name in ADVANCED_TOOLS;
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAEA,MAAM,cAAc,GAAyB;IAC3C,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,6BAA6B;QAC1C,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE;gBAChD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB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,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,IAAI,cAAc,CAAC;AAChC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shantycrawl-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Dynamic Firecrawl MCP server with lazy-loading tool architecture",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"shantycrawl-mcp": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/schlemperdev/shantycrawl-mcp.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"keywords": [
|
|
19
|
+
"mcp",
|
|
20
|
+
"firecrawl",
|
|
21
|
+
"web-search",
|
|
22
|
+
"modelcontextprotocol",
|
|
23
|
+
"claude",
|
|
24
|
+
"web-scraping"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"build": "npm run clean && tsc",
|
|
32
|
+
"start": "node dist/index.js",
|
|
33
|
+
"dev": "tsx src/index.ts"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@modelcontextprotocol/sdk": "^1.9.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^22.0.0",
|
|
40
|
+
"typescript": "^5.7.0"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
}
|
|
45
|
+
}
|