mcp-scraper 0.26.2 → 0.26.3

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.
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  HttpMcpToolExecutor,
4
- MemoryMcpToolExecutor,
4
+ MEMORY_TOOL_SCHEMAS,
5
5
  SERVER_INSTRUCTIONS,
6
6
  registerBrowserAgentMcpTools,
7
7
  registerMemoryMcpTools,
8
8
  registerPaaExtractorMcpTools,
9
9
  registerSerpIntelligenceCaptureTools
10
- } from "../chunk-QO2TRJ3L.js";
10
+ } from "../chunk-73YM3DEB.js";
11
11
  import "../chunk-R7EETU7Z.js";
12
12
  import "../chunk-MTSBI7ZH.js";
13
13
  import {
@@ -16,7 +16,7 @@ import {
16
16
  import "../chunk-XGIPATLV.js";
17
17
  import {
18
18
  PACKAGE_VERSION
19
- } from "../chunk-V37MZON3.js";
19
+ } from "../chunk-27VXTOD2.js";
20
20
  import "../chunk-4767BA2O.js";
21
21
  import "../chunk-M2S27J6Z.js";
22
22
  import "../chunk-ICT7DDHL.js";
@@ -27,6 +27,65 @@ import { homedir } from "os";
27
27
  import { join } from "path";
28
28
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
29
29
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
30
+
31
+ // src/mcp/hosted-memory-mcp-tool-executor.ts
32
+ var publicToolNameByUpstreamName = new Map(
33
+ MEMORY_TOOL_SCHEMAS.map((schema) => [schema.upstreamName, schema.id])
34
+ );
35
+ function parseJsonRpcEnvelope(text) {
36
+ const payloads = text.split("\n").filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trim()).filter(Boolean);
37
+ if (!payloads.length) return JSON.parse(text);
38
+ for (const payload of payloads) {
39
+ const parsed = JSON.parse(payload);
40
+ if (parsed.result || parsed.error) return parsed;
41
+ }
42
+ throw new Error("hosted MCP returned no JSON-RPC result");
43
+ }
44
+ function errorResult(message) {
45
+ return {
46
+ content: [{ type: "text", text: JSON.stringify({ ok: false, error: message }) }],
47
+ isError: true
48
+ };
49
+ }
50
+ var HostedMemoryMcpToolExecutor = class {
51
+ baseUrl;
52
+ apiKey;
53
+ constructor(baseUrl2, apiKey2) {
54
+ this.baseUrl = baseUrl2.replace(/\/$/, "");
55
+ this.apiKey = apiKey2;
56
+ }
57
+ async callMemoryTool(upstreamName, args) {
58
+ const publicToolName = publicToolNameByUpstreamName.get(upstreamName);
59
+ if (!publicToolName) return errorResult(`unknown memory tool: ${upstreamName}`);
60
+ try {
61
+ const res = await fetch(`${this.baseUrl}/mcp`, {
62
+ method: "POST",
63
+ headers: {
64
+ "content-type": "application/json",
65
+ accept: "application/json, text/event-stream",
66
+ "x-api-key": this.apiKey
67
+ },
68
+ body: JSON.stringify({
69
+ jsonrpc: "2.0",
70
+ id: `memory:${publicToolName}`,
71
+ method: "tools/call",
72
+ params: { name: publicToolName, arguments: args }
73
+ })
74
+ });
75
+ const text = await res.text();
76
+ if (!res.ok) return errorResult(`hosted memory ${publicToolName} failed (HTTP ${res.status})`);
77
+ const envelope = parseJsonRpcEnvelope(text);
78
+ if (envelope.error) {
79
+ return errorResult(envelope.error.message ?? `hosted memory ${publicToolName} failed`);
80
+ }
81
+ return envelope.result ?? errorResult(`hosted memory ${publicToolName} returned no result`);
82
+ } catch (err) {
83
+ return errorResult(err instanceof Error ? err.message : `hosted memory ${publicToolName} call failed`);
84
+ }
85
+ }
86
+ };
87
+
88
+ // bin/mcp-stdio-server.ts
30
89
  var forceStdio = process.argv.includes("--stdio") || process.env.MCP_SCRAPER_FORCE_STDIO === "1";
