chronoverify-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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ChronoVerify
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,44 @@
1
+ # chronoverify-mcp
2
+
3
+ An [MCP](https://modelcontextprotocol.io) server for [ChronoVerify](https://chronoverify.com). It gives any MCP-compatible AI agent (Claude Desktop, Cursor, Cline, and others) one tool, `verify_image`, to check a photo's capture time and provenance: C2PA Content Credentials, EXIF and XMP metadata, and classical pixel forensics, fused into one verdict (`provenance_confirmed`, `consistent`, `inconclusive`, `metadata_anomaly`, or `manipulation_indicated`) with a 0 to 100 confidence.
4
+
5
+ Provenance-first, not a deepfake detector. Results are investigative triage to support human review, not proof.
6
+
7
+ > **Get an API key** (the first 100 verifications each month are included): https://chronoverify.com/pricing . Without a key, the server uses the free, rate-limited public path.
8
+
9
+ ## Install
10
+
11
+ Add it to your MCP client config. For Claude Desktop (`claude_desktop_config.json`) or any MCP client:
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "chronoverify": {
17
+ "command": "npx",
18
+ "args": ["-y", "chronoverify-mcp"],
19
+ "env": { "CHRONOVERIFY_API_KEY": "cv_live_..." }
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ Omit the `env` block to use the free public path.
26
+
27
+ ## The tool
28
+
29
+ `verify_image` takes exactly one of:
30
+
31
+ - `url`: a publicly reachable image URL (the server fetches it),
32
+ - `file_path`: an absolute path to a local image, or
33
+ - `image_base64`: base64-encoded image bytes.
34
+
35
+ It returns the verdict, the confidence, the capture time and device when present, the C2PA status, and the SHA-256 of the file.
36
+
37
+ ## Example prompts
38
+
39
+ - "Verify the provenance of /Users/me/Downloads/photo.jpg"
40
+ - "When was the photo at this URL taken, and has it been edited? https://example.com/photo.jpg"
41
+
42
+ ## License
43
+
44
+ MIT
package/dist/index.js ADDED
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ChronoVerify MCP server.
4
+ *
5
+ * Exposes a single tool, `verify_image`, so any MCP-compatible AI agent (Claude
6
+ * Desktop, Cursor, Cline, and others) can verify a photo's capture time and
7
+ * provenance. It wraps POST /v1/verify: reads C2PA Content Credentials, EXIF and
8
+ * XMP metadata, and classical pixel forensics, and returns one verdict with a
9
+ * 0 to 100 confidence. Provenance-first, not a deepfake detector; results are
10
+ * investigative triage, not proof.
11
+ *
12
+ * Configure with the CHRONOVERIFY_API_KEY environment variable to meter calls
13
+ * against your key; without it, calls use the free, rate-limited public path.
14
+ */
15
+ import { readFile } from "node:fs/promises";
16
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
17
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
18
+ import { z } from "zod";
19
+ const BASE_URL = (process.env.CHRONOVERIFY_BASE_URL ?? "https://chronoverify.com").replace(/\/+$/, "");
20
+ const API_KEY = process.env.CHRONOVERIFY_API_KEY;
21
+ async function verifyImage(args) {
22
+ const provided = [args.url, args.file_path, args.image_base64].filter((x) => x != null && x !== "");
23
+ if (provided.length !== 1) {
24
+ throw new Error("Provide exactly one of url, file_path, or image_base64.");
25
+ }
26
+ const form = new FormData();
27
+ if (args.url) {
28
+ form.append("url", args.url);
29
+ }
30
+ else if (args.file_path) {
31
+ const buf = await readFile(args.file_path);
32
+ form.append("file", new Blob([buf]), "image");
33
+ }
34
+ else {
35
+ const buf = Buffer.from(args.image_base64, "base64");
36
+ form.append("file", new Blob([buf]), "image");
37
+ }
38
+ const headers = {};
39
+ if (API_KEY)
40
+ headers["Authorization"] = `Bearer ${API_KEY}`;
41
+ const resp = await fetch(`${BASE_URL}/v1/verify`, { method: "POST", body: form, headers });
42
+ if (!resp.ok) {
43
+ let detail = "";
44
+ try {
45
+ detail = (await resp.json()).detail ?? "";
46
+ }
47
+ catch {
48
+ /* ignore */
49
+ }
50
+ throw new Error(`ChronoVerify API error ${resp.status}${detail ? `: ${detail}` : ""}`);
51
+ }
52
+ return (await resp.json());
53
+ }
54
+ function summarize(r) {
55
+ const lines = [];
56
+ lines.push(`Verdict: ${r.verdict} (confidence ${r.confidence}/100)`);
57
+ if (r.headline)
58
+ lines.push(r.headline);
59
+ const ct = r.capture_time ?? {};
60
+ if (ct.value)
61
+ lines.push(`Capture time: ${ct.value} (source: ${ct.source})`);
62
+ const dev = r.capture_device ?? {};
63
+ if (dev.make || dev.model)
64
+ lines.push(`Device: ${[dev.make, dev.model].filter(Boolean).join(" ")}`);
65
+ const loc = r.capture_location ?? {};
66
+ if (loc.present) {
67
+ const place = [loc.city, loc.region, loc.country].filter(Boolean).join(", ");
68
+ lines.push(`Location: ${place || `${loc.lat}, ${loc.lon}`}`);
69
+ }
70
+ const c2pa = r.c2pa ?? {};
71
+ lines.push(`C2PA Content Credentials: ${c2pa.present ? (c2pa.validated ? "present and validated" : "present") : "none"}`);
72
+ if (r.integrity?.sha256)
73
+ lines.push(`SHA-256: ${r.integrity.sha256}`);
74
+ lines.push("");
75
+ lines.push("Verified with ChronoVerify (https://chronoverify.com). Investigative triage, not proof: a clean result means the file's saved data is internally consistent, not that the scene it shows is real.");
76
+ lines.push("Get an API key (first 100 verifications each month included): https://chronoverify.com/pricing");
77
+ return lines.join("\n");
78
+ }
79
+ const server = new McpServer({ name: "chronoverify", version: "0.1.0" });
80
+ server.tool("verify_image", "Verify a photo's capture time and provenance with ChronoVerify. Reads C2PA Content Credentials, EXIF and XMP metadata, and runs classical pixel forensics, then returns one verdict (provenance_confirmed, consistent, inconclusive, metadata_anomaly, or manipulation_indicated) with a 0 to 100 confidence and the signals behind it. It works on any image, signed or not. Provenance-first and not a deepfake detector: results are investigative triage to support human review, not proof. Provide exactly one of url, file_path, or image_base64.", {
81
+ url: z.string().optional().describe("A publicly reachable image URL; the server fetches it."),
82
+ file_path: z.string().optional().describe("Absolute path to a local image file to verify."),
83
+ image_base64: z.string().optional().describe("Base64-encoded image bytes (no data: prefix)."),
84
+ }, async (args) => {
85
+ try {
86
+ const result = await verifyImage(args);
87
+ return { content: [{ type: "text", text: summarize(result) }] };
88
+ }
89
+ catch (err) {
90
+ return {
91
+ content: [{ type: "text", text: `error: ${err.message}` }],
92
+ isError: true,
93
+ };
94
+ }
95
+ });
96
+ const transport = new StdioServerTransport();
97
+ await server.connect(transport);
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "chronoverify-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for ChronoVerify: verify a photo's capture time and provenance from any MCP-compatible AI agent.",
5
+ "type": "module",
6
+ "bin": {
7
+ "chronoverify-mcp": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "prepublishOnly": "npm run build"
17
+ },
18
+ "keywords": [
19
+ "mcp",
20
+ "modelcontextprotocol",
21
+ "model-context-protocol",
22
+ "image",
23
+ "provenance",
24
+ "c2pa",
25
+ "exif",
26
+ "forensics",
27
+ "verification",
28
+ "osint"
29
+ ],
30
+ "license": "MIT",
31
+ "homepage": "https://chronoverify.com",
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
35
+ "dependencies": {
36
+ "@modelcontextprotocol/sdk": "^1.0.0",
37
+ "zod": "^3.23.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^20.14.0",
41
+ "typescript": "^5.4.0"
42
+ }
43
+ }