apex-psi-mcp 1.1.0 → 1.1.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
@@ -1,24 +1,25 @@
1
- # APEX PSI MCP Server
1
+ # APEX PSI MCP server
2
2
 
3
- > **Apex PSI is not a tool and not a product. It is the verification substrate — the layer beneath proof. It does not judge. It does not certify. It only remembers.** This server is an application built on that layer.
3
+ > **Apex PSI is not a tool and not a product. It is the verification substrate — the layer beneath proof. It does not judge. It does not certify. It only remembers.** This server is one application built on that layer.
4
4
 
5
- Cryptographic truth infrastructure for AI agents.
5
+ One config line gives any MCP-capable agent (Claude, Cursor, Qoder, Cline, Windsurf, and the rest) five evidence tools: `seal`, `verify`, `anchor`, `cite`, `verify_chain`.
6
6
 
7
- One config line gives any MCP-capable AI agent (Claude, Cursor, Qoder, Cline, Windsurf, and more) five provenance tools: seal, verify, anchor, cite, verify_chain.
7
+ A seal records the SHA-256 hash of a decision, document or artefact in a public append-only ledger and returns a receipt. Anyone can look that hash up again — free, forever, with no account, no key and no cooperation from us.
8
8
 
9
- This server proves the existence and integrity of a record at a point in time. It does not judge the truth of a record's contents. It is an independent verification service, not advice.
9
+ **What a receipt proves:** that this exact content existed at this timestamp, and has not changed since.
10
+ **What it never proves:** that the content is true. A seal is an audit trail, not a verdict.
10
11
 
11
12
  ## Tools
12
13
 
13
- | Tool | Description |
14
+ | Tool | What it actually does |
14
15
  |------|-------------|
15
- | **seal** | Stamp a cryptographic receipt on content (SHA-256 + Ed25519 + post-quantum LMS-W4) |
16
- | **verify** | Confirm a receipt's integrity (hash present in the append-only ledger) |
17
- | **anchor** | Read Bitcoin anchoring status (default), or request anchoring of pending roots |
18
- | **cite** | Generate a citation for a receipt (APA, BibTeX, MLA) |
19
- | **verify_chain** | Independently verify a chain of receipts for integrity |
16
+ | **seal** | Writes the record's SHA-256 hash to the ledger and returns a receipt carrying an Ed25519 signature over the Merkle leaf, an ML-DSA-65 post-quantum signature, and — when a slot is available — an LMS-W4-SHA256 signature. The receipt's own `algorithm` field states which of those it got. |
17
+ | **verify** | Looks a hash (or a whole receipt) up in the ledger and reports whether it is present and unchanged. Integrity, not truth. |
18
+ | **anchor** | Reads the Bitcoin/OpenTimestamps anchoring state of the ledger's pending Merkle roots. Pass `action: "anchor"` explicitly to request that pending roots be submitted — an anchor is confirmed only when a real block is found. |
19
+ | **cite** | Turns a receipt into a citation (APA, BibTeX, MLA) that points at a public, independently checkable record. |
20
+ | **verify_chain** | Recomputes each hash's presence and Merkle continuity across a chain of receipts. A recomputation result, not an opinion. |
20
21
 
21
- ## Installation
22
+ ## Install
22
23
 
23
24
  Add to your MCP client config:
24
25
 
@@ -33,41 +34,50 @@ Add to your MCP client config:
33
34
  }
34
35
  ```
35
36
 
36
- Or install locally:
37
+ Or locally: `npm install apex-psi-mcp`.
37
38
 
38
- ```bash
39
- npm install apex-psi-mcp
40
- ```
39
+ ## Prove it works in two minutes
41
40
 
42
- ## Configuration
41
+ 1. Ask the agent: *"Seal the sentence 'hello psi' with APEX PSI."*
42
+ 2. Take the `decision_hash` from the receipt and paste it into the public verifier:
43
+ <https://www.ai-governance-standard.com/verify>
43
44
 
44
- Environment variables (optional):
45
+ If the site returns the record, the seal is real. You never had to trust this server, our npm
46
+ package, or our word — which is the entire point of the protocol.
45
47
 
46
- - `APEX_API_BASE` — API endpoint (default: `https://qhtntebpcribjiwrdtdd.supabase.co/functions/v1`)
47
- - `APEX_API_KEY` — API key for authenticated access
48
+ ## Limits, stated plainly
48
49
 