31
90
  var interactiveTerminal = Boolean(process.stdin.isTTY && process.stdout.isTTY);
32
91
  var wantsHelp = process.argv.includes("--help") || process.argv.includes("-h");
@@ -63,7 +122,7 @@ var httpExecutor = new HttpMcpToolExecutor(baseUrl, apiKey);
63
122
  registerPaaExtractorMcpTools(server, httpExecutor);
64
123
  registerSerpIntelligenceCaptureTools(server, httpExecutor);
65
124
  registerBrowserAgentMcpTools(server, { baseUrl, apiKey, consoleBaseUrl });
66
- registerMemoryMcpTools(server, new MemoryMcpToolExecutor(baseUrl, apiKey));
125
+ registerMemoryMcpTools(server, new HostedMemoryMcpToolExecutor(baseUrl, apiKey));
67
126
  var transport = new StdioServerTransport();
68
127
  async function main() {
69
128
  await server.connect(transport);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../bin/mcp-stdio-server.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { HttpMcpToolExecutor } from '../src/mcp/http-mcp-tool-executor.js'\nimport { registerBrowserAgentMcpTools } from '../src/mcp/browser-agent-mcp-server.js'\nimport { registerPaaExtractorMcpTools, registerSerpIntelligenceCaptureTools } from '../src/mcp/paa-mcp-server.js'\nimport { registerMemoryMcpTools } from '../src/mcp/memory-mcp-server.js'\nimport { MemoryMcpToolExecutor } from '../src/mcp/memory-mcp-tool-executor.js'\nimport { SERVER_INSTRUCTIONS } from '../src/mcp/server-instructions.js'\nimport { renderInstallTerminal } from '../src/install-terminal.js'\nimport { PACKAGE_VERSION } from '../src/version.js'\n\nconst forceStdio =\n process.argv.includes('--stdio') ||\n process.env.MCP_SCRAPER_FORCE_STDIO === '1'\nconst interactiveTerminal = Boolean(process.stdin.isTTY && process.stdout.isTTY)\nconst wantsHelp = process.argv.includes('--help') || process.argv.includes('-h')\n\nif (!forceStdio && (interactiveTerminal || wantsHelp)) {\n const noColor =\n process.argv.includes('--no-color') ||\n process.env.NO_COLOR !== undefined ||\n process.env.FORCE_COLOR === '0' ||\n !process.stdout.isTTY\n\n process.stdout.write(renderInstallTerminal({\n version: PACKAGE_VERSION,\n color: !noColor,\n apiKeyConfigured: Boolean(process.env.MCP_SCRAPER_API_KEY?.trim()),\n }))\n process.exit(0)\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.MCP_SCRAPER_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.mcp-scraper-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n void 0\n }\n }\n return undefined\n}\n\nconst apiKey = (\n process.env.MCP_SCRAPER_API_KEY ??\n process.env.MCP_SCRAPER_KEY ??\n process.env.MCP_API_KEY ??\n readApiKeyFile()\n)?.trim()\nif (!apiKey) {\n process.stderr.write('MCP_SCRAPER_API_KEY env var or ~/.mcp-scraper-key is required\\n')\n process.exit(1)\n}\n\nconst baseUrl = process.env.MCP_SCRAPER_BASE_URL?.trim() || process.env.MCP_BASE_URL?.trim() || 'https://mcpscraper.dev'\nconst consoleBaseUrl = process.env.BROWSER_AGENT_CONSOLE_URL?.trim() || baseUrl\nconst server = new McpServer({ name: 'mcp-scraper', version: PACKAGE_VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\nconst httpExecutor = new HttpMcpToolExecutor(baseUrl, apiKey)\nregisterPaaExtractorMcpTools(server, httpExecutor)\nregisterSerpIntelligenceCaptureTools(server, httpExecutor)\nregisterBrowserAgentMcpTools(server, { baseUrl, apiKey, consoleBaseUrl })\nregisterMemoryMcpTools(server, new MemoryMcpToolExecutor(baseUrl, apiKey))\n\nconst transport = new StdioServerTransport()\n\nasync function main() {\n await server.connect(transport)\n}\n\nmain().catch(err => {\n process.stderr.write(`${err instanceof Error ? err.message : String(err)}\\n`)\n process.exit(1)\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AAUrC,IAAM,aACJ,QAAQ,KAAK,SAAS,SAAS,KAC/B,QAAQ,IAAI,4BAA4B;AAC1C,IAAM,sBA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AAI,oBAAoB,SAAS,MAAM;AAC5D,6BAA6B,QAAQ,YAAY;AACjD,qCAAqC,QAAQ,YAAY;AACzD,6BAA6B,QAAQ,EAAE,SAAS,QAAQ,eAAe,CAAC;AACxE,uBAAuB,QAAQ,IAAI,sBAAsB,SAAS,MAAM,CAAC;AAEzE,IAAM,YAAY,IAAI,qBAAqB;AAE3C,eAAe,OAAO;AACpB,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,KAAK,EAAE,MAAM,SAAO;AAClB,UAAQ,OAAO,MAAM,GAAG,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,CAAI;AAC5E,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../bin/mcp-stdio-server.ts","../../src/mcp/hosted-memory-mcp-tool-executor.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { HttpMcpToolExecutor } from '../src/mcp/http-mcp-tool-executor.js'\nimport { registerBrowserAgentMcpTools } from '../src/mcp/browser-agent-mcp-server.js'\nimport { registerPaaExtractorMcpTools, registerSerpIntelligenceCaptureTools } from '../src/mcp/paa-mcp-server.js'\nimport { registerMemoryMcpTools } from '../src/mcp/memory-mcp-server.js'\nimport { HostedMemoryMcpToolExecutor } from '../src/mcp/hosted-memory-mcp-tool-executor.js'\nimport { SERVER_INSTRUCTIONS } from '../src/mcp/server-instructions.js'\nimport { renderInstallTerminal } from '../src/install-terminal.js'\nimport { PACKAGE_VERSION } from '../src/version.js'\n\nconst forceStdio =\n process.argv.includes('--stdio') ||\n process.env.MCP_SCRAPER_FORCE_STDIO === '1'\nconst interactiveTerminal = Boolean(process.stdin.isTTY && process.stdout.isTTY)\nconst wantsHelp = process.argv.includes('--help') || process.argv.includes('-h')\n\nif (!forceStdio && (interactiveTerminal || wantsHelp)) {\n const noColor =\n process.argv.includes('--no-color') ||\n process.env.NO_COLOR !== undefined ||\n process.env.FORCE_COLOR === '0' ||\n !process.stdout.isTTY\n\n process.stdout.write(renderInstallTerminal({\n version: PACKAGE_VERSION,\n color: !noColor,\n apiKeyConfigured: Boolean(process.env.MCP_SCRAPER_API_KEY?.trim()),\n }))\n process.exit(0)\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.MCP_SCRAPER_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.mcp-scraper-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n void 0\n }\n }\n return undefined\n}\n\nconst apiKey = (\n process.env.MCP_SCRAPER_API_KEY ??\n process.env.MCP_SCRAPER_KEY ??\n process.env.MCP_API_KEY ??\n readApiKeyFile()\n)?.trim()\nif (!apiKey) {\n process.stderr.write('MCP_SCRAPER_API_KEY env var or ~/.mcp-scraper-key is required\\n')\n process.exit(1)\n}\n\nconst baseUrl = process.env.MCP_SCRAPER_BASE_URL?.trim() || process.env.MCP_BASE_URL?.trim() || 'https://mcpscraper.dev'\nconst consoleBaseUrl = process.env.BROWSER_AGENT_CONSOLE_URL?.trim() || baseUrl\nconst server = new McpServer({ name: 'mcp-scraper', version: PACKAGE_VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\nconst httpExecutor = new HttpMcpToolExecutor(baseUrl, apiKey)\nregisterPaaExtractorMcpTools(server, httpExecutor)\nregisterSerpIntelligenceCaptureTools(server, httpExecutor)\nregisterBrowserAgentMcpTools(server, { baseUrl, apiKey, consoleBaseUrl })\nregisterMemoryMcpTools(server, new HostedMemoryMcpToolExecutor(baseUrl, apiKey))\n\nconst transport = new StdioServerTransport()\n\nasync function main() {\n await server.connect(transport)\n}\n\nmain().catch(err => {\n process.stderr.write(`${err instanceof Error ? err.message : String(err)}\\n`)\n process.exit(1)\n})\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport { MEMORY_TOOL_SCHEMAS } from './memory-tool-schemas.js'\n\nconst publicToolNameByUpstreamName = new Map(\n MEMORY_TOOL_SCHEMAS.map(schema => [schema.upstreamName, schema.id]),\n)\n\ninterface JsonRpcEnvelope {\n result?: CallToolResult\n error?: { code?: number; message?: string }\n}\n\nfunction parseJsonRpcEnvelope(text: string): JsonRpcEnvelope {\n const payloads = text\n .split('\\n')\n .filter(line => line.startsWith('data:'))\n .map(line => line.slice(5).trim())\n .filter(Boolean)\n\n if (!payloads.length) return JSON.parse(text) as JsonRpcEnvelope\n\n for (const payload of payloads) {\n const parsed = JSON.parse(payload) as JsonRpcEnvelope\n if (parsed.result || parsed.error) return parsed\n }\n throw new Error('hosted MCP returned no JSON-RPC result')\n}\n\nfunction errorResult(message: string): CallToolResult {\n return {\n content: [{ type: 'text', text: JSON.stringify({ ok: false, error: message }) }],\n isError: true,\n }\n}\n\n/**\n * Stdio-only bridge for memory tools. It deliberately calls the hosted aggregate\n * MCP surface so local clients execute the same registered tool implementation\n * and output contract as https://mcpscraper.dev/mcp.\n */\nexport class HostedMemoryMcpToolExecutor {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(baseUrl: string, apiKey: string) {\n this.baseUrl = baseUrl.replace(/\\/$/, '')\n this.apiKey = apiKey\n }\n\n async callMemoryTool(upstreamName: string, args: Record<string, unknown>): Promise<CallToolResult> {\n const publicToolName = publicToolNameByUpstreamName.get(upstreamName)\n if (!publicToolName) return errorResult(`unknown memory tool: ${upstreamName}`)\n\n try {\n const res = await fetch(`${this.baseUrl}/mcp`, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n accept: 'application/json, text/event-stream',\n 'x-api-key': this.apiKey,\n },\n body: JSON.stringify({\n jsonrpc: '2.0',\n id: `memory:${publicToolName}`,\n method: 'tools/call',\n params: { name: publicToolName, arguments: args },\n }),\n })\n const text = await res.text()\n if (!res.ok) return errorResult(`hosted memory ${publicToolName} failed (HTTP ${res.status})`)\n\n const envelope = parseJsonRpcEnvelope(text)\n if (envelope.error) {\n return errorResult(envelope.error.message ?? `hosted memory ${publicToolName} failed`)\n }\n return envelope.result ?? errorResult(`hosted memory ${publicToolName} returned no result`)\n } catch (err) {\n return errorResult(err instanceof Error ? err.message : `hosted memory ${publicToolName} call failed`)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;;;ACFrC,IAAM,+BAA+B,IAAI;AAAA,EACvC,oBAAoB,IAAI,YAAU,CAAC,OAAO,cAAc,OAAO,EAAE,CAAC;AACpE;AAOA,SAAS,qBAAqB,MAA+B;AAC3D,QAAM,WAAW,KACd,MAAM,IAAI,EACV,OAAO,UAAQ,KAAK,WAAW,OAAO,CAAC,EACvC,IAAI,UAAQ,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,EAChC,OAAO,OAAO;AAEjB,MAAI,CAAC,SAAS,OAAQ,QAAO,KAAK,MAAM,IAAI;AAE5C,aAAW,WAAW,UAAU;AAC9B,UAAM,SAAS,KAAK,MAAM,OAAO;AACjC,QAAI,OAAO,UAAU,OAAO,MAAO,QAAO;AAAA,EAC5C;AACA,QAAM,IAAI,MAAM,wCAAwC;AAC1D;AAEA,SAAS,YAAY,SAAiC;AACpD,SAAO;AAAA,IACL,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,KAAK,UAAU,EAAE,IAAI,OAAO,OAAO,QAAQ,CAAC,EAAE,CAAC;AAAA,IAC/E,SAAS;AAAA,EACX;AACF;AAOO,IAAM,8BAAN,MAAkC;AAAA,EACtB;AAAA,EACA;AAAA,EAEjB,YAAYA,UAAiBC,SAAgB;AAC3C,SAAK,UAAUD,SAAQ,QAAQ,OAAO,EAAE;AACxC,SAAK,SAASC;AAAA,EAChB;AAAA,EAEA,MA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AACpB,QAAM,OAAO,QAAQ,SAAS;AAChC;AAEA,KAAK,EAAE,MAAM,SAAO;AAClB,UAAQ,OAAO,MAAM,GAAG,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,CAAI;AAC5E,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["baseUrl","apiKey"]}
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var PACKAGE_VERSION = "0.26.3";
3
+
4
+ export {
5
+ PACKAGE_VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-27VXTOD2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.26.3'\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-XGIPATLV.js";
20
20
  import {
21
21
  PACKAGE_VERSION
22
- } from "./chunk-V37MZON3.js";
22
+ } from "./chunk-27VXTOD2.js";
23
23
  import {
24
24
  MC_PER_CREDIT
25
25
  } from "./chunk-4767BA2O.js";
@@ -9995,42 +9995,6 @@ function registerMemoryMcpTools(server, executor) {
9995
9995
  }
9996
9996
  }
9997
9997
 
9998
- // src/mcp/memory-mcp-tool-executor.ts
9999
- var MemoryMcpToolExecutor = class {
10000
- baseUrl;
10001
- apiKey;
10002
- constructor(baseUrl, apiKey) {
10003
- this.baseUrl = baseUrl.replace(/\/$/, "");
10004
- this.apiKey = apiKey;
10005
- }
10006
- async callMemoryTool(toolName, args) {
10007
- try {
10008
- const res = await fetch(`${this.baseUrl}/memory/mcp-call`, {
10009
- method: "POST",
10010
- headers: {
10011
- "content-type": "application/json",
10012
- "x-api-key": this.apiKey
10013
- },
10014
- body: JSON.stringify({ toolName, args })
10015
- });
10016
- const data = await res.json().catch(() => null);
10017
- if (!res.ok) {
10018
- const message = data?.error ?? `memory ${toolName} failed (HTTP ${res.status})`;
10019
- return { content: [{ type: "text", text: message }], isError: true };
10020
- }
10021
- const result = data ?? { ok: false, error: `memory ${toolName} returned no result` };
10022
- return {
10023
- content: [{ type: "text", text: JSON.stringify(result) }],
10024
- structuredContent: result,
10025
- isError: false
10026
- };
10027
- } catch (err) {
10028
- const message = err instanceof Error ? err.message : `memory ${toolName} call failed`;
10029
- return { content: [{ type: "text", text: message }], isError: true };
10030
- }
10031
- }
10032
- };
10033
-
10034
9998
  export {
10035
9999
  harvestTimeoutBudget,
10036
10000
  sanitizeAttempts,
@@ -10051,7 +10015,7 @@ export {
10051
10015
  HttpMcpToolExecutor,
10052
10016
  exportFanout,
10053
10017
  registerBrowserAgentMcpTools,
10054
- registerMemoryMcpTools,
10055
- MemoryMcpToolExecutor
10018
+ MEMORY_TOOL_SCHEMAS,
10019
+ registerMemoryMcpTools
10056
10020
  };
10057
- //# sourceMappingURL=chunk-QO2TRJ3L.js.map
10021
+ //# sourceMappingURL=chunk-73YM3DEB.js.map