@gera-services/mcp-gera-verify 1.1.0 → 1.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.
- package/README.md +2 -0
- package/dist/server.js +68 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -41,6 +41,8 @@ with **no backend, no network, no auth**.
|
|
|
41
41
|
| `get_vouch_public_key` | Returns the Ed25519 public key + `key_id` + verification recipe so **any party can independently verify** an `issue_attestation` receipt without trusting the transport. |
|
|
42
42
|
| `issue_mandate` | **Gera Agent Mandate.** A human/business grants an agent a scoped, revocable, **Ed25519-signed spend mandate** (cap, currency, merchant allowlist, categories, expiry). Pure authorization — no money moves. |
|
|
43
43
|
| `verify_mandate` | Verify a mandate before honouring an action: checks signature, expiry, spend cap, and merchant/category scope against the intended action. **Fails closed** — forged/expired/over-cap/out-of-scope all return `valid:false` with reasons. |
|
|
44
|
+
| `issue_receipt` | **Gera Ledger.** After an agent acts, mint a **signed receipt** of what happened — optionally linking the Vouch attestation + Agent Mandate it acted under. A verifiable proof-of-action (not a settlement). |
|
|
45
|
+
| `verify_receipt` | Verify a receipt's Ed25519 signature against the Gera issuer key — confirms Gera recorded the action, unaltered. Fails closed. |
|
|
44
46
|
|
|
45
47
|
A typical agent flow: `check_business_trust` (or `get_trust_summary`) → drill
|
|
46
48
|
into `lookup_food_hygiene` / `lookup_care_rating` / `verify_provider` for the
|
package/dist/server.js
CHANGED
|
@@ -23,7 +23,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
23
23
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
24
24
|
import { z } from 'zod';
|
|
25
25
|
import { fhrs, cqc, doctors, providers, findByName, norm, } from './data.js';
|
|
26
|
-
import { signAttestation, publicKeyInfo } from './sign.js';
|
|
26
|
+
import { signAttestation, verifyAttestation, publicKeyInfo } from './sign.js';
|
|
27
27
|
import { checkMandate } from './mandate.js';
|
|
28
28
|
function asText(payload) {
|
|
29
29
|
return {
|
|
@@ -464,6 +464,73 @@ export function registerTools(server) {
|
|
|
464
464
|
const result = checkMandate(mandate, signature_b64url, { amount, merchant, category });
|
|
465
465
|
return asText({ ...result, honesty_note: HONESTY_NOTE });
|
|
466
466
|
});
|
|
467
|
+
// ── Tool 10: issue_receipt (Gera Ledger) ──────────────────────────────────
|
|
468
|
+
// Completes the spine chain (verify -> vouch -> mandate -> RECEIPT): once an
|
|
469
|
+
// agent takes an action, it mints a cryptographically signed receipt that the
|
|
470
|
+
// action happened, optionally linking the attestation/mandate it acted under.
|
|
471
|
+
// A verifiable proof-of-action; the hosted append-only registry + dispute
|
|
472
|
+
// resolution is roadmap (this is the stateless signed-receipt primitive).
|
|
473
|
+
server.registerTool('issue_receipt', {
|
|
474
|
+
title: 'Gera Ledger: issue a signed receipt for a completed agent action',
|
|
475
|
+
description: 'After an AI agent acts (books, pays, dispatches), mint a cryptographically signed receipt recording what happened, optionally referencing the Vouch attestation and/or Agent Mandate it acted under. Any party verifies it with verify_receipt + the public key from get_vouch_public_key. A verifiable proof-of-action — not a settlement; Gera moves no money here.',
|
|
476
|
+
inputSchema: {
|
|
477
|
+
action: z.string().describe('What the agent did, e.g. "booked a cleaner".'),
|
|
478
|
+
agent_id: z.string().describe('Identifier of the acting agent.'),
|
|
479
|
+
subject: z.string().describe('Who/what the action was taken on (merchant, provider, counterparty).'),
|
|
480
|
+
outcome: z.enum(['completed', 'failed', 'pending']).optional().describe('Action outcome. Defaults to completed.'),
|
|
481
|
+
amount: z.number().optional().describe('Amount involved, if any.'),
|
|
482
|
+
currency: z.string().optional().describe('ISO currency code. Defaults to GBP when amount is set.'),
|
|
483
|
+
mandate_signature: z.string().optional().describe('The mandate signature this action was authorised under (links the receipt to its mandate).'),
|
|
484
|
+
attestation_signature: z.string().optional().describe('The Vouch attestation signature relied on (links the receipt to its diligence).'),
|
|
485
|
+
evidence: z.array(z.string()).optional().describe('Evidence references (URLs, geo/photo/check-in IDs). Stored verbatim, not validated.'),
|
|
486
|
+
occurred_at: z.string().optional().describe('ISO 8601 time the action occurred. Defaults to now.'),
|
|
487
|
+
},
|
|
488
|
+
}, async ({ action, agent_id, subject, outcome, amount, currency, mandate_signature, attestation_signature, evidence, occurred_at }) => {
|
|
489
|
+
const now = new Date();
|
|
490
|
+
const receipt = {
|
|
491
|
+
receipt_version: '0.1',
|
|
492
|
+
issuer: 'Gera Ledger — a Gera Systems product (gera.services)',
|
|
493
|
+
action,
|
|
494
|
+
agent_id,
|
|
495
|
+
subject,
|
|
496
|
+
outcome: outcome ?? 'completed',
|
|
497
|
+
amount: amount ?? null,
|
|
498
|
+
currency: amount != null ? currency ?? 'GBP' : null,
|
|
499
|
+
references: {
|
|
500
|
+
mandate_signature: mandate_signature ?? null,
|
|
501
|
+
attestation_signature: attestation_signature ?? null,
|
|
502
|
+
},
|
|
503
|
+
evidence: evidence ?? [],
|
|
504
|
+
occurred_at: occurred_at ?? now.toISOString(),
|
|
505
|
+
issued_at: now.toISOString(),
|
|
506
|
+
};
|
|
507
|
+
const signature = signAttestation(receipt);
|
|
508
|
+
return asText({
|
|
509
|
+
receipt,
|
|
510
|
+
signature,
|
|
511
|
+
verify: 'Pass `receipt` + `signature.signature_b64url` to verify_receipt. Public key from get_vouch_public_key.',
|
|
512
|
+
note: 'A signed receipt proves Gera recorded this action as stated, as of issued_at. It is a proof-of-action, not a settlement or guarantee. A hosted, queryable append-only ledger + dispute resolution is on the roadmap.',
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
// ── Tool 11: verify_receipt ───────────────────────────────────────────────
|
|
516
|
+
server.registerTool('verify_receipt', {
|
|
517
|
+
title: 'Gera Ledger: verify a signed action receipt',
|
|
518
|
+
description: 'Verify a receipt from issue_receipt: checks the Ed25519 signature against the Gera issuer key. Returns signature_valid plus the receipt, so any party can confirm Gera recorded this action without trusting the transport. Fails closed on any alteration.',
|
|
519
|
+
inputSchema: {
|
|
520
|
+
receipt: z.record(z.any()).describe('The receipt object returned by issue_receipt.'),
|
|
521
|
+
signature_b64url: z.string().describe('The signature.signature_b64url from issue_receipt.'),
|
|
522
|
+
},
|
|
523
|
+
}, async ({ receipt, signature_b64url }) => {
|
|
524
|
+
const signature_valid = verifyAttestation(receipt, signature_b64url);
|
|
525
|
+
return asText({
|
|
526
|
+
signature_valid,
|
|
527
|
+
receipt,
|
|
528
|
+
result: signature_valid
|
|
529
|
+
? 'Valid: Gera recorded this action as stated; the receipt has not been altered.'
|
|
530
|
+
: 'INVALID: signature does not verify — the receipt is forged or altered.',
|
|
531
|
+
honesty_note: HONESTY_NOTE,
|
|
532
|
+
});
|
|
533
|
+
});
|
|
467
534
|
}
|
|
468
535
|
/**
|
|
469
536
|
* Construct a fully-configured Gera Verify McpServer (all tools registered).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gera-services/mcp-gera-verify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Gera Verify MCP server — \"Proof-of-Real\": let AI agents check if a UK business / food establishment / care provider is real and how trustworthy it is, using real verified FSA food-hygiene, CQC care-registry and Gera verified-provider data. Offline, source-attributed, no auth. A Gera Systems product.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/server.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.geraservicesuk/mcp-gera-verify",
|
|
4
4
|
"description": "Verify if a UK business, food establishment or care provider is real (FSA, CQC and Gera data), and issue a cryptographically signed attestation an AI agent can present before it acts (Gera Vouch).",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/geraservicesuk/globetura",
|
|
8
8
|
"source": "github",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "@gera-services/mcp-gera-verify",
|
|
16
|
-
"version": "1.
|
|
16
|
+
"version": "1.2.0",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
}
|