49
- ## Usage
50
+ Free use needs no account and no key: **20 operations per minute and 100 per day**, enforced per
51
+ server instance — a flood guard rather than a subscription quota. Above that, an API key raises the
52
+ ceiling; capacity is priced, **the finding never is**. Verification itself is unlimited and free:
53
+ running the verifier locally costs nothing at all —
54
+ [`apex-psi-verifier`](https://www.npmjs.com/package/apex-psi-verifier) on npm,
55
+ [`psi-verifier`](https://pypi.org/project/psi-verifier/) on PyPI.
56
+
57
+ ## Configuration
50
58
 
51
- Once installed, your AI agent can:
59
+ Environment variables (both optional):
52
60
 
53
- 1. **Seal content** — "Seal this document with APEX PSI"
54
- 2. **Verify receipts** — "Verify this receipt against the ledger"
55
- 3. **Check anchoring** — "What is the Bitcoin anchor status of this seal?"
56
- 4. **Generate citations** — "Cite this receipt in APA format"
57
- 5. **Verify a chain** — "Independently verify this chain of receipts"
61
+ - `APEX_API_BASE` — override the notary endpoint. Default:
62
+ `https://qhtntebpcribjiwrdtdd.supabase.co/functions/v1`
63
+ - `APEX_API_KEY` — raises the daily ceiling for a workload. Never required to seal or verify.
58
64
 
59
- Every receipt carries a verify link to `https://ai-governance-standard.com/verify` — sealed arithmetic, public provenance.
65
+ ## What this server does not do
66
+
67
+ - It does not store your content. Only the hash leaves your machine.
68
+ - It does not certify, grade, score or approve anything.
69
+ - It exposes no edit or delete path: the interface this server uses is write-once sealing plus
70
+ read-only lookup. The check that matters is yours to run — re-verify any receipt at any time, and
71
+ any change shows up as a failed lookup.
72
+ - It is not a legal opinion, and no court has agreed to accept a receipt in advance.
60
73
 
61
74
  ## Links
62
75
 
63
- - **Website:** https://ai-governance-standard.com
64
- - **Public Verifier:** https://ai-governance-standard.com/verify
65
- - **npm:** https://www.npmjs.com/package/apex-psi-mcp
76
+ - **Protocol and standard:** <https://www.ai-governance-standard.com>
77
+ - **Public verifier:** <https://www.ai-governance-standard.com/verify>
78
+ - **Machine-readable summary for AI answers:** <https://www.ai-governance-standard.com/llms.txt>
79
+ - **npm:** <https://www.npmjs.com/package/apex-psi-mcp>
66
80
 
67
81
  ## License
68
82
 
69
83
  MIT
70
-
71
- ## Limits
72
-
73
- Free hosted allowance: 20 receipts/minute, 100/day. Offline verification is always free (`npm i apex-psi-verifier`). Higher volume: https://ai-governance-standard.com/upgrade
package/dist/index.d.ts CHANGED
@@ -1,14 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * APEX PSI MCP Server
4
- * Cryptographic truth infrastructure for AI agents.
4
+ * Append-only evidence receipts for AI agents and auditors.
5
5
  *
6
6
  * 5 tools: seal, verify, anchor, cite, verify_chain
7
- * Backend: APEX NOTARY v1.0 (Supabase Edge Functions) — SHA-256 + Ed25519 + LMS-W4-SHA256 (post-quantum)
7
+ * Backend: APEX NOTARY (Supabase Edge Functions) — SHA-256, Ed25519 over the Merkle
8
+ * leaf, ML-DSA-65, and LMS-W4-SHA256 when a slot is available. Each receipt states in
9
+ * its own `algorithm` field which signatures it actually carries.
8
10
  * Override base URL with APEX_API_BASE if self-hosting.
9
11
  *
10
- * Scope: this server anchors the existence and integrity of a record at a point
11
- * in time. It does not judge the truth of a record's contents. It is an
12
- * independent verification service, not advice or an attestable opinion.
12
+ * Scope: this server records the existence and integrity of a record at a point in
13
+ * time. It does not judge the truth of a record's contents. It is an independent
14
+ * verification service, not advice or an attestable opinion.
13
15
  */
14
16
  export {};
package/dist/index.js CHANGED
@@ -1,15 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * APEX PSI MCP Server
4
- * Cryptographic truth infrastructure for AI agents.
4
+ * Append-only evidence receipts for AI agents and auditors.
5
5
  *
6
6
  * 5 tools: seal, verify, anchor, cite, verify_chain
7
- * Backend: APEX NOTARY v1.0 (Supabase Edge Functions) — SHA-256 + Ed25519 + LMS-W4-SHA256 (post-quantum)
7
+ * Backend: APEX NOTARY (Supabase Edge Functions) — SHA-256, Ed25519 over the Merkle
8
+ * leaf, ML-DSA-65, and LMS-W4-SHA256 when a slot is available. Each receipt states in
9
+ * its own `algorithm` field which signatures it actually carries.
8
10
  * Override base URL with APEX_API_BASE if self-hosting.
9
11
  *
10
- * Scope: this server anchors the existence and integrity of a record at a point
11
- * in time. It does not judge the truth of a record's contents. It is an
12
- * independent verification service, not advice or an attestable opinion.
12
+ * Scope: this server records the existence and integrity of a record at a point in
13
+ * time. It does not judge the truth of a record's contents. It is an independent
14
+ * verification service, not advice or an attestable opinion.
13
15
  */
14
16
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
15
17
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -17,7 +19,7 @@ import { z } from "zod";
17
19
  // Configuration
18
20
  const APEX_API_BASE = (process.env.APEX_API_BASE || "https://qhtntebpcribjiwrdtdd.supabase.co/functions/v1").replace(/\/$/, "");
19
21
  const APEX_API_KEY = process.env.APEX_API_KEY || "";
20
- const VERSION = "1.1.0";
22
+ const VERSION = "1.1.1";
21
23
  // Helper: make an API call to the Apex PSI backend
22
24
  async function apexApiCall(endpoint, method = "GET", body) {
23
25
  const url = `${APEX_API_BASE}${endpoint}`;
@@ -30,9 +32,6 @@ async function apexApiCall(endpoint, method = "GET", body) {
30
32
  body: body !== undefined ? JSON.stringify(body) : undefined,
31
33
  });
32
34
  if (!response.ok) {
33
- if (response.status === 429) {
34
- throw new Error("APEX PSI free allowance reached (20/min, 100/day). For higher volume: https://ai-governance-standard.com/upgrade");
35
- }
36
35
  let detail = "";
37
36
  try {
38
37
  detail = (await response.text()).slice(0, 300);
@@ -73,7 +72,7 @@ const server = new McpServer({
73
72
  // Tool: seal
74
73
  server.registerTool("seal", {
75
74
  title: "Seal content",
76
- description: "Stamp a cryptographic receipt on content. Writes to the APEX PSI append-only ledger with SHA-256 hash, Ed25519 signature, and post-quantum LMS-W4-SHA256 signature. Proves existence and integrity at a point in time — not the truth of the contents.",
75
+ description: "Record content in the APEX PSI append-only ledger and return a receipt: SHA-256 hash, an Ed25519 signature over the Merkle leaf, and post-quantum ML-DSA-65 (plus LMS-W4-SHA256 when a slot is available — the receipt's own algorithm field states which). Proves that this content existed and has not changed since the timestamp. It never proves the contents are true. Free tier: 20 operations/minute, 100/day, no account needed.",
77
76
  inputSchema: {
78
77
  content: z.string().max(10000).describe("The content to seal (text, up to 10000 characters)"),
79
78
  context: z.string().optional().describe("Optional context label (e.g. document name, case ID)"),
@@ -137,19 +136,27 @@ server.registerTool("verify", {
137
136
  });
138
137
  // Tool: anchor (status by default; explicit request to anchor pending roots)
139
138
  server.registerTool("anchor", {
140
- title: "Bitcoin anchoring status / request",
141
- description: "Read the Bitcoin (OpenTimestamps) anchoring state of the ledger's pending Merkle roots, or — only when action:'anchor' is passed explicitly — request that pending roots be aggregated and submitted to the OTS calendars. Defaults to 'status' (read-only) so a routine call never triggers a batch write. An anchor becomes confirmed only when a real Bitcoin block is found.",
139
+ title: "Bitcoin anchoring history",
140
+ description: "Read the Bitcoin (OpenTimestamps) anchoring record for the ledger's Merkle roots. Defaults to action:'history', which is read-only and returns each anchor transaction with its txid, block height, confirmation state and how many ledger entries it covers. Pass action:'verify' with a txid to check one transaction, or action:'anchor' to explicitly request that pending roots be aggregated and submitted to the OTS calendars. Defaults to 'history' so a routine call never triggers a batch write. An anchor counts as confirmed only when a real Bitcoin block contains it.",
142
141
  inputSchema: {
143
142
  action: z
144
- .enum(["anchor", "status"])
143
+ .enum(["history", "verify", "anchor"])
144
+ .optional()
145
+ .describe("'history' reads the anchored transactions (default); 'verify' checks one txid; 'anchor' explicitly requests anchoring of pending roots"),
146
+ txid: z
147
+ .string()
145
148
  .optional()
146
- .describe("'status' reads the anchor state (default); 'anchor' explicitly requests anchoring of pending roots"),
149
+ .describe("Bitcoin transaction id — required only when action is 'verify'"),
147
150
  },
148
- }, async ({ action }) => {
151
+ }, async ({ action, txid }) => {
149
152
  try {
150
- const resolved = action || "status";
153
+ const resolved = action || "history";
154
+ if (resolved === "verify" && !txid) {
155
+ return mcpError(new Error("action 'verify' needs a txid to check"));
156
+ }
151
157
  const result = await apexApiCall("/blockchain-anchor", "POST", {
152
158
  action: resolved,
159
+ ...(txid ? { txid } : {}),
153
160
  });
154
161
  return mcpResult({
155
162
  success: true,
@@ -157,7 +164,9 @@ server.registerTool("anchor", {
157
164
  action: resolved,
158
165
  message: resolved === "anchor"
159
166
  ? "Bitcoin anchoring requested for pending roots (OpenTimestamps); confirmation follows only on a real block"
160
- : "Bitcoin anchoring status read (OpenTimestamps)",
167
+ : resolved === "verify"
168
+ ? `Bitcoin transaction ${String(txid).slice(0, 16)}… checked against the anchor record`
169
+ : "Read the anchored Bitcoin transactions (OpenTimestamps)",
161
170
  });
162
171
  }
163
172
  catch (error) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "apex-psi-mcp",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "mcpName": "io.github.kawal393/apex-psi-mcp",
5
- "description": "APEX PSI MCP Server - Cryptographic truth infrastructure for AI agents: seal, verify, anchor, cite, verify_chain",
5
+ "description": "APEX PSI MCP server - append-only evidence receipts for AI decisions and documents: seal a record, verify a hash against the public ledger, check a chain, cite a receipt, read Bitcoin anchoring status. Verification is free and needs no account.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "files": [
@@ -24,12 +24,23 @@
24
24
  "apex-psi",
25
25
  "cryptographic-verification",
26
26
  "provenance",
27
- "truth-infrastructure",
27
+ "evidence",
28
+ "audit-trail",
29
+ "record-integrity",
30
+ "tamper-evident",
31
+ "append-only-ledger",
32
+ "post-quantum",
33
+ "ai-governance",
34
+ "compliance",
28
35
  "ai-agents"
29
36
  ],
30
37
  "author": "APEX PSI",
31
38
  "license": "MIT",
32
- "homepage": "https://ai-governance-standard.com/mcp",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/kawal393/apex-psi-mcp-server.git"
42
+ },
43
+ "homepage": "https://www.ai-governance-standard.com/mcp",
33
44
  "dependencies": {
34
45
  "@modelcontextprotocol/sdk": "^1.12.0",
35
46
  "zod": "^3.23.8"
@@ -44,4 +55,4 @@
44
55
  "publishConfig": {
45
56
  "access": "public"
46
57
  }
47
- }
58
+ }