@otskit/mcp 0.1.2 → 0.1.3

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/dist/index.js CHANGED
@@ -6,6 +6,7 @@ if (!command || command === "--help" || command === "help") {
6
6
  process.stderr.write(`Usage: ots-mcp <command>
7
7
  Commands:
8
8
  serve Start MCP server (stdio transport)
9
+ install-claude Install MCP in Claude Desktop config (auto-setup)
9
10
  stamp <hash> Stamp a SHA-256 hash
10
11
  upgrade <id> Upgrade a pending stamp
11
12
  verify <id> Verify a stamp
@@ -22,6 +23,11 @@ switch (command) {
22
23
  await runServer();
23
24
  break;
24
25
  }
26
+ case "install-claude": {
27
+ const { installClaude } = await import("./install-claude-UKSS65BW.js");
28
+ installClaude();
29
+ break;
30
+ }
25
31
  case "stamp":
26
32
  case "upgrade":
27
33
  case "verify":
@@ -0,0 +1,44 @@
1
+ // src/install-claude.ts
2
+ import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
3
+ import { join } from "path";
4
+ function getConfigPath() {
5
+ if (process.platform === "win32") {
6
+ return join(process.env.APPDATA ?? "", "Claude", "claude_desktop_config.json");
7
+ } else if (process.platform === "darwin") {
8
+ return join(process.env.HOME ?? "", "Library", "Application Support", "Claude", "claude_desktop_config.json");
9
+ } else {
10
+ return join(process.env.HOME ?? "", ".config", "Claude", "claude_desktop_config.json");
11
+ }
12
+ }
13
+ function installClaude() {
14
+ const configPath = getConfigPath();
15
+ const configDir = join(configPath, "..");
16
+ if (!existsSync(configDir)) {
17
+ mkdirSync(configDir, { recursive: true });
18
+ }
19
+ let config = {};
20
+ if (existsSync(configPath)) {
21
+ try {
22
+ config = JSON.parse(readFileSync(configPath, "utf8"));
23
+ } catch {
24
+ process.stderr.write(`Warning: could not parse existing config, creating new one
25
+ `);
26
+ }
27
+ }
28
+ const mcpServers = config.mcpServers ?? {};
29
+ mcpServers["otskit"] = {
30
+ command: "npx",
31
+ args: ["-y", "@otskit/mcp", "serve"]
32
+ };
33
+ config.mcpServers = mcpServers;
34
+ writeFileSync(configPath, JSON.stringify(config, null, 2), "utf8");
35
+ process.stdout.write(`\u2713 OTSkit MCP installed in Claude Desktop
36
+ `);
37
+ process.stdout.write(` Config: ${configPath}
38
+ `);
39
+ process.stdout.write(` Restart Claude Desktop to apply changes.
40
+ `);
41
+ }
42
+ export {
43
+ installClaude
44
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otskit/mcp",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "OpenTimestamps MCP server — stamp, upgrade, verify via AI agents",
5
5
  "type": "module",
6
6
  "engines": { "node": ">=18" },