crispparse-mcp 1.0.1 → 1.0.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.
- package/index.js +154 -6
- package/index.js.bak.1795225873 +197 -0
- package/package.json +2 -2
- package/package.json.bak.1795225873 +21 -0
package/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
2
5
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
7
|
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
5
8
|
|
|
6
9
|
const API_URL = process.env.CRISPPARSE_API_URL || "https://api.crispparse.com/v1/extract";
|
|
10
|
+
const TRIAL_URL = process.env.CRISPPARSE_TRIAL_URL || API_URL.replace(/\/v1\/extract\/?$/, "/v1/trial/claim");
|
|
11
|
+
const VERIFY_URL = process.env.CRISPPARSE_VERIFY_URL || API_URL.replace(/\/v1\/extract\/?$/, "/v1/verify");
|
|
7
12
|
const DEFAULT_API_KEY = process.env.CRISPPARSE_API_KEY || "";
|
|
8
13
|
const DEFAULT_PAYMENT_SIGNATURE = process.env.CRISPPARSE_PAYMENT_SIGNATURE || "";
|
|
14
|
+
const AUTO_CLAIM_TRIAL = process.env.CRISPPARSE_AUTO_CLAIM_TRIAL !== "false";
|
|
15
|
+
const CACHE_FILE = path.join(os.homedir(), ".crispparse", "trial_token.json");
|
|
9
16
|
|
|
10
17
|
function safeJson(text) {
|
|
11
18
|
try {
|
|
@@ -15,8 +22,47 @@ function safeJson(text) {
|
|
|
15
22
|
}
|
|
16
23
|
}
|
|
17
24
|
|
|
25
|
+
function readCachedTrialToken() {
|
|
26
|
+
try {
|
|
27
|
+
const raw = fs.readFileSync(CACHE_FILE, "utf8");
|
|
28
|
+
const parsed = JSON.parse(raw);
|
|
29
|
+
if (parsed && typeof parsed.token === "string" && parsed.token.length > 0) {
|
|
30
|
+
return parsed.token;
|
|
31
|
+
}
|
|
32
|
+
} catch {}
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function writeCachedTrialToken(token) {
|
|
37
|
+
try {
|
|
38
|
+
fs.mkdirSync(path.dirname(CACHE_FILE), { recursive: true, mode: 0o700 });
|
|
39
|
+
fs.writeFileSync(CACHE_FILE, JSON.stringify({ token, claimed_at: new Date().toISOString() }, null, 2), { mode: 0o600 });
|
|
40
|
+
} catch {}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function clearCachedTrialToken() {
|
|
44
|
+
try {
|
|
45
|
+
fs.unlinkSync(CACHE_FILE);
|
|
46
|
+
} catch {}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function claimTrialToken(forceRefresh = false) {
|
|
50
|
+
if (!forceRefresh) {
|
|
51
|
+
const cached = readCachedTrialToken();
|
|
52
|
+
if (cached) return { token: cached, source: "cache" };
|
|
53
|
+
}
|
|
54
|
+
const res = await fetch(TRIAL_URL, { method: "POST" });
|
|
55
|
+
const text = await res.text();
|
|
56
|
+
const data = safeJson(text);
|
|
57
|
+
if (!res.ok || !data || typeof data.macaroon_token !== "string") {
|
|
58
|
+
throw new Error(typeof data === "object" && data?.detail ? data.detail : `Trial claim failed (${res.status}): ${text}`);
|
|
59
|
+
}
|
|
60
|
+
writeCachedTrialToken(data.macaroon_token);
|
|
61
|
+
return { token: data.macaroon_token, source: "claimed", details: data };
|
|
62
|
+
}
|
|
63
|
+
|
|
18
64
|
const server = new Server(
|
|
19
|
-
{ name: "crispparse-mcp-server", version: "1.0.
|
|
65
|
+
{ name: "crispparse-mcp-server", version: "1.0.3" },
|
|
20
66
|
{ capabilities: { tools: {} } }
|
|
21
67
|
);
|
|
22
68
|
|
|
@@ -24,35 +70,126 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
24
70
|
tools: [
|
|
25
71
|
{
|
|
26
72
|
name: "crispparse_extract",
|
|
27
|
-
description: "Extract clean, LLM-ready Markdown
|
|
73
|
+
description: "Extract clean, LLM-ready Markdown, structured JSON, or Hybrid output from any public URL using CrispParse's deterministic 3-tier waterfall (static HTTP, headless JS render, and self-healing CSS selectors) with C2PA provenance.",
|
|
28
74
|
inputSchema: {
|
|
29
75
|
type: "object",
|
|
30
76
|
properties: {
|
|
31
77
|
url: { type: "string", description: "The full http:// or https:// URL to extract." },
|
|
32
|
-
mode: {
|
|
78
|
+
mode: {
|
|
79
|
+
type: "string",
|
|
80
|
+
enum: ["markdown", "json", "hybrid"],
|
|
81
|
+
description: "Output format: 'markdown' (default), 'json' (structured fields/JSON-LD), or 'hybrid' (both Markdown and structured data)."
|
|
82
|
+
},
|
|
83
|
+
selectors: {
|
|
84
|
+
type: "object",
|
|
85
|
+
additionalProperties: { type: "string" },
|
|
86
|
+
description: "Optional map of field_name -> CSS selector (up to 30 fields). Automatically triggers Tier 2 JS rendering and Tier 3 self-healing selector recovery if needed."
|
|
87
|
+
},
|
|
88
|
+
bypass_cache: {
|
|
89
|
+
type: "boolean",
|
|
90
|
+
description: "Set true to bypass edge cache and force a fresh live extraction (defaults to false)."
|
|
91
|
+
},
|
|
33
92
|
api_key: { type: "string", description: "Optional CrispParse Macaroon bearer token (overrides CRISPPARSE_API_KEY)." },
|
|
34
93
|
payment_signature: { type: "string", description: "Optional x402 v2 PAYMENT-SIGNATURE Base USDC proof header (overrides CRISPPARSE_PAYMENT_SIGNATURE)." }
|
|
35
94
|
},
|
|
36
95
|
required: ["url"]
|
|
37
96
|
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "crispparse_claim_trial",
|
|
100
|
+
description: "Claim or retrieve a cached zero-config CrispParse trial Macaroon token (50 credits, 14-day TTL) for immediate extraction without manual signup.",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: "object",
|
|
103
|
+
properties: {
|
|
104
|
+
force_refresh: { type: "boolean", description: "Request a fresh trial token instead of returning the cached token." }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "crispparse_verify",
|
|
110
|
+
description: "Cryptographically verify a detached C2PA v2.4 provenance manifest returned by crispparse_extract.",
|
|
111
|
+
inputSchema: {
|
|
112
|
+
type: "object",
|
|
113
|
+
properties: {
|
|
114
|
+
provenance: {
|
|
115
|
+
type: "object",
|
|
116
|
+
description: "The 'provenance' object from a CrispParse extraction response."
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
required: ["provenance"]
|
|
120
|
+
}
|
|
38
121
|
}
|
|
39
122
|
]
|
|
40
123
|
}));
|
|
41
124
|
|
|
42
125
|
server.setRequestHandler(CallToolRequestSchema, async ({ params }) => {
|
|
126
|
+
if (params.name === "crispparse_claim_trial") {
|
|
127
|
+
try {
|
|
128
|
+
const result = await claimTrialToken(Boolean(params.arguments?.force_refresh));
|
|
129
|
+
return {
|
|
130
|
+
isError: false,
|
|
131
|
+
content: [{ type: "text", text: JSON.stringify({ status: "ok", source: result.source, macaroon_token: result.token, cache_path: CACHE_FILE }) }]
|
|
132
|
+
};
|
|
133
|
+
} catch (error) {
|
|
134
|
+
return {
|
|
135
|
+
isError: true,
|
|
136
|
+
content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (params.name === "crispparse_verify") {
|
|
142
|
+
const provenance = params.arguments?.provenance;
|
|
143
|
+
if (!provenance || typeof provenance !== "object" || Array.isArray(provenance)) {
|
|
144
|
+
return { isError: true, content: [{ type: "text", text: "Missing or invalid parameter: provenance object" }] };
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
const response = await fetch(VERIFY_URL, {
|
|
148
|
+
method: "POST",
|
|
149
|
+
headers: { "Content-Type": "application/json" },
|
|
150
|
+
body: JSON.stringify(provenance)
|
|
151
|
+
});
|
|
152
|
+
const bodyText = await response.text();
|
|
153
|
+
return { isError: !response.ok, content: [{ type: "text", text: bodyText }] };
|
|
154
|
+
} catch (error) {
|
|
155
|
+
return {
|
|
156
|
+
isError: true,
|
|
157
|
+
content: [{ type: "text", text: `CrispParse verify request failed: ${error instanceof Error ? error.message : String(error)}` }]
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
43
162
|
if (params.name !== "crispparse_extract") {
|
|
44
163
|
return { isError: true, content: [{ type: "text", text: `Unknown tool: ${params.name}` }] };
|
|
45
164
|
}
|
|
46
165
|
|
|
47
166
|
const targetUrl = params.arguments?.url;
|
|
48
|
-
const
|
|
49
|
-
const
|
|
167
|
+
const rawMode = params.arguments?.mode;
|
|
168
|
+
const mode = (rawMode === "json" || rawMode === "hybrid") ? rawMode : "markdown";
|
|
169
|
+
const rawSelectors = params.arguments?.selectors;
|
|
170
|
+
const selectors = (rawSelectors && typeof rawSelectors === "object" && !Array.isArray(rawSelectors) && Object.keys(rawSelectors).length > 0)
|
|
171
|
+
? rawSelectors
|
|
172
|
+
: undefined;
|
|
173
|
+
const bypassCache = Boolean(params.arguments?.bypass_cache);
|
|
174
|
+
|
|
175
|
+
let apiKey = (typeof params.arguments?.api_key === "string" && params.arguments.api_key) || DEFAULT_API_KEY;
|
|
50
176
|
const paymentSignature = (typeof params.arguments?.payment_signature === "string" && params.arguments.payment_signature) || DEFAULT_PAYMENT_SIGNATURE;
|
|
51
177
|
|
|
52
178
|
if (!targetUrl || typeof targetUrl !== "string") {
|
|
53
179
|
return { isError: true, content: [{ type: "text", text: "Missing required parameter: url" }] };
|
|
54
180
|
}
|
|
55
181
|
|
|
182
|
+
let usedTrialCache = false;
|
|
183
|
+
if (!apiKey && !paymentSignature && AUTO_CLAIM_TRIAL) {
|
|
184
|
+
try {
|
|
185
|
+
const trial = await claimTrialToken(false);
|
|
186
|
+
apiKey = trial.token;
|
|
187
|
+
usedTrialCache = true;
|
|
188
|
+
} catch {
|
|
189
|
+
// Fall through to unauthenticated request so the agent still receives the x402 402 payment challenge
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
56
193
|
try {
|
|
57
194
|
const headers = {
|
|
58
195
|
"Content-Type": "application/json",
|
|
@@ -60,14 +197,25 @@ server.setRequestHandler(CallToolRequestSchema, async ({ params }) => {
|
|
|
60
197
|
...(paymentSignature ? { "PAYMENT-SIGNATURE": paymentSignature } : {})
|
|
61
198
|
};
|
|
62
199
|
|
|
200
|
+
const payload = {
|
|
201
|
+
url: targetUrl,
|
|
202
|
+
mode,
|
|
203
|
+
...(selectors ? { selectors } : {}),
|
|
204
|
+
...(bypassCache ? { bypass_cache: true } : {})
|
|
205
|
+
};
|
|
206
|
+
|
|
63
207
|
const response = await fetch(API_URL, {
|
|
64
208
|
method: "POST",
|
|
65
209
|
headers,
|
|
66
|
-
body: JSON.stringify(
|
|
210
|
+
body: JSON.stringify(payload)
|
|
67
211
|
});
|
|
68
212
|
|
|
69
213
|
const bodyText = await response.text();
|
|
70
214
|
|
|
215
|
+
if ((response.status === 401 || response.status === 402) && usedTrialCache) {
|
|
216
|
+
clearCachedTrialToken();
|
|
217
|
+
}
|
|
218
|
+
|
|
71
219
|
if (response.status === 402) {
|
|
72
220
|
return {
|
|
73
221
|
isError: true,
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
6
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
7
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
|
|
9
|
+
const API_URL = process.env.CRISPPARSE_API_URL || "https://api.crispparse.com/v1/extract";
|
|
10
|
+
const TRIAL_URL = process.env.CRISPPARSE_TRIAL_URL || API_URL.replace(/\/v1\/extract\/?$/, "/v1/trial/claim");
|
|
11
|
+
const DEFAULT_API_KEY = process.env.CRISPPARSE_API_KEY || "";
|
|
12
|
+
const DEFAULT_PAYMENT_SIGNATURE = process.env.CRISPPARSE_PAYMENT_SIGNATURE || "";
|
|
13
|
+
const AUTO_CLAIM_TRIAL = process.env.CRISPPARSE_AUTO_CLAIM_TRIAL !== "false";
|
|
14
|
+
const CACHE_FILE = path.join(os.homedir(), ".crispparse", "trial_token.json");
|
|
15
|
+
|
|
16
|
+
function safeJson(text) {
|
|
17
|
+
try {
|
|
18
|
+
return JSON.parse(text);
|
|
19
|
+
} catch {
|
|
20
|
+
return text;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function readCachedTrialToken() {
|
|
25
|
+
try {
|
|
26
|
+
const raw = fs.readFileSync(CACHE_FILE, "utf8");
|
|
27
|
+
const parsed = JSON.parse(raw);
|
|
28
|
+
if (parsed && typeof parsed.token === "string" && parsed.token.length > 0) {
|
|
29
|
+
return parsed.token;
|
|
30
|
+
}
|
|
31
|
+
} catch {}
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function writeCachedTrialToken(token) {
|
|
36
|
+
try {
|
|
37
|
+
fs.mkdirSync(path.dirname(CACHE_FILE), { recursive: true, mode: 0o700 });
|
|
38
|
+
fs.writeFileSync(CACHE_FILE, JSON.stringify({ token, claimed_at: new Date().toISOString() }, null, 2), { mode: 0o600 });
|
|
39
|
+
} catch {}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function clearCachedTrialToken() {
|
|
43
|
+
try {
|
|
44
|
+
fs.unlinkSync(CACHE_FILE);
|
|
45
|
+
} catch {}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function claimTrialToken(forceRefresh = false) {
|
|
49
|
+
if (!forceRefresh) {
|
|
50
|
+
const cached = readCachedTrialToken();
|
|
51
|
+
if (cached) return { token: cached, source: "cache" };
|
|
52
|
+
}
|
|
53
|
+
const res = await fetch(TRIAL_URL, { method: "POST" });
|
|
54
|
+
const text = await res.text();
|
|
55
|
+
const data = safeJson(text);
|
|
56
|
+
if (!res.ok || !data || typeof data.macaroon_token !== "string") {
|
|
57
|
+
throw new Error(typeof data === "object" && data?.detail ? data.detail : `Trial claim failed (${res.status}): ${text}`);
|
|
58
|
+
}
|
|
59
|
+
writeCachedTrialToken(data.macaroon_token);
|
|
60
|
+
return { token: data.macaroon_token, source: "claimed", details: data };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const server = new Server(
|
|
64
|
+
{ name: "crispparse-mcp-server", version: "1.0.2" },
|
|
65
|
+
{ capabilities: { tools: {} } }
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
69
|
+
tools: [
|
|
70
|
+
{
|
|
71
|
+
name: "crispparse_extract",
|
|
72
|
+
description: "Extract clean, LLM-ready Markdown or structured JSON from any public URL using CrispParse (auto-provisions a free 50-credit trial Macaroon if no API key or x402 PAYMENT-SIGNATURE is configured).",
|
|
73
|
+
inputSchema: {
|
|
74
|
+
type: "object",
|
|
75
|
+
properties: {
|
|
76
|
+
url: { type: "string", description: "The full http:// or https:// URL to extract." },
|
|
77
|
+
mode: { type: "string", enum: ["markdown", "json"], description: "Output format (defaults to markdown)." },
|
|
78
|
+
api_key: { type: "string", description: "Optional CrispParse Macaroon bearer token (overrides CRISPPARSE_API_KEY)." },
|
|
79
|
+
payment_signature: { type: "string", description: "Optional x402 v2 PAYMENT-SIGNATURE Base USDC proof header (overrides CRISPPARSE_PAYMENT_SIGNATURE)." }
|
|
80
|
+
},
|
|
81
|
+
required: ["url"]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "crispparse_claim_trial",
|
|
86
|
+
description: "Claim or retrieve a cached zero-config CrispParse trial Macaroon token (50 credits, 14-day TTL) for immediate extraction without manual signup.",
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
force_refresh: { type: "boolean", description: "Request a fresh trial token instead of returning the cached token." }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}));
|
|
96
|
+
|
|
97
|
+
server.setRequestHandler(CallToolRequestSchema, async ({ params }) => {
|
|
98
|
+
if (params.name === "crispparse_claim_trial") {
|
|
99
|
+
try {
|
|
100
|
+
const result = await claimTrialToken(Boolean(params.arguments?.force_refresh));
|
|
101
|
+
return {
|
|
102
|
+
isError: false,
|
|
103
|
+
content: [{ type: "text", text: JSON.stringify({ status: "ok", source: result.source, macaroon_token: result.token, cache_path: CACHE_FILE }) }]
|
|
104
|
+
};
|
|
105
|
+
} catch (error) {
|
|
106
|
+
return {
|
|
107
|
+
isError: true,
|
|
108
|
+
content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (params.name !== "crispparse_extract") {
|
|
114
|
+
return { isError: true, content: [{ type: "text", text: `Unknown tool: ${params.name}` }] };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const targetUrl = params.arguments?.url;
|
|
118
|
+
const mode = params.arguments?.mode === "json" ? "json" : "markdown";
|
|
119
|
+
let apiKey = (typeof params.arguments?.api_key === "string" && params.arguments.api_key) || DEFAULT_API_KEY;
|
|
120
|
+
const paymentSignature = (typeof params.arguments?.payment_signature === "string" && params.arguments.payment_signature) || DEFAULT_PAYMENT_SIGNATURE;
|
|
121
|
+
|
|
122
|
+
if (!targetUrl || typeof targetUrl !== "string") {
|
|
123
|
+
return { isError: true, content: [{ type: "text", text: "Missing required parameter: url" }] };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let usedTrialCache = false;
|
|
127
|
+
if (!apiKey && !paymentSignature && AUTO_CLAIM_TRIAL) {
|
|
128
|
+
try {
|
|
129
|
+
const trial = await claimTrialToken(false);
|
|
130
|
+
apiKey = trial.token;
|
|
131
|
+
usedTrialCache = true;
|
|
132
|
+
} catch {
|
|
133
|
+
// Fall through to unauthenticated request so the agent still receives the x402 402 payment challenge
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
const headers = {
|
|
139
|
+
"Content-Type": "application/json",
|
|
140
|
+
...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}),
|
|
141
|
+
...(paymentSignature ? { "PAYMENT-SIGNATURE": paymentSignature } : {})
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const response = await fetch(API_URL, {
|
|
145
|
+
method: "POST",
|
|
146
|
+
headers,
|
|
147
|
+
body: JSON.stringify({ url: targetUrl, mode })
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const bodyText = await response.text();
|
|
151
|
+
|
|
152
|
+
if ((response.status === 401 || response.status === 402) && usedTrialCache) {
|
|
153
|
+
clearCachedTrialToken();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (response.status === 402) {
|
|
157
|
+
return {
|
|
158
|
+
isError: true,
|
|
159
|
+
content: [
|
|
160
|
+
{
|
|
161
|
+
type: "text",
|
|
162
|
+
text: JSON.stringify({
|
|
163
|
+
status: 402,
|
|
164
|
+
paymentRequired: response.headers.get("payment-required"),
|
|
165
|
+
body: safeJson(bodyText)
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const paymentResponse = response.headers.get("payment-response");
|
|
173
|
+
if (response.ok && paymentResponse) {
|
|
174
|
+
return {
|
|
175
|
+
isError: false,
|
|
176
|
+
content: [
|
|
177
|
+
{
|
|
178
|
+
type: "text",
|
|
179
|
+
text: JSON.stringify({
|
|
180
|
+
paymentResponse,
|
|
181
|
+
result: safeJson(bodyText)
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return { isError: !response.ok, content: [{ type: "text", text: bodyText }] };
|
|
189
|
+
} catch (error) {
|
|
190
|
+
return {
|
|
191
|
+
isError: true,
|
|
192
|
+
content: [{ type: "text", text: `CrispParse request failed: ${error instanceof Error ? error.message : String(error)}` }]
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
await server.connect(new StdioServerTransport());
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crispparse-mcp",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Local stdio Model Context Protocol (MCP) server for deterministic web extraction
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Local stdio Model Context Protocol (MCP) server for deterministic web extraction (Markdown, JSON, Hybrid, CSS selectors, Tier 2/3 stealth) and C2PA provenance verification via CrispParse.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"bin": {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "crispparse-mcp",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Local stdio Model Context Protocol (MCP) server for deterministic web extraction to clean Markdown and JSON via CrispParse.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"crispparse-mcp": "./index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node index.js"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/goldmarklabs/crispparse-mcp.git"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@modelcontextprotocol/sdk": "^1.12.0"
|
|
20
|
+
}
|
|
21
|
+
}
|