crispparse-mcp 0.0.0-stage → 1.0.1
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/.dockerignore +3 -0
- package/.github/dependabot.yml +6 -0
- package/.github/workflows/ci.yml +12 -0
- package/Dockerfile +6 -0
- package/LICENSE +21 -0
- package/README.md +58 -2
- package/glama.json +4 -0
- package/index.js +112 -0
- package/package.json +19 -4
package/.dockerignore
ADDED
package/Dockerfile
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GoldmarkLabs
|
|
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
CHANGED
|
@@ -1,3 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CrispParse MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://glama.ai/mcp/servers/goldmarklabs/crispparse-mcp)
|
|
4
|
+
|
|
5
|
+
A self-contained Model Context Protocol (`stdio`) server implementation built with `@modelcontextprotocol/sdk` that exposes deterministic web extraction tools to MCP-compatible AI agents and desktop clients (Claude Desktop, Cursor, Windsurf, and Cline).
|
|
6
|
+
|
|
7
|
+
## How It Works
|
|
8
|
+
|
|
9
|
+
This repository implements a local MCP `stdio` server (`index.js`) using `StdioServerTransport`:
|
|
10
|
+
1. Registers MCP `tools/list` and `tools/call` handlers via `@modelcontextprotocol/sdk`.
|
|
11
|
+
2. Exposes the `crispparse_extract` tool with JSON Schema input validation.
|
|
12
|
+
3. Executes upstream extraction requests against the CrispParse extraction engine (`https://api.crispparse.com/v1/extract`) and returns clean Markdown or JSON over `stdio`.
|
|
13
|
+
|
|
14
|
+
## Available Tools
|
|
15
|
+
|
|
16
|
+
### `crispparse_extract`
|
|
17
|
+
Extracts clean, LLM-ready Markdown or structured JSON from any public webpage URL.
|
|
18
|
+
|
|
19
|
+
* **`url`** (`string`, required): The full `http://` or `https://` URL to extract.
|
|
20
|
+
* **`mode`** (`string`, optional, default `"markdown"`): Output format (`"markdown"` or `"json"`).
|
|
21
|
+
|
|
22
|
+
## Installation & Local Execution
|
|
23
|
+
|
|
24
|
+
### Run with Node.js (v18+)
|
|
25
|
+
|
|
26
|
+
git clone https://github.com/goldmarklabs/crispparse-mcp.git
|
|
27
|
+
cd crispparse-mcp
|
|
28
|
+
npm install
|
|
29
|
+
CRISPPARSE_API_KEY="your_api_key" node index.js
|
|
30
|
+
|
|
31
|
+
### Run with Docker
|
|
32
|
+
|
|
33
|
+
docker build -t crispparse-mcp .
|
|
34
|
+
docker run -i --rm -e CRISPPARSE_API_KEY="your_api_key" crispparse-mcp
|
|
35
|
+
|
|
36
|
+
## MCP Client Configuration
|
|
37
|
+
|
|
38
|
+
Add the server to your Claude Desktop (`claude_desktop_config.json`) or Cursor MCP configuration:
|
|
39
|
+
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"crispparse": {
|
|
43
|
+
"command": "node",
|
|
44
|
+
"args": ["/absolute/path/to/crispparse-mcp/index.js"],
|
|
45
|
+
"env": {
|
|
46
|
+
"CRISPPARSE_API_KEY": "your_api_key"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
## Environment Variables
|
|
53
|
+
|
|
54
|
+
* `CRISPPARSE_API_KEY`: Optional Bearer Macaroon API key from [crispparse.com](https://crispparse.com) (requests without a key receive an `x402` Base USDC payment challenge).
|
|
55
|
+
* `CRISPPARSE_API_URL`: Optional upstream endpoint override (defaults to `https://api.crispparse.com/v1/extract`).
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT — see [LICENSE](./LICENSE).
|
package/glama.json
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
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 { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
|
|
6
|
+
const API_URL = process.env.CRISPPARSE_API_URL || "https://api.crispparse.com/v1/extract";
|
|
7
|
+
const DEFAULT_API_KEY = process.env.CRISPPARSE_API_KEY || "";
|
|
8
|
+
const DEFAULT_PAYMENT_SIGNATURE = process.env.CRISPPARSE_PAYMENT_SIGNATURE || "";
|
|
9
|
+
|
|
10
|
+
function safeJson(text) {
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(text);
|
|
13
|
+
} catch {
|
|
14
|
+
return text;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const server = new Server(
|
|
19
|
+
{ name: "crispparse-mcp-server", version: "1.0.1" },
|
|
20
|
+
{ capabilities: { tools: {} } }
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
24
|
+
tools: [
|
|
25
|
+
{
|
|
26
|
+
name: "crispparse_extract",
|
|
27
|
+
description: "Extract clean, LLM-ready Markdown or structured JSON from any public URL using CrispParse (supports Bearer Macaroon or x402 PAYMENT-SIGNATURE Base USDC proof).",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
url: { type: "string", description: "The full http:// or https:// URL to extract." },
|
|
32
|
+
mode: { type: "string", enum: ["markdown", "json"], description: "Output format (defaults to markdown)." },
|
|
33
|
+
api_key: { type: "string", description: "Optional CrispParse Macaroon bearer token (overrides CRISPPARSE_API_KEY)." },
|
|
34
|
+
payment_signature: { type: "string", description: "Optional x402 v2 PAYMENT-SIGNATURE Base USDC proof header (overrides CRISPPARSE_PAYMENT_SIGNATURE)." }
|
|
35
|
+
},
|
|
36
|
+
required: ["url"]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
server.setRequestHandler(CallToolRequestSchema, async ({ params }) => {
|
|
43
|
+
if (params.name !== "crispparse_extract") {
|
|
44
|
+
return { isError: true, content: [{ type: "text", text: `Unknown tool: ${params.name}` }] };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const targetUrl = params.arguments?.url;
|
|
48
|
+
const mode = params.arguments?.mode === "json" ? "json" : "markdown";
|
|
49
|
+
const apiKey = (typeof params.arguments?.api_key === "string" && params.arguments.api_key) || DEFAULT_API_KEY;
|
|
50
|
+
const paymentSignature = (typeof params.arguments?.payment_signature === "string" && params.arguments.payment_signature) || DEFAULT_PAYMENT_SIGNATURE;
|
|
51
|
+
|
|
52
|
+
if (!targetUrl || typeof targetUrl !== "string") {
|
|
53
|
+
return { isError: true, content: [{ type: "text", text: "Missing required parameter: url" }] };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const headers = {
|
|
58
|
+
"Content-Type": "application/json",
|
|
59
|
+
...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}),
|
|
60
|
+
...(paymentSignature ? { "PAYMENT-SIGNATURE": paymentSignature } : {})
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const response = await fetch(API_URL, {
|
|
64
|
+
method: "POST",
|
|
65
|
+
headers,
|
|
66
|
+
body: JSON.stringify({ url: targetUrl, mode })
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const bodyText = await response.text();
|
|
70
|
+
|
|
71
|
+
if (response.status === 402) {
|
|
72
|
+
return {
|
|
73
|
+
isError: true,
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: "text",
|
|
77
|
+
text: JSON.stringify({
|
|
78
|
+
status: 402,
|
|
79
|
+
paymentRequired: response.headers.get("payment-required"),
|
|
80
|
+
body: safeJson(bodyText)
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const paymentResponse = response.headers.get("payment-response");
|
|
88
|
+
if (response.ok && paymentResponse) {
|
|
89
|
+
return {
|
|
90
|
+
isError: false,
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: "text",
|
|
94
|
+
text: JSON.stringify({
|
|
95
|
+
paymentResponse,
|
|
96
|
+
result: safeJson(bodyText)
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return { isError: !response.ok, content: [{ type: "text", text: bodyText }] };
|
|
104
|
+
} catch (error) {
|
|
105
|
+
return {
|
|
106
|
+
isError: true,
|
|
107
|
+
content: [{ type: "text", text: `CrispParse request failed: ${error instanceof Error ? error.message : String(error)}` }]
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
await server.connect(new StdioServerTransport());
|
package/package.json
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crispparse-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
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
|
+
}
|