audit-ledger-mcp 0.1.2 → 0.2.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
@@ -30,26 +30,63 @@ Each call ends up as a regulator-grade audit record in your deployed ledger —
30
30
 
31
31
  ---
32
32
 
33
- ## Install
33
+ ## Quick start — zero configuration
34
34
 
35
35
  ```bash
36
- npm install -g audit-ledger-mcp
36
+ npx -y audit-ledger-mcp
37
37
  ```
38
38
 
39
- Or run on demand without installing:
39
+ That's it. With no environment variables, the server boots into **sandbox mode** and writes records to a shared public tenant on a hosted ledger. You can try every tool — `record_decision`, `verify_decision`, `list_decisions` — without provisioning anything.
40
40
 
41
- ```bash
42
- npx -y audit-ledger-mcp
41
+ When sandbox mode is active, you'll see a banner on stderr:
42
+
43
+ ```
44
+ [audit-ledger-mcp] ─────────────── SANDBOX MODE ───────────────
45
+ [audit-ledger-mcp] No AUDIT_API_URL configured.
46
+ [audit-ledger-mcp] Using the public sandbox at sandbox-public.
47
+ [audit-ledger-mcp] View: https://d2pfirb2397ixy.cloudfront.net
48
+ [audit-ledger-mcp] Do NOT write real personal data...
43
49
  ```
44
50
 
51
+ ### Sandbox properties
52
+
53
+ | | |
54
+ |---|---|
55
+ | **Hosted by** | github.com/shahidh68/audit-ledger (same AWS deployment) |
56
+ | **Tenant** | `sandbox-public` (shared, public) |
57
+ | **Rate limit** | 100 requests/minute per IP |
58
+ | **Retention** | 7 years (records cannot be deleted) |
59
+ | **Audience** | Tyre-kickers, integration tests, framework demos |
60
+ | **NOT for** | Production data, customer PII, real compliance records |
61
+
62
+ ### Wire it into Claude Desktop with zero config
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "audit-ledger-sandbox": {
68
+ "command": "npx",
69
+ "args": ["-y", "audit-ledger-mcp"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ Restart Claude Desktop. The three tools appear in the MCP menu immediately. Try asking Claude to "record this decision: should X be approved?" and watch a record land in the sandbox dashboard.
76
+
45
77
  ---
46
78
 
47
- ## Configure
79
+ ## Production install
80
+
81
+ For real workloads, deploy your own audit ledger and point the MCP server at it:
82
+
83
+ ```bash
84
+ npm install -g audit-ledger-mcp
85
+ ```
48
86
 
49
- The server reads its configuration from environment variables. You need a deployed [AI Audit Ledger](https://github.com/shahidh68/audit-ledger) (or access to one) with at least one tenant write key and read key provisioned in Secrets Manager.
87
+ Configure with **all three** env vars (any of them being set switches off sandbox mode):
50
88
 
51
89
  ```bash
52
- # Required
53
90
  export AUDIT_API_URL="https://<api-id>.execute-api.<region>.amazonaws.com/prod"
54
91
  export AUDIT_WRITE_KEY="<your-tenant-write-key>"
55
92
  export AUDIT_READ_KEY="<your-tenant-read-key>"
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
17
17
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
18
18
  import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
19
19
  import { AuditLedgerClient, AuditLedgerError } from "./client.js";
20
+ import { SANDBOX_CONFIG, isSandboxMode, sandboxBanner } from "./sandbox.js";
20
21
  import { executeRecordDecision, recordDecisionToolDefinition, } from "./tools/record_decision.js";
21
22
  import { executeVerifyDecision, verifyDecisionToolDefinition, } from "./tools/verify_decision.js";
22
23
  import { executeListDecisions, listDecisionsToolDefinition, } from "./tools/list_decisions.js";
@@ -27,28 +28,34 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
27
28
  const PKG = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf8"));
28
29
  const PKG_NAME = PKG.name;
29
30
  const PKG_VERSION = PKG.version;
