@otskit/mcp 0.4.3 → 0.6.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/README.md CHANGED
@@ -58,6 +58,8 @@ Each command writes the MCP entry into the agent's config file, makes a `.bak` b
58
58
  | `inspect_timestamp` | Inspect a stored proof file without network calls |
59
59
  | `list_pending` | List stamps with status, retry count, and filters |
60
60
  | `watch` | Open a terminal window monitoring pending stamps in real-time |
61
+ | `hash_file` | Compute the SHA-256 of a local file and return it as a 64-char hex string (no network calls) |
62
+ | `stamp_file` | Compute SHA-256 of a local file and stamp it on Bitcoin in one step |
61
63
 
62
64
  ## Data directory
63
65
 
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ Commands:
20
20
  }
21
21
  switch (command) {
22
22
  case "serve": {
23
- const { runServer } = await import("./server-IDRHOKL7.js");
23
+ const { runServer } = await import("./server-NNUGQ5WQ.js");
24
24
  await runServer();
25
25
  break;
26
26
  }
@@ -71,6 +71,29 @@ function openWatchWindow(intervalMinutes = 5) {
71
71
  return { opened: true, interval_minutes: minutes, ...errorMsg ? { error: errorMsg } : {} };
72
72
  }
73
73
 
74
+ // src/tools/stamp-file.ts
75
+ import { readFileSync as readFileSync2 } from "fs";
76
+ import { OpSHA256 } from "@otskit/core";
77
+ async function stampFile(input, db, config) {
78
+ const data = new Uint8Array(readFileSync2(input.path));
79
+ const hash = Buffer.from(new OpSHA256().hash(data)).toString("hex");
80
+ return createTimestamp({ hash }, db, config);
81
+ }
82
+
83
+ // src/tools/hash-file.ts
84
+ import { hashFile } from "@otskit/client";
85
+ async function hashFileTool(input) {
86
+ try {
87
+ const buf = await hashFile(input.path);
88
+ return { hash: buf.toString("hex") };
89
+ } catch (e) {
90
+ if (e?.code === "ENOENT") {
91
+ return { error: "file_not_found", details: `File not found: ${input.path}` };
92
+ }
93
+ throw e;
94
+ }
95
+ }
96
+
74
97
  // src/tool-definitions.ts
75
98
  var TOOL_DEFINITIONS = [
76
99
  {
@@ -152,6 +175,36 @@ var TOOL_DEFINITIONS = [
152
175
  openWorldHint: false
153
176
  }
154
177
  },
178
+ {
179
+ name: "hash_file",
180
+ description: "Computes the SHA-256 hash of a local file and returns it as a 64-character hex string. No network calls \u2014 pure local operation.",
181
+ inputSchema: {
182
+ type: "object",
183
+ properties: { path: { type: "string", description: "Absolute path to the file" } },
184
+ required: ["path"]
185
+ },
186
+ annotations: {
187
+ readOnlyHint: true,
188
+ destructiveHint: false,
189
+ idempotentHint: true,
190
+ openWorldHint: false
191
+ }
192
+ },
193
+ {
194
+ name: "stamp_file",
195
+ description: "Stamps a file against public OpenTimestamps calendars. Computes SHA-256 of the file and stamps it on Bitcoin. IMPORTANT: the digest is sent to external calendar servers (alice.btc, bob.btc, finney, catallaxy).",
196
+ inputSchema: {
197
+ type: "object",
198
+ properties: { path: { type: "string", description: "Absolute path to the file to stamp" } },
199
+ required: ["path"]
200
+ },
201
+ annotations: {
202
+ readOnlyHint: false,
203
+ destructiveHint: false,
204
+ idempotentHint: false,
205
+ openWorldHint: true
206
+ }
207
+ },
155
208
  {
156
209
  name: "watch",
157
210
  description: "Opens a new terminal window that monitors pending stamps in real-time, polling at the given interval. The window stays open so the user can watch progress.",
@@ -201,6 +254,12 @@ async function runServer() {
201
254
  case "list_pending":
202
255
  result = listPending(args, db, config);
203
256
  break;
257
+ case "hash_file":
258
+ result = await hashFileTool(args);
259
+ break;
260
+ case "stamp_file":
261
+ result = await stampFile(args, db, config);
262
+ break;
204
263
  case "watch":
205
264
  result = openWatchWindow(args?.interval_minutes);
206
265
  break;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@otskit/mcp",
3
3
  "mcpName": "io.github.AlexAlves87/otskit-mcp",
4
- "version": "0.4.3",
4
+ "version": "0.6.0",
5
5
  "license": "MIT",
6
6
  "description": "OpenTimestamps MCP server — stamp, upgrade, verify via AI agents",
7
7
  "repository": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@modelcontextprotocol/sdk": "^1.29.0",
31
- "@otskit/client": "^0.1.1",
31
+ "@otskit/client": "^0.2.0",
32
32
  "@otskit/core": "^0.1.0",
33
33
  "better-sqlite3": "^12.10.0"
34
34
  },