@otskit/mcp 0.7.0 → 0.7.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/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![Node >=20](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](https://nodejs.org)
12
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
13
13
  [![Glama](https://glama.ai/mcp/servers/OTSkit/OTSkit-MCP/badges/score.svg)](https://glama.ai/mcp/servers/OTSkit/OTSkit-MCP)
14
- [![OTSkit-MCP MCP server](https://glama.ai/mcp/servers/OTSkit/OTSkit-MCP/badges/card.svg)](https://glama.ai/mcp/servers/OTSkit/OTSkit-MCP)
14
+ [![smithery badge](https://smithery.ai/badge/otskit/otskit-mcp)](https://smithery.ai/servers/otskit/otskit-mcp)
15
15
 
16
16
  OpenTimestamps MCP server - stamp, upgrade, and verify Bitcoin timestamps via AI agents.
17
17
 
@@ -132,7 +132,7 @@ function reconcileOrphans(db) {
132
132
  // src/tools/upgrade-timestamp.ts
133
133
  import { readFileSync as readFileSync2 } from "fs";
134
134
  import { OpenTimestampsClient, UpgradeError } from "@otskit/client";
135
- import { DetachedTimestampFile, StreamDeserializationContext } from "@otskit/core";
135
+ import { DetachedTimestampFile } from "@otskit/core";
136
136
 
137
137
  // src/db/stamps.ts
138
138
  function insertStamp(db, params) {
@@ -219,8 +219,7 @@ function collectAttestations(ts) {
219
219
  }
220
220
  function checkBitcoinConfirmation(bytes) {
221
221
  try {
222
- const ctx = new StreamDeserializationContext(new Uint8Array(bytes));
223
- const dtf = DetachedTimestampFile.deserialize(ctx);
222
+ const dtf = DetachedTimestampFile.deserialize(new Uint8Array(bytes));
224
223
  const attestations = collectAttestations(dtf.timestamp);
225
224
  const bitcoinAtts = attestations.filter((a) => a.kind === "bitcoin");
226
225
  if (bitcoinAtts.length === 0) return { confirmed: false };
@@ -252,6 +251,20 @@ async function upgradeTimestamp(input, db, config) {
252
251
  upgraded = await client.upgrade(proofBefore);
253
252
  } catch (e) {
254
253
  if (e instanceof UpgradeError) {
254
+ const { confirmed: confirmed2, block: block2 } = checkBitcoinConfirmation(proofBefore);
255
+ if (confirmed2 && block2 !== void 0) {
256
+ const bitcoinTime = now;
257
+ updateStampStatus(db, input.id, {
258
+ status: "confirmed",
259
+ bitcoin_block: block2,
260
+ bitcoin_time: bitcoinTime,
261
+ confirmed_at: now,
262
+ last_attempt_at: now,
263
+ attempt_count: newAttemptCount
264
+ });
265
+ logOperation(db, { stamp_id: input.id, action: "upgrade", result: "success" });
266
+ return { id: input.id, status: "confirmed", bitcoin_block: block2, bitcoin_time: bitcoinTime, proof_path: record.proof_path };
267
+ }
255
268
  updateStampStatus(db, input.id, { last_attempt_at: now, attempt_count: newAttemptCount, next_retry_at: next });
256
269
  logOperation(db, { stamp_id: input.id, action: "upgrade", result: "pending" });
257
270
  return { id: input.id, status: "pending", attempt_count: newAttemptCount, last_attempt_at: now, next_retry_at: next };
@@ -4,7 +4,7 @@ import {
4
4
  insertStamp,
5
5
  listStamps,
6
6
  logOperation
7
- } from "./chunk-ZQUFY5MM.js";
7
+ } from "./chunk-4S4MSBQL.js";
8
8
  import {
9
9
  writeAtomic
10
10
  } from "./chunk-YFSUDT24.js";
@@ -2,7 +2,7 @@ import {
2
2
  getDb,
3
3
  loadConfig,
4
4
  upgradeTimestamp
5
- } from "./chunk-ZQUFY5MM.js";
5
+ } from "./chunk-4S4MSBQL.js";
6
6
 
7
7
  // src/tools/watch.ts
8
8
  var DEFAULT_WATCH_INTERVAL_MINUTES = 30;
@@ -2,13 +2,13 @@ import {
2
2
  createTimestamp,
3
3
  listPending,
4
4
  verifyTimestamp
5
- } from "./chunk-V4ONBNWS.js";
5
+ } from "./chunk-KVHJHTFL.js";
6
6
  import {
7
7
  backupDb,
8
8
  getDb,
9
9
  loadConfig,
10
10
  upgradeTimestamp
11
- } from "./chunk-ZQUFY5MM.js";
11
+ } from "./chunk-4S4MSBQL.js";
12
12
  import "./chunk-YFSUDT24.js";
13
13
 
14
14
  // src/cli.ts
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-6HE6K337.js");
23
+ const { runServer } = await import("./server-NDG4QZ56.js");
24
24
  await runServer();
25
25
  break;
26
26
  }
@@ -49,7 +49,7 @@ switch (command) {
49
49
  break;
50
50
  }
51
51
  case "watch": {
52
- const { normalizeWatchInterval, watchPending } = await import("./watch-JQ6XJCXF.js");
52
+ const { normalizeWatchInterval, watchPending } = await import("./watch-TQR2L42L.js");
53
53
  const parsed = args[0] ? parseInt(args[0], 10) : NaN;
54
54
  const interval = normalizeWatchInterval(isNaN(parsed) ? void 0 : parsed);
55
55
  if (args[0] && (isNaN(parsed) || parsed < 15))
@@ -65,7 +65,7 @@ switch (command) {
65
65
  case "check-pending":
66
66
  case "backup":
67
67
  case "scheduler": {
68
- const { runCli } = await import("./cli-MR24FO2T.js");
68
+ const { runCli } = await import("./cli-WOUUWARK.js");
69
69
  await runCli(command, args);
70
70
  break;
71
71
  }
@@ -2,16 +2,16 @@ import {
2
2
  createTimestamp,
3
3
  listPending,
4
4
  verifyTimestamp
5
- } from "./chunk-V4ONBNWS.js";
5
+ } from "./chunk-KVHJHTFL.js";
6
6
  import {
7
7
  normalizeWatchInterval
8
- } from "./chunk-KSFL3INC.js";
8
+ } from "./chunk-XG7NDZR3.js";
9
9
  import {
10
10
  getDb,
11
11
  getStamp,
12
12
  loadConfig,
13
13
  upgradeTimestamp
14
- } from "./chunk-ZQUFY5MM.js";
14
+ } from "./chunk-4S4MSBQL.js";
15
15
  import "./chunk-YFSUDT24.js";
16
16
 
17
17
  // src/server.ts
@@ -101,7 +101,7 @@ async function hashFileTool(input) {
101
101
  var TOOL_DEFINITIONS = [
102
102
  {
103
103
  name: "create_timestamp",
104
- description: "Stamps a SHA-256 hash against public OpenTimestamps calendars. IMPORTANT: the digest is sent to external calendar servers (alice.btc, bob.btc, finney, catallaxy).",
104
+ description: "Creates a verifiable Bitcoin timestamp for a SHA-256 hash using the OpenTimestamps protocol. Submits the hash to four public OTS calendars (alice.btc, bob.btc, finney, catallaxy) and stores a pending proof locally. Returns a stamp ID to track confirmation status. Confirmation typically takes ~60 minutes but can take several hours during network congestion.",
105
105
  inputSchema: {
106
106
  type: "object",
107
107
  properties: { hash: { type: "string", description: "SHA-256 hex digest (64 chars)" } },
@@ -116,7 +116,7 @@ var TOOL_DEFINITIONS = [
116
116
  },
117
117
  {
118
118
  name: "upgrade_timestamp",
119
- description: "Checks if a pending stamp has been confirmed in Bitcoin. Use the id returned by create_timestamp.",
119
+ description: "Attempts to upgrade a pending OpenTimestamps proof by fetching the latest merkle tree from the calendars. If Bitcoin has included the timestamp, the proof becomes confirmed and the bitcoin_block is recorded. Safe to call repeatedly \u2014 if not yet confirmed, it schedules the next retry automatically.",
120
120
  inputSchema: {
121
121
  type: "object",
122
122
  properties: { id: { type: "string", description: "UUID from the stamp record" } },
@@ -131,7 +131,7 @@ var TOOL_DEFINITIONS = [
131
131
  },
132
132
  {
133
133
  name: "verify_timestamp",
134
- description: "Verifies a stamp against Bitcoin. Does NOT affirm document authorship or truth \u2014 only proves the hash existed before a given Bitcoin block.",
134
+ description: "Verifies a timestamp proof against the Bitcoin blockchain via an Esplora API. Proves that a specific hash existed before a given Bitcoin block height. Does NOT affirm document authorship, content truth, or legal validity \u2014 it only provides a cryptographic proof of existence at a point in time.",
135
135
  inputSchema: {
136
136
  type: "object",
137
137
  properties: { id: { type: "string", description: "UUID from the stamp record" } },
@@ -146,7 +146,7 @@ var TOOL_DEFINITIONS = [
146
146
  },
147
147
  {
148
148
  name: "inspect_timestamp",
149
- description: "Inspects a stored proof file without network calls. Returns calendar_attestations (promises from OTS servers, NOT Bitcoin confirmation) and bitcoin_attestations (actual Bitcoin blocks). A stamp is only truly confirmed when bitcoin_attestations > 0 and bitcoin_confirmed is true.",
149
+ description: "Reads a stored proof file from disk without any network calls. Returns proof metadata including size, number of calendar attestations (pending promises from OTS servers) and Bitcoin attestations (actual confirmed blocks). A stamp is only truly confirmed when bitcoin_attestations > 0 and bitcoin_confirmed is true \u2014 calendar_attestations alone do not prove Bitcoin confirmation.",
150
150
  inputSchema: {
151
151
  type: "object",
152
152
  properties: { id: { type: "string", description: "UUID from the stamp record" } },
@@ -161,7 +161,7 @@ var TOOL_DEFINITIONS = [
161
161
  },
162
162
  {
163
163
  name: "list_pending",
164
- description: "Lists stamp records with status and retry info.",
164
+ description: "Lists stamp records from the local database with their current status, retry count, and next scheduled upgrade time. Filter by status (pending, confirmed, failed), page through results, or find stamps older than N hours. Use this to monitor the state of all timestamped hashes.",
165
165
  inputSchema: {
166
166
  type: "object",
167
167
  properties: {
@@ -180,7 +180,7 @@ var TOOL_DEFINITIONS = [
180
180
  },
181
181
  {
182
182
  name: "hash_file",
183
- 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.",
183
+ description: "Computes the SHA-256 hash of a local file and returns it as a 64-character hex string. Purely local \u2014 no network calls, no data stored. Use this to get the hash before calling create_timestamp, or to verify the integrity of a file independently.",
184
184
  inputSchema: {
185
185
  type: "object",
186
186
  properties: { path: { type: "string", description: "Absolute path to the file" } },
@@ -195,7 +195,7 @@ var TOOL_DEFINITIONS = [
195
195
  },
196
196
  {
197
197
  name: "stamp_file",
198
- 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).",
198
+ description: "Convenience tool that hashes a local file and stamps it on Bitcoin in one step. Computes the SHA-256 of the file, then submits it to four public OTS calendars. The file contents are never sent externally \u2014 only the hash is. Returns a stamp ID for tracking confirmation.",
199
199
  inputSchema: {
200
200
  type: "object",
201
201
  properties: { path: { type: "string", description: "Absolute path to the file to stamp" } },
@@ -210,7 +210,7 @@ var TOOL_DEFINITIONS = [
210
210
  },
211
211
  {
212
212
  name: "watch",
213
- description: "Opens a new terminal window that monitors pending stamps and attempts due upgrades at a safe interval. The window stays open so the user can watch progress.",
213
+ description: "Opens a new terminal window that continuously monitors pending stamps and attempts due upgrades at each interval. Useful for long-running monitoring sessions after stamping. The window remains open so the user can watch confirmation progress in real time. Minimum interval is 15 minutes to avoid hammering OTS calendars.",
214
214
  inputSchema: {
215
215
  type: "object",
216
216
  properties: {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  normalizeWatchInterval,
3
3
  watchPending
4
- } from "./chunk-KSFL3INC.js";
5
- import "./chunk-ZQUFY5MM.js";
4
+ } from "./chunk-XG7NDZR3.js";
5
+ import "./chunk-4S4MSBQL.js";
6
6
  import "./chunk-YFSUDT24.js";
7
7
  export {
8
8
  normalizeWatchInterval,
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.7.0",
4
+ "version": "0.7.1",
5
5
  "license": "MIT",
6
6
  "description": "OpenTimestamps MCP server — stamp, upgrade, verify via AI agents",
7
7
  "repository": {