30
- function requireEnv(name) {
31
- const value = process.env[name];
32
- if (!value) {
33
- process.stderr.write(`[${PKG_NAME}] missing required env var: ${name}\n` +
34
- `See .env.example or the README for required configuration.\n`);
35
- process.exit(1);
36
- }
37
- return value;
38
- }
39
31
  function buildClient() {
40
- const apiUrl = requireEnv("AUDIT_API_URL");
41
- const writeKey = process.env.AUDIT_WRITE_KEY;
42
- const readKey = process.env.AUDIT_READ_KEY;
43
32
  const timeoutMs = process.env.AUDIT_TIMEOUT_MS
44
33
  ? Number(process.env.AUDIT_TIMEOUT_MS)
45
34
  : undefined;
46
35
  const retryAttempts = process.env.AUDIT_RETRY_ATTEMPTS
47
36
  ? Number(process.env.AUDIT_RETRY_ATTEMPTS)
48
37
  : undefined;
38
+ // Sandbox mode: no AUDIT_API_URL configured. Fall back to the public
39
+ // sandbox so the package works zero-config. Records go to a shared
40
+ // public tenant that anyone can read — do NOT write real data.
41
+ if (isSandboxMode()) {
42
+ process.stderr.write(sandboxBanner(PKG_NAME, PKG_VERSION) + "\n");
43
+ return new AuditLedgerClient({
44
+ apiUrl: SANDBOX_CONFIG.apiUrl,
45
+ writeKey: SANDBOX_CONFIG.writeKey,
46
+ readKey: SANDBOX_CONFIG.readKey,
47
+ timeoutMs,
48
+ retryAttempts,
49
+ });
50
+ }
51
+ // Production mode: developer has explicitly configured an endpoint.
52
+ const apiUrl = process.env.AUDIT_API_URL;
53
+ const writeKey = process.env.AUDIT_WRITE_KEY;
54
+ const readKey = process.env.AUDIT_READ_KEY;
49
55
  if (!writeKey && !readKey) {
50
- process.stderr.write(`[${PKG_NAME}] neither AUDIT_WRITE_KEY nor AUDIT_READ_KEY is set ` +
51
- `all tools will fail. Set at least one. See .env.example.\n`);
56
+ process.stderr.write(`[${PKG_NAME}] AUDIT_API_URL is set but neither AUDIT_WRITE_KEY nor\n` +
57
+ `[${PKG_NAME}] AUDIT_READ_KEY is set — all tools will fail. Set at\n` +
58
+ `[${PKG_NAME}] least one. See .env.example.\n`);
52
59
  }
53
60
  return new AuditLedgerClient({ apiUrl, writeKey, readKey, timeoutMs, retryAttempts });
54
61
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mapp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J,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,QAAQ,KAAK,WAAW,uBAAuB,CAAC,CAAC;AAC5E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,QAAQ,YAAY,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Public sandbox configuration.
3
+ *
4
+ * When a developer runs `npx audit-ledger-mcp` with no environment variables,
5
+ * the server falls back to this configuration. Records are written to a
6
+ * shared `sandbox-public` tenant on a hosted audit ledger.
7
+ *
8
+ * Important properties of sandbox mode:
9
+ *
10
+ * 1. The two keys below are baked into the published npm package and are
11
+ * therefore PUBLIC. They grant access only to the `sandbox-public` tenant
12
+ * and cannot be used to read or write to any other tenant's records.
13
+ *
14
+ * 2. Records written in sandbox mode persist in the ledger's S3 Object Lock
15
+ * in COMPLIANCE mode and cannot be deleted before their retention date.
16
+ * This is intentional — visitors should be able to verify their own
17
+ * sandbox records later. Do not write real customer data to the sandbox.
18
+ *
19
+ * 3. The sandbox is rate-limited per-tenant at the ledger level (currently
20
+ * 100 requests per minute). Heavy users should provision their own
21
+ * deployment.
22
+ *
23
+ * 4. The sandbox runs on the same AWS infrastructure as the production
24
+ * deployment for github.com/shahidh68/audit-ledger. Uptime and durability
25
+ * are best-effort. If you need an SLA, deploy your own.
26
+ */
27
+ export declare const SANDBOX_CONFIG: {
28
+ readonly apiUrl: "https://m3csva3l3h.execute-api.eu-west-1.amazonaws.com/prod";
29
+ readonly writeKey: "wk-sandbox-public-0NoHiHBSUUBoan21NWkCMLU5G2d1ijX8";
30
+ readonly readKey: "rk-sandbox-public-XaV3aHdmKH1ZbQl7LswUkTJYJLyGmLh8";
31
+ readonly tenantId: "sandbox-public";
32
+ readonly dashboardUrl: "https://d2pfirb2397ixy.cloudfront.net";
33
+ };
34
+ /**
35
+ * Sandbox mode is triggered when the developer has not configured an audit
36
+ * ledger endpoint. Any explicit AUDIT_API_URL switches off sandbox mode —
37
+ * the server then operates against the configured deployment using whichever
38
+ * keys are present.
39
+ */
40
+ export declare function isSandboxMode(): boolean;
41
+ /**
42
+ * Banner shown on stderr when sandbox mode is active. Designed to make it
43
+ * obvious to a developer that they are using shared infrastructure.
44
+ */
45
+ export declare function sandboxBanner(packageName: string, packageVersion: string): string;
46
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,eAAO,MAAM,cAAc;;;;;;CASjB,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAmBjF"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Public sandbox configuration.
3
+ *
4
+ * When a developer runs `npx audit-ledger-mcp` with no environment variables,
5
+ * the server falls back to this configuration. Records are written to a
6
+ * shared `sandbox-public` tenant on a hosted audit ledger.
7
+ *
8
+ * Important properties of sandbox mode:
9
+ *
10
+ * 1. The two keys below are baked into the published npm package and are
11
+ * therefore PUBLIC. They grant access only to the `sandbox-public` tenant
12
+ * and cannot be used to read or write to any other tenant's records.
13
+ *
14
+ * 2. Records written in sandbox mode persist in the ledger's S3 Object Lock
15
+ * in COMPLIANCE mode and cannot be deleted before their retention date.
16
+ * This is intentional — visitors should be able to verify their own
17
+ * sandbox records later. Do not write real customer data to the sandbox.
18
+ *
19
+ * 3. The sandbox is rate-limited per-tenant at the ledger level (currently
20
+ * 100 requests per minute). Heavy users should provision their own
21
+ * deployment.
22
+ *
23
+ * 4. The sandbox runs on the same AWS infrastructure as the production
24
+ * deployment for github.com/shahidh68/audit-ledger. Uptime and durability
25
+ * are best-effort. If you need an SLA, deploy your own.
26
+ */
27
+ export const SANDBOX_CONFIG = {
28
+ apiUrl: "https://m3csva3l3h.execute-api.eu-west-1.amazonaws.com/prod",
29
+ writeKey: "wk-sandbox-public-0NoHiHBSUUBoan21NWkCMLU5G2d1ijX8",
30
+ readKey: "rk-sandbox-public-XaV3aHdmKH1ZbQl7LswUkTJYJLyGmLh8",
31
+ tenantId: "sandbox-public",
32
+ dashboardUrl: "https://d2pfirb2397ixy.cloudfront.net",
33
+ };
34
+ /**
35
+ * Sandbox mode is triggered when the developer has not configured an audit
36
+ * ledger endpoint. Any explicit AUDIT_API_URL switches off sandbox mode —
37
+ * the server then operates against the configured deployment using whichever
38
+ * keys are present.
39
+ */
40
+ export function isSandboxMode() {
41
+ return !process.env.AUDIT_API_URL;
42
+ }
43
+ /**
44
+ * Banner shown on stderr when sandbox mode is active. Designed to make it
45
+ * obvious to a developer that they are using shared infrastructure.
46
+ */
47
+ export function sandboxBanner(packageName, packageVersion) {
48
+ return [
49
+ `[${packageName}] ─────────────── SANDBOX MODE ───────────────`,
50
+ `[${packageName}] No AUDIT_API_URL configured.`,
51
+ `[${packageName}] Using the public sandbox at ${SANDBOX_CONFIG.tenantId}.`,
52
+ ``,
53
+ `[${packageName}] Records: hosted by github.com/shahidh68/audit-ledger`,
54
+ `[${packageName}] Tenant: ${SANDBOX_CONFIG.tenantId}`,
55
+ `[${packageName}] View: ${SANDBOX_CONFIG.dashboardUrl}`,
56
+ ``,
57
+ `[${packageName}] Do NOT write real personal data — sandbox keys are`,
58
+ `[${packageName}] public and records are visible to anyone with the`,
59
+ `[${packageName}] sandbox read key. For production use, set:`,
60
+ `[${packageName}] AUDIT_API_URL your-deployed-ledger-endpoint`,
61
+ `[${packageName}] AUDIT_WRITE_KEY your-tenant-write-key`,
62
+ `[${packageName}] AUDIT_READ_KEY your-tenant-read-key`,
63
+ `[${packageName}] Deploy your own from https://github.com/shahidh68/audit-ledger`,
64
+ `[${packageName}] ${packageVersion} ───────────────────────────────────`,
65
+ ].join("\n");
66
+ }
67
+ //# sourceMappingURL=sandbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EACJ,6DAA6D;IAC/D,QAAQ,EACN,oDAAoD;IACtD,OAAO,EACL,oDAAoD;IACtD,QAAQ,EAAE,gBAAgB;IAC1B,YAAY,EAAE,uCAAuC;CAC7C,CAAC;AAEX;;;;;GAKG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,WAAmB,EAAE,cAAsB;IACvE,OAAO;QACL,IAAI,WAAW,gDAAgD;QAC/D,IAAI,WAAW,gCAAgC;QAC/C,IAAI,WAAW,iCAAiC,cAAc,CAAC,QAAQ,GAAG;QAC1E,EAAE;QACF,IAAI,WAAW,0DAA0D;QACzE,IAAI,WAAW,gBAAgB,cAAc,CAAC,QAAQ,EAAE;QACxD,IAAI,WAAW,gBAAgB,cAAc,CAAC,YAAY,EAAE;QAC5D,EAAE;QACF,IAAI,WAAW,sDAAsD;QACrE,IAAI,WAAW,qDAAqD;QACpE,IAAI,WAAW,8CAA8C;QAC7D,IAAI,WAAW,oDAAoD;QACnE,IAAI,WAAW,4CAA4C;QAC3D,IAAI,WAAW,2CAA2C;QAC1D,IAAI,WAAW,kEAAkE;QACjF,IAAI,WAAW,KAAK,cAAc,sCAAsC;KACzE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,59 +1,60 @@
1
- {
2
- "name": "audit-ledger-mcp",
3
- "version": "0.1.2",
4
- "description": "MCP server for AI Audit Ledger — record AI decisions to a tamper-evident ledger from any agent (Claude, Cursor, LangGraph, custom).",
5
- "type": "module",
6
- "bin": {
7
- "audit-ledger-mcp": "dist/index.js"
8
- },
9
- "main": "dist/index.js",
10
- "types": "dist/index.d.ts",
11
- "files": [
12
- "dist",
13
- "README.md",
14
- "LICENSE"
15
- ],
16
- "scripts": {
17
- "build": "tsc",
18
- "start": "node dist/index.js",
19
- "dev": "tsc --watch",
20
- "test": "node --test --import tsx tests/*.test.ts",
21
- "integration-test": "tsx tests/integration.test.ts",
22
- "prepublishOnly": "npm run build"
23
- },
24
- "keywords": [
25
- "mcp",
26
- "model-context-protocol",
27
- "ai-audit",
28
- "audit-trail",
29
- "eu-ai-act",
30
- "fca",
31
- "compliance",
32
- "fintech",
33
- "hitl",
34
- "langgraph",
35
- "claude"
36
- ],
37
- "author": "Shahid (https://github.com/shahidh68)",
38
- "license": "Apache-2.0",
39
- "homepage": "https://github.com/shahidh68/audit-ledger-mcp",
40
- "repository": {
41
- "type": "git",
42
- "url": "git+https://github.com/shahidh68/audit-ledger-mcp.git"
43
- },
44
- "bugs": {
45
- "url": "https://github.com/shahidh68/audit-ledger-mcp/issues"
46
- },
47
- "engines": {
48
- "node": ">=20"
49
- },
50
- "dependencies": {
51
- "@modelcontextprotocol/sdk": "^1.0.0",
52
- "zod": "^3.23.0"
53
- },
54
- "devDependencies": {
55
- "@types/node": "^22.0.0",
56
- "tsx": "^4.19.0",
57
- "typescript": "^5.6.0"
58
- }
59
- }
1
+ {
2
+ "name": "audit-ledger-mcp",
3
+ "version": "0.2.1",
4
+ "description": "MCP server for AI Audit Ledger — record AI decisions to a tamper-evident ledger from any agent (Claude, Cursor, LangGraph, custom).",
5
+ "mcpName": "io.github.shahidh68/audit-ledger-mcp",
6
+ "type": "module",
7
+ "bin": {
8
+ "audit-ledger-mcp": "dist/index.js"
9
+ },
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "start": "node dist/index.js",
20
+ "dev": "tsc --watch",
21
+ "test": "node --test --import tsx tests/*.test.ts",
22
+ "integration-test": "tsx tests/integration.test.ts",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "keywords": [
26
+ "mcp",
27
+ "model-context-protocol",
28
+ "ai-audit",
29
+ "audit-trail",
30
+ "eu-ai-act",
31
+ "fca",
32
+ "compliance",
33
+ "fintech",
34
+ "hitl",
35
+ "langgraph",
36
+ "claude"
37
+ ],
38
+ "author": "Shahid (https://github.com/shahidh68)",
39
+ "license": "Apache-2.0",
40
+ "homepage": "https://github.com/shahidh68/audit-ledger-mcp",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/shahidh68/audit-ledger-mcp.git"
44
+ },
45
+ "bugs": {
46
+ "url": "https://github.com/shahidh68/audit-ledger-mcp/issues"
47
+ },
48
+ "engines": {
49
+ "node": ">=20"
50
+ },
51
+ "dependencies": {
52
+ "@modelcontextprotocol/sdk": "^1.0.0",
53
+ "zod": "^3.23.0"
54
+ },
55
+ "devDependencies": {
56
+ "@types/node": "^22.0.0",
57
+ "tsx": "^4.19.0",
58
+ "typescript": "^5.6.0"
59
+ }
60
+ }