@otskit/mcp 0.5.0 → 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-6QAYMGCK.js");
23
+ const { runServer } = await import("./server-NNUGQ5WQ.js");
24
24
  await runServer();
25
25
  break;
26
26
  }
@@ -80,6 +80,20 @@ async function stampFile(input, db, config) {
80
80
  return createTimestamp({ hash }, db, config);
81
81
  }
82
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
+
83
97
  // src/tool-definitions.ts
84
98
  var TOOL_DEFINITIONS = [
85
99
  {
@@ -161,6 +175,21 @@ var TOOL_DEFINITIONS = [
161
175
  openWorldHint: false
162
176
  }
163
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
+ },
164
193
  {
165
194
  name: "stamp_file",
166
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).",
@@ -225,6 +254,9 @@ async function runServer() {
225
254
  case "list_pending":
226
255
  result = listPending(args, db, config);
227
256
  break;
257
+ case "hash_file":
258
+ result = await hashFileTool(args);
259
+ break;
228
260
  case "stamp_file":
229
261
  result = await stampFile(args, db, config);
230
262
  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.5.0",
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
  },