@pipeworx/mcp-crc 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 +57 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +71 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
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,57 @@
|
|
|
1
|
+
# mcp-crc
|
|
2
|
+
|
|
3
|
+
Checksum MCP — CRC-32 & Adler-32.
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1152+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `crc32` | Compute the CRC-32 (IEEE) checksum of UTF-8 text — the algorithm used by zip/gzip/PNG. Returns the unsigned 32-bit value and its hex form. Keyless, offline. (Error-detection checksum, not cryptographic.) |
|
|
12
|
+
| `adler32` | Compute the Adler-32 checksum of UTF-8 text (as used by zlib). Returns the unsigned value and hex. Keyless, offline. |
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"mcpServers": {
|
|
21
|
+
"crc": {
|
|
22
|
+
"url": "https://gateway.pipeworx.io/crc/mcp"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or connect to the full Pipeworx gateway for access to all 1152+ data sources:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"pipeworx": {
|
|
34
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Using with ask_pipeworx
|
|
41
|
+
|
|
42
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
ask_pipeworx({ question: "your question about Crc data" })
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
49
|
+
|
|
50
|
+
## More
|
|
51
|
+
|
|
52
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
53
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-crc",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Checksum MCP — CRC-32 & Adler-32.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "crc"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-crc"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.7.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/crc",
|
|
4
|
+
"title": "Crc",
|
|
5
|
+
"description": "Checksum MCP — CRC-32 & Adler-32.",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/crc",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-crc",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/crc/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
interface McpToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface McpToolExport {
|
|
12
|
+
tools: McpToolDefinition[];
|
|
13
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
+
meter?: { credits: number };
|
|
15
|
+
cost?: Record<string, unknown>;
|
|
16
|
+
provider?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Checksum MCP — CRC-32 & Adler-32.
|
|
21
|
+
*
|
|
22
|
+
* Keyless, offline: compute CRC-32 (IEEE, as used by zip/gzip/PNG) and Adler-32
|
|
23
|
+
* (as used by zlib) checksums of text. Pure functions — no API, no key. These
|
|
24
|
+
* are error-detection checksums, NOT cryptographic hashes (use the `hash` pack
|
|
25
|
+
* for MD5/SHA).
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const TABLE = (() => {
|
|
30
|
+
const t = new Uint32Array(256);
|
|
31
|
+
for (let n = 0; n < 256; n++) { let c = n; for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; t[n] = c >>> 0; }
|
|
32
|
+
return t;
|
|
33
|
+
})();
|
|
34
|
+
|
|
35
|
+
function crc32(bytes: Uint8Array): number {
|
|
36
|
+
let crc = 0xffffffff;
|
|
37
|
+
for (const b of bytes) crc = TABLE[(crc ^ b) & 0xff] ^ (crc >>> 8);
|
|
38
|
+
return (crc ^ 0xffffffff) >>> 0;
|
|
39
|
+
}
|
|
40
|
+
function adler32(bytes: Uint8Array): number {
|
|
41
|
+
let a = 1, b = 0;
|
|
42
|
+
for (const x of bytes) { a = (a + x) % 65521; b = (b + a) % 65521; }
|
|
43
|
+
return ((b << 16) | a) >>> 0;
|
|
44
|
+
}
|
|
45
|
+
const hex8 = (n: number) => n.toString(16).padStart(8, '0');
|
|
46
|
+
|
|
47
|
+
const tools: McpToolExport['tools'] = [
|
|
48
|
+
{
|
|
49
|
+
name: 'crc32',
|
|
50
|
+
description: 'Compute the CRC-32 (IEEE) checksum of UTF-8 text — the algorithm used by zip/gzip/PNG. Returns the unsigned 32-bit value and its hex form. Keyless, offline. (Error-detection checksum, not cryptographic.)',
|
|
51
|
+
inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'The text to checksum.' } }, required: ['text'] },
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'adler32',
|
|
55
|
+
description: 'Compute the Adler-32 checksum of UTF-8 text (as used by zlib). Returns the unsigned value and hex. Keyless, offline.',
|
|
56
|
+
inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'The text to checksum.' } }, required: ['text'] },
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
61
|
+
const text = args.text;
|
|
62
|
+
if (typeof text !== 'string') throw new Error('Required argument "text" is missing (a string).');
|
|
63
|
+
const bytes = new TextEncoder().encode(text);
|
|
64
|
+
switch (name) {
|
|
65
|
+
case 'crc32': { const v = crc32(bytes); return { algorithm: 'crc32', value: v, hex: hex8(v) }; }
|
|
66
|
+
case 'adler32': { const v = adler32(bytes); return { algorithm: 'adler32', value: v, hex: hex8(v) }; }
|
|
67
|
+
default: throw new Error(`Unknown tool: ${name}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|