ratchet-mcp 0.1.0 → 0.2.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.
Files changed (2) hide show
  1. package/bin/ratchet-mcp.mjs +21 -5
  2. package/package.json +32 -11
@@ -26,11 +26,24 @@ const TIMEOUT_MS = Number.parseInt(process.env.RATCHET_TIMEOUT_MS ?? '15000', 10
26
26
  const log = (m) => process.stderr.write(`[ratchet-mcp] ${m}\n`);
27
27
  const send = (o) => process.stdout.write(`${JSON.stringify(o)}\n`);
28
28
 
29
+ /*
30
+ * A missing key used to be fatal. It should not be.
31
+ *
32
+ * MCP clients connect first and configure second: they call initialize and
33
+ * tools/list before the user has pasted anything. Exiting here meant the client
34
+ * reported "connection closed" — and a directory scanning the server reported
35
+ * "MCP error -32000" — while neither ever learned that a key was the only thing
36
+ * missing.
37
+ *
38
+ * So we start. Discovery works unauthenticated; the first tools/call returns a
39
+ * JSON-RPC error naming exactly what to set. An error the client can show beats
40
+ * a dead process it cannot explain.
41
+ */
29
42
  if (!KEY) {
30
- log('RATCHET_API_KEY is not set.');
31
- log('Add it to the "env" block of your MCP client config — not "args", which');
32
- log('is visible in process listings. Get a key at ' + BASE + '/console');
33
- process.exit(1);
43
+ log('RATCHET_API_KEY is not set — starting anyway.');
44
+ log('Discovery (initialize, tools/list) works without it; calling a tool will not.');
45
+ log('Put it in the "env" block of your MCP client config, not "args", which is');
46
+ log('visible in process listings. Get a key at ' + BASE + '/console');
34
47
  }
35
48
 
36
49
  const rpcError = (id, code, message, data) => ({
@@ -45,7 +58,10 @@ async function forward(msg) {
45
58
  const res = await fetch(`${BASE}/mcp`, {
46
59
  method: 'POST',
47
60
  headers: {
48
- authorization: `Bearer ${KEY}`,
61
+ // Omitted entirely when unset. `Bearer undefined` is a credential the
62
+ // server must reject, which turns "no key" into "bad key" and sends
63
+ // whoever is debugging down the wrong path.
64
+ ...(KEY ? { authorization: `Bearer ${KEY}` } : {}),
49
65
  'content-type': 'application/json',
50
66
  accept: 'application/json',
51
67
  },
package/package.json CHANGED
@@ -1,17 +1,38 @@
1
1
  {
2
2
  "name": "ratchet-mcp",
3
- "version": "0.1.0",
4
- "description": "MCP server for Ratchet — the effect gate for AI agents. Ask before you act, so the same side effect happens at most once.",
5
- "type": "module",
6
- "bin": { "ratchet-mcp": "bin/ratchet-mcp.mjs" },
7
- "files": ["bin", "README.md", "LICENSE"],
8
- "engines": { "node": ">=18" },
3
+ "mcpName": "com.ratchetgate/ratchet",
4
+ "version": "0.2.0",
5
+ "description": "MCP server for Ratchet. Your agent asks before it charges, deploys, publishes or sends \u2014 the same action is attempted at most once.",
9
6
  "license": "Apache-2.0",
7
+ "homepage": "https://ratchetgate.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/thearchitect0x-glitch/ratchet.git",
11
+ "directory": "packages/ratchet-mcp"
12
+ },
13
+ "type": "module",
14
+ "bin": {
15
+ "ratchet-mcp": "bin/ratchet-mcp.mjs"
16
+ },
17
+ "files": [
18
+ "bin",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
10
25
  "keywords": [
11
- "mcp", "model-context-protocol", "ai-agents", "idempotency",
12
- "at-most-once", "side-effects", "agent-infrastructure", "reliability"
26
+ "mcp",
27
+ "model-context-protocol",
28
+ "ai-agents",
29
+ "idempotency",
30
+ "at-most-once",
31
+ "side-effects",
32
+ "agent-infrastructure",
33
+ "reliability"
13
34
  ],
14
- "repository": { "type": "git", "url": "git+https://github.com/thearchitect0x-glitch/ratchet.git", "directory": "packages/ratchet-mcp" },
15
- "homepage": "https://ratchetgate.com",
16
- "publishConfig": { "access": "public" }
35
+ "publishConfig": {
36
+ "access": "public"
37
+ }
17
38
  }