agent-passport-system-mcp 2.22.2 → 2.24.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/CONTRIBUTING.md +51 -2
- package/README.md +7 -8
- package/build/index.js +207 -1
- package/package.json +4 -3
package/CONTRIBUTING.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Contributing to Agent Passport System MCP Server
|
|
2
2
|
|
|
3
|
-
Thanks for your interest in contributing! This is the MCP server for the [Agent Passport System](https://github.com/aeoess/agent-passport-system) —
|
|
3
|
+
Thanks for your interest in contributing! This is the MCP server for the [Agent Passport System](https://github.com/aeoess/agent-passport-system) — 132 tools across the full protocol surface for AI agent identity, trust, governance, and commerce.
|
|
4
4
|
|
|
5
5
|
## Getting Started
|
|
6
6
|
|
|
@@ -53,6 +53,55 @@ If you're adding new MCP tools, follow the existing pattern in `src/index.ts`:
|
|
|
53
53
|
3. Update the README tool table
|
|
54
54
|
4. Update the tool count in the README header
|
|
55
55
|
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## What makes a PR mergeable
|
|
59
|
+
|
|
60
|
+
1. **Build passes.** `npm run build` succeeds with zero TypeScript errors.
|
|
61
|
+
2. **SDK alignment.** If you're exposing a new SDK capability as an MCP tool, the SDK function must already exist and be tested. This repo wraps; it doesn't redefine.
|
|
62
|
+
3. **Tool naming consistency.** Follow existing naming conventions (`snake_case`, verb-first for actions).
|
|
63
|
+
4. **Zod schemas.** Every tool registers a zod input schema — no untyped parameters.
|
|
64
|
+
5. **README table updated.** New tools show up in the README tool table with their category.
|
|
65
|
+
6. **Scope discipline.** One concern per PR. Refactors ride alongside in separate PRs.
|
|
66
|
+
|
|
67
|
+
## Stability expectations
|
|
68
|
+
|
|
69
|
+
Follows semantic versioning. New tools land in minor releases. Changes to tool signatures (renames, parameter changes) are breaking and require a major version bump with migration notes. SDK version alignment is tracked in `package.json` peer dependencies.
|
|
70
|
+
|
|
71
|
+
## Out of scope
|
|
72
|
+
|
|
73
|
+
- **New protocol logic.** All protocol behavior lives in `agent-passport-system`. This repo exposes it via MCP.
|
|
74
|
+
- **Disabling zod validation** for convenience — validation is load-bearing for MCP client safety.
|
|
75
|
+
- **Named integrations woven into tool implementations** — integration examples belong in documentation or a sibling adapter repo.
|
|
76
|
+
- **Breaking changes to tool signatures** without major version bump and migration documentation.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## How review works
|
|
81
|
+
|
|
82
|
+
Every PR is evaluated against five questions, applied to every contributor equally:
|
|
83
|
+
|
|
84
|
+
1. **Identity.** Is the contributor identifiable, with a real GitHub presence?
|
|
85
|
+
2. **Format.** Does the change match existing patterns (tool registration, zod schema, README table)?
|
|
86
|
+
3. **Substance.** Does the new tool actually wrap tested SDK functionality?
|
|
87
|
+
4. **Scope.** Does the PR stay scoped to its stated purpose?
|
|
88
|
+
5. **Reversibility.** Can the change be reverted cleanly if a downstream issue surfaces?
|
|
89
|
+
|
|
90
|
+
Substantive declines include the reason.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Practical details
|
|
95
|
+
|
|
96
|
+
- **Maintainer:** [@aeoess](https://github.com/aeoess) (Tymofii Pidlisnyi)
|
|
97
|
+
- **Review timing:** maintainer-bandwidth dependent. If a PR has had no response after 5 business days, ping it.
|
|
98
|
+
- **CLA / DCO:** no CLA is required. Contributions accepted on the understanding that the submitter has the right to contribute under the Apache-2.0 license.
|
|
99
|
+
- **Publishing:** maintainers handle npm release publishing. Please do not bump version numbers in PRs. If your change requires a version bump, call that out in the PR description.
|
|
100
|
+
- **Security issues:** open a private security advisory via GitHub rather than a public issue.
|
|
101
|
+
- **Code of Conduct:** Contributor Covenant 2.1 — see [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md).
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
56
105
|
## License
|
|
57
106
|
|
|
58
|
-
By contributing, you agree that your contributions will be licensed under the project's Apache-2.0 license.
|
|
107
|
+
By contributing, you agree that your contributions will be licensed under the project's Apache-2.0 license. See [`LICENSE`](./LICENSE).
|
package/README.md
CHANGED
|
@@ -6,20 +6,19 @@
|
|
|
6
6
|
<img width="380" height="200" src="https://glama.ai/mcp/servers/@aeoess/agent-passport-system-mcp/badge" />
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Enforcement and accountability layer for AI agents. Bring your own identity. 20 essential tools by default: identity, delegation, enforcement, commerce, reputation.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx agent-passport-system-mcp
|
|
12
|
+
APS_PROFILE=essential npx agent-passport-system-mcp
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Set `APS_PROFILE=
|
|
16
|
-
Set `APS_PROFILE=full` for all 132 tools.
|
|
15
|
+
`essential` is the default profile — the 20 tools 90% of integrations need. Set `APS_PROFILE=full` for all 143 tools.
|
|
17
16
|
|
|
18
|
-
Available profiles: essential, identity, governance, coordination, commerce, data, gateway, comms, minimal, full.
|
|
17
|
+
Available profiles: essential (default), identity, governance, coordination, commerce, data, gateway, comms, minimal, full.
|
|
19
18
|
|
|
20
19
|
> **For AI agents:** visit [aeoess.com/llms.txt](https://aeoess.com/llms.txt) for machine-readable documentation or [llms-full.txt](https://aeoess.com/llms-full.txt) for the complete technical reference. MCP discovery: [.well-known/mcp.json](https://aeoess.com/.well-known/mcp.json).
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
Works with any MCP client: Claude Desktop, Claude Code, Cursor, Windsurf, and more. Full surface area under `APS_PROFILE=full`: 143 tools across 103 modules (71 core + 32 v2 constitutional governance). Independently cited by [PDR in Production (Nanook & Gerundium, UBC)](https://doi.org/10.5281/zenodo.19323172).
|
|
23
22
|
|
|
24
23
|
## Quick Start
|
|
25
24
|
|
|
@@ -70,7 +69,7 @@ Or for remote SSE:
|
|
|
70
69
|
```
|
|
71
70
|
</details>
|
|
72
71
|
|
|
73
|
-
## Tools (
|
|
72
|
+
## Tools (132)
|
|
74
73
|
|
|
75
74
|
### Identity (Layer 1) — 5 tools
|
|
76
75
|
|
|
@@ -217,7 +216,7 @@ Layer 1 — Agent Passport Protocol (Ed25519 identity)
|
|
|
217
216
|
|
|
218
217
|
## Links
|
|
219
218
|
|
|
220
|
-
- npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v1.
|
|
219
|
+
- npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v1.42.0, 2844 tests)
|
|
221
220
|
- Python SDK: [agent-passport-system](https://pypi.org/project/agent-passport-system/) (v0.8.0)
|
|
222
221
|
- Paper (Protocol): [doi.org/10.5281/zenodo.18749779](https://doi.org/10.5281/zenodo.18749779)
|
|
223
222
|
- Paper (Faceted Narrowing): [doi.org/10.5281/zenodo.19260073](https://doi.org/10.5281/zenodo.19260073)
|
package/build/index.js
CHANGED
|
@@ -62,7 +62,9 @@ import { registerSelfAttestedSource, createContributionLedger, queryContribution
|
|
|
62
62
|
// Data Lifecycle Governance (Modules 43+)
|
|
63
63
|
import { createDerivationReceipt, resolveExtendedLineage, evaluateRevocationImpact, createDecisionLineageReceipt, isPurposePermitted, purposeCategory, isRetentionExpired, checkAggregateConstraints, isTransferPermitted, computeGovernanceTaint, fileDispute, checkCombinationPermitted, createAccessSnapshot, resolveRightsPropagation, DEFAULT_RIGHTS_PROPAGATION, detectPurposeDrift, declareReidentificationRisk, verifyGovernanceBlock, parseGovernanceBlockFromHTML, isUsagePermitted, embedGovernance, generateApsTxt, verifyApsTxt, resolveTermsForPath, createChainedGovernanceBlock, createAccessReceipt, governanceLoop360, } from "agent-passport-system";
|
|
64
64
|
// Rome-Complete: Charter, Approval, Time, Reserve, Federation
|
|
65
|
-
import { createCharter, signCharter, verifyCharter, evaluateThreshold, createApprovalRequest, addApprovalSignature, createHybridTimestamp, compareTimestamps, validateTemporalRights, createReserveAttestation, vouchReputation, applyReputationDowngrade,
|
|
65
|
+
import { createCharter, signCharter, verifyCharter, evaluateThreshold, createApprovalRequest, addApprovalSignature, createHybridTimestamp, compareTimestamps, validateTemporalRights, createReserveAttestation, vouchReputation, applyReputationDowngrade,
|
|
66
|
+
// v2 boundary primitives (AttributionConsent, ProvisionalStatement, HumanEscalationFlag)
|
|
67
|
+
createAttributionReceipt, signAttributionConsent, verifyAttributionConsent, checkArtifactCitations, receiptCore, createProvisional, promoteStatement, verifyPromotion, withdrawProvisional, withdrawalPayload, isBinding, checkEscalationRequired, requestOwnerConfirmation, recordOwnerConfirmation, } from "agent-passport-system";
|
|
66
68
|
// ═══════════════════════════════════════
|
|
67
69
|
// State Management
|
|
68
70
|
// ═══════════════════════════════════════
|
|
@@ -454,6 +456,10 @@ const TOOL_PROFILES = {
|
|
|
454
456
|
'create_agent_context', 'execute_with_context',
|
|
455
457
|
'commerce_preflight', 'get_commerce_spend', 'request_human_approval',
|
|
456
458
|
'resolve_authority', 'check_tier', 'rotate_key',
|
|
459
|
+
// v2 boundary primitives — most-used entry points
|
|
460
|
+
'aps_create_attribution_receipt',
|
|
461
|
+
'aps_create_provisional',
|
|
462
|
+
'aps_check_escalation_required',
|
|
457
463
|
]),
|
|
458
464
|
};
|
|
459
465
|
const activeProfile = (process.env.APS_PROFILE || 'full').toLowerCase();
|
|
@@ -631,6 +637,18 @@ const TOOL_SCOPE_MAP = {
|
|
|
631
637
|
'compare_timestamps': 'temporal',
|
|
632
638
|
'validate_temporal_rights': 'temporal',
|
|
633
639
|
'create_reserve_attestation': 'temporal',
|
|
640
|
+
// v2 boundary primitives
|
|
641
|
+
'aps_create_attribution_receipt': 'governance',
|
|
642
|
+
'aps_sign_attribution_consent': 'governance',
|
|
643
|
+
'aps_verify_attribution_consent': 'governance',
|
|
644
|
+
'aps_check_artifact_citations': 'governance',
|
|
645
|
+
'aps_attribution_receipt_id': 'governance',
|
|
646
|
+
'aps_create_provisional': 'coordination',
|
|
647
|
+
'aps_promote_statement': 'coordination',
|
|
648
|
+
'aps_verify_promotion': 'coordination',
|
|
649
|
+
'aps_withdraw_provisional': 'coordination',
|
|
650
|
+
'aps_check_escalation_required': 'delegation',
|
|
651
|
+
'aps_record_owner_confirmation': 'delegation',
|
|
634
652
|
};
|
|
635
653
|
// ═══════════════════════════════════════
|
|
636
654
|
// TOOL: list_profiles
|
|
@@ -4532,6 +4550,194 @@ server.tool("is_key_active", "Check if a public key is currently authorized for
|
|
|
4532
4550
|
const active = isKeyActive(doc, args.public_key);
|
|
4533
4551
|
return { content: [{ type: "text", text: `${active ? '✅ Active' : '🔒 Inactive/Retired'}\n\nKey: ${args.public_key.slice(0, 16)}...\nDID: ${doc.id || 'unknown'}\nVerification methods: ${doc.verificationMethod.length}\nRotation log entries: ${(doc.rotationLog || []).length}` }] };
|
|
4534
4552
|
});
|
|
4553
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4554
|
+
// v2 Boundary Primitives — AttributionConsent, ProvisionalStatement,
|
|
4555
|
+
// HumanEscalationFlag. Representation, commitment, escalation boundaries.
|
|
4556
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4557
|
+
// ── AttributionConsent (representation boundary) ────────────────
|
|
4558
|
+
server.tool("aps_create_attribution_receipt", "Representation boundary: build a citer-signed AttributionReceipt attributing a claim to a third-party principal. The receipt is not yet valid — the cited principal must sign consent via aps_sign_attribution_consent before checkArtifactCitations accepts it.", {
|
|
4559
|
+
citer: z.string().describe("DID/public key of the citing agent"),
|
|
4560
|
+
citer_public_key: z.string().describe("Hex public key of citer"),
|
|
4561
|
+
citer_private_key: z.string().describe("Hex private key of citer"),
|
|
4562
|
+
cited_principal: z.string().describe("DID/public key of the cited principal"),
|
|
4563
|
+
cited_principal_public_key: z.string().describe("Hex public key of cited principal"),
|
|
4564
|
+
citation_content: z.string().describe("The quoted or paraphrased claim"),
|
|
4565
|
+
binding_context: z.string().describe("ID of the binding artifact this citation is scoped to"),
|
|
4566
|
+
gateway_id: z.string().optional().describe("Gateway id for timestamping (default: 'mcp')"),
|
|
4567
|
+
ttl_ms: z.number().optional().describe("Receipt TTL in ms (default: 24h)"),
|
|
4568
|
+
}, async (args) => {
|
|
4569
|
+
try {
|
|
4570
|
+
const gw = args.gateway_id ?? 'mcp';
|
|
4571
|
+
const ttl = args.ttl_ms ?? 24 * 3600_000;
|
|
4572
|
+
const created_at = createHybridTimestamp(gw);
|
|
4573
|
+
const expires_at = createHybridTimestamp(gw);
|
|
4574
|
+
expires_at.wallClockEarliest = created_at.wallClockEarliest + ttl;
|
|
4575
|
+
expires_at.wallClockLatest = created_at.wallClockLatest + ttl;
|
|
4576
|
+
const receipt = createAttributionReceipt({
|
|
4577
|
+
citer: args.citer,
|
|
4578
|
+
citer_public_key: args.citer_public_key,
|
|
4579
|
+
citer_private_key: args.citer_private_key,
|
|
4580
|
+
cited_principal: args.cited_principal,
|
|
4581
|
+
cited_principal_public_key: args.cited_principal_public_key,
|
|
4582
|
+
citation_content: args.citation_content,
|
|
4583
|
+
binding_context: args.binding_context,
|
|
4584
|
+
created_at, expires_at,
|
|
4585
|
+
});
|
|
4586
|
+
return { content: [{ type: "text", text: JSON.stringify(receipt, null, 2) }] };
|
|
4587
|
+
}
|
|
4588
|
+
catch (e) {
|
|
4589
|
+
return { content: [{ type: "text", text: safeError("createAttributionReceipt failed", e) }], isError: true };
|
|
4590
|
+
}
|
|
4591
|
+
});
|
|
4592
|
+
server.tool("aps_sign_attribution_consent", "Representation boundary: the cited principal adds their consent signature to an AttributionReceipt. Without this signature, verifyAttributionConsent and checkArtifactCitations reject the receipt.", {
|
|
4593
|
+
receipt: z.any().describe("AttributionReceipt JSON from aps_create_attribution_receipt"),
|
|
4594
|
+
cited_principal_private_key: z.string().describe("Hex private key of cited principal"),
|
|
4595
|
+
}, async (args) => {
|
|
4596
|
+
try {
|
|
4597
|
+
const signed = signAttributionConsent(args.receipt, args.cited_principal_private_key);
|
|
4598
|
+
return { content: [{ type: "text", text: JSON.stringify(signed, null, 2) }] };
|
|
4599
|
+
}
|
|
4600
|
+
catch (e) {
|
|
4601
|
+
return { content: [{ type: "text", text: safeError("signAttributionConsent failed", e) }], isError: true };
|
|
4602
|
+
}
|
|
4603
|
+
});
|
|
4604
|
+
server.tool("aps_verify_attribution_consent", "Representation boundary: verify an AttributionReceipt end-to-end (id, citer signature, consent signature, expiry). Returns {valid, reason?}.", {
|
|
4605
|
+
receipt: z.any().describe("AttributionReceipt JSON"),
|
|
4606
|
+
now: z.any().optional().describe("Optional HybridTimestamp to pin the evaluation moment"),
|
|
4607
|
+
}, async (args) => {
|
|
4608
|
+
const result = verifyAttributionConsent(args.receipt, args.now);
|
|
4609
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
4610
|
+
});
|
|
4611
|
+
server.tool("aps_check_artifact_citations", "Representation boundary: gate a binding artifact's citations. Each citation must resolve to a provided, signed, unexpired receipt whose content + principal match, with per-artifact replay protection.", {
|
|
4612
|
+
artifact: z.any().describe("CitingArtifact with optional citations[] array"),
|
|
4613
|
+
receipts: z.array(z.any()).describe("AttributionReceipts backing each citation"),
|
|
4614
|
+
binding_context: z.string().optional().describe("Require receipts to be scoped to this binding context"),
|
|
4615
|
+
}, async (args) => {
|
|
4616
|
+
const opts = {};
|
|
4617
|
+
if (args.binding_context)
|
|
4618
|
+
opts.binding_context = args.binding_context;
|
|
4619
|
+
const result = checkArtifactCitations(args.artifact, args.receipts, opts);
|
|
4620
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
4621
|
+
});
|
|
4622
|
+
server.tool("aps_attribution_receipt_id", "Representation boundary helper: compute the canonical sha256 id of an AttributionReceipt's unsigned core. Verifiers use this to detect id tampering.", {
|
|
4623
|
+
receipt: z.any().describe("AttributionReceipt JSON (signatures ignored)"),
|
|
4624
|
+
}, async (args) => {
|
|
4625
|
+
const { createHash } = await import('crypto');
|
|
4626
|
+
const core = receiptCore(args.receipt);
|
|
4627
|
+
const id = createHash('sha256').update(core).digest('hex');
|
|
4628
|
+
return { content: [{ type: "text", text: JSON.stringify({ id, core_bytes: core.length }, null, 2) }] };
|
|
4629
|
+
});
|
|
4630
|
+
// ── ProvisionalStatement (commitment boundary) ──────────────────
|
|
4631
|
+
server.tool("aps_create_provisional", "Commitment boundary: emit a provisional statement for agent-to-agent negotiation. Default is non-binding until a PromotionEvent satisfies a PromotionPolicy. Dead-man expiry auto-withdraws.", {
|
|
4632
|
+
author: z.string().describe("AgentDID/public key of the emitting agent"),
|
|
4633
|
+
author_principal: z.string().describe("PrincipalDID behind the author"),
|
|
4634
|
+
content: z.string().describe("Statement content (offer, position, claim)"),
|
|
4635
|
+
author_private_key: z.string().describe("Hex private key of author for signing"),
|
|
4636
|
+
gateway_id: z.string().optional().describe("Gateway id for timestamping (default: 'mcp')"),
|
|
4637
|
+
dead_man_ms: z.number().optional().describe("Dead-man expiry relative to now (ms). If elapsed without promotion/withdrawal, statement auto-withdraws."),
|
|
4638
|
+
}, async (args) => {
|
|
4639
|
+
try {
|
|
4640
|
+
const gw = args.gateway_id ?? 'mcp';
|
|
4641
|
+
let dead_man_expires_at;
|
|
4642
|
+
if (typeof args.dead_man_ms === 'number') {
|
|
4643
|
+
const dm = createHybridTimestamp(gw);
|
|
4644
|
+
dm.wallClockEarliest += args.dead_man_ms;
|
|
4645
|
+
dm.wallClockLatest += args.dead_man_ms;
|
|
4646
|
+
dead_man_expires_at = dm;
|
|
4647
|
+
}
|
|
4648
|
+
const statement = createProvisional({
|
|
4649
|
+
author: args.author,
|
|
4650
|
+
author_principal: args.author_principal,
|
|
4651
|
+
content: args.content,
|
|
4652
|
+
authorPrivateKey: args.author_private_key,
|
|
4653
|
+
gatewayId: gw,
|
|
4654
|
+
...(dead_man_expires_at ? { dead_man_expires_at } : {}),
|
|
4655
|
+
});
|
|
4656
|
+
return { content: [{ type: "text", text: JSON.stringify(statement, null, 2) }] };
|
|
4657
|
+
}
|
|
4658
|
+
catch (e) {
|
|
4659
|
+
return { content: [{ type: "text", text: safeError("createProvisional failed", e) }], isError: true };
|
|
4660
|
+
}
|
|
4661
|
+
});
|
|
4662
|
+
server.tool("aps_promote_statement", "Commitment boundary: promote a provisional statement to binding by attaching a PromotionEvent that satisfies the PromotionPolicy (m-of-n principal signatures). dead_man_elapsed cannot promote — it auto-withdraws via the dead-man path.", {
|
|
4663
|
+
statement: z.any().describe("ProvisionalStatement from aps_create_provisional"),
|
|
4664
|
+
promotion_event: z.any().describe("PromotionEvent with kind, promoted_at, promoter, promoter_signature, policy_reference"),
|
|
4665
|
+
policy: z.any().describe("PromotionPolicy {id, required_signers, threshold, max_time_to_promote}"),
|
|
4666
|
+
}, async (args) => {
|
|
4667
|
+
try {
|
|
4668
|
+
const promoted = promoteStatement(args.statement, args.promotion_event, args.policy);
|
|
4669
|
+
return { content: [{ type: "text", text: JSON.stringify({ promoted, is_binding: isBinding(promoted) }, null, 2) }] };
|
|
4670
|
+
}
|
|
4671
|
+
catch (e) {
|
|
4672
|
+
return { content: [{ type: "text", text: safeError("promoteStatement failed", e) }], isError: true };
|
|
4673
|
+
}
|
|
4674
|
+
});
|
|
4675
|
+
server.tool("aps_verify_promotion", "Commitment boundary: verify that a promoted statement's PromotionEvent cryptographically satisfies the PromotionPolicy (policy_reference match, promoter in required_signers, threshold, signature, max_time_to_promote, author-signature tamper check).", {
|
|
4676
|
+
statement: z.any().describe("Promoted ProvisionalStatement"),
|
|
4677
|
+
policy: z.any().describe("PromotionPolicy to check against"),
|
|
4678
|
+
}, async (args) => {
|
|
4679
|
+
const result = verifyPromotion(args.statement, args.policy);
|
|
4680
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
4681
|
+
});
|
|
4682
|
+
server.tool("aps_withdraw_provisional", "Commitment boundary: author withdraws their own provisional statement. Already-promoted statements cannot be withdrawn. Caller must supply the author's signature over the withdrawal payload (canonicalize({action:'withdraw', statement_id})).", {
|
|
4683
|
+
statement: z.any().describe("ProvisionalStatement to withdraw"),
|
|
4684
|
+
author_signature: z.string().optional().describe("Hex Ed25519 signature. If omitted, provide author_private_key and the tool will sign for you."),
|
|
4685
|
+
author_private_key: z.string().optional().describe("If provided, tool signs the withdrawal payload with this key."),
|
|
4686
|
+
}, async (args) => {
|
|
4687
|
+
try {
|
|
4688
|
+
let sig = args.author_signature;
|
|
4689
|
+
if (!sig) {
|
|
4690
|
+
if (!args.author_private_key) {
|
|
4691
|
+
throw new Error('Supply author_signature or author_private_key');
|
|
4692
|
+
}
|
|
4693
|
+
const { sign } = await import('agent-passport-system');
|
|
4694
|
+
sig = sign(withdrawalPayload(args.statement.id), args.author_private_key);
|
|
4695
|
+
}
|
|
4696
|
+
const withdrawn = withdrawProvisional(args.statement, sig);
|
|
4697
|
+
return { content: [{ type: "text", text: JSON.stringify(withdrawn, null, 2) }] };
|
|
4698
|
+
}
|
|
4699
|
+
catch (e) {
|
|
4700
|
+
return { content: [{ type: "text", text: safeError("withdrawProvisional failed", e) }], isError: true };
|
|
4701
|
+
}
|
|
4702
|
+
});
|
|
4703
|
+
// ── HumanEscalationFlag (escalation boundary) ───────────────────
|
|
4704
|
+
server.tool("aps_check_escalation_required", "Escalation boundary: check whether an action on a v2 delegation requires owner confirmation before execution. Returns {required, requirement?, reason?}. Use aps_record_owner_confirmation to clear the flag when required.", {
|
|
4705
|
+
delegation: z.any().describe("V2Delegation with optional scope.escalation_requirements"),
|
|
4706
|
+
action_class: z.string().describe("Action class (e.g. 'org_creation', 'spend_above_threshold')"),
|
|
4707
|
+
action_details: z.any().optional().describe("Structured details; hashed for audit"),
|
|
4708
|
+
session_id: z.string().optional().describe("Session id (required for per_session scope)"),
|
|
4709
|
+
}, async (args) => {
|
|
4710
|
+
const check = checkEscalationRequired(args.delegation, {
|
|
4711
|
+
action_class: args.action_class,
|
|
4712
|
+
action_details: args.action_details ?? {},
|
|
4713
|
+
session_id: args.session_id ?? null,
|
|
4714
|
+
});
|
|
4715
|
+
return { content: [{ type: "text", text: JSON.stringify(check, null, 2) }] };
|
|
4716
|
+
});
|
|
4717
|
+
server.tool("aps_record_owner_confirmation", "Escalation boundary: owner signs an OwnerConfirmation authorizing a flagged action. Builds the ConfirmationRequest and signs it in a single call. The confirmation is bound to action_details via hash and scoped (per_action / per_session / time_window).", {
|
|
4718
|
+
delegation: z.any().describe("V2Delegation with escalation_requirements for this action class"),
|
|
4719
|
+
action_class: z.string().describe("Action class being confirmed"),
|
|
4720
|
+
action_details: z.any().describe("Structured action details — hashed and bound to the confirmation"),
|
|
4721
|
+
session_id: z.string().optional().describe("Session id (required for per_session scope)"),
|
|
4722
|
+
owner_private_key: z.string().describe("Hex private key of the delegation's owner (delegator)"),
|
|
4723
|
+
}, async (args) => {
|
|
4724
|
+
try {
|
|
4725
|
+
const request = requestOwnerConfirmation(args.delegation, {
|
|
4726
|
+
action_class: args.action_class,
|
|
4727
|
+
action_details: args.action_details ?? {},
|
|
4728
|
+
session_id: args.session_id ?? null,
|
|
4729
|
+
});
|
|
4730
|
+
const confirmation = recordOwnerConfirmation({
|
|
4731
|
+
request,
|
|
4732
|
+
delegation: args.delegation,
|
|
4733
|
+
owner_private_key: args.owner_private_key,
|
|
4734
|
+
});
|
|
4735
|
+
return { content: [{ type: "text", text: JSON.stringify({ request, confirmation }, null, 2) }] };
|
|
4736
|
+
}
|
|
4737
|
+
catch (e) {
|
|
4738
|
+
return { content: [{ type: "text", text: safeError("recordOwnerConfirmation failed", e) }], isError: true };
|
|
4739
|
+
}
|
|
4740
|
+
});
|
|
4535
4741
|
server.prompt("coordination_role", "Get instructions for your assigned coordination role", {}, async () => {
|
|
4536
4742
|
const role = state.agentRole || 'default';
|
|
4537
4743
|
const instructions = ROLE_PROMPTS[role] || ROLE_PROMPTS['default'];
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-passport-system-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.24.0",
|
|
4
4
|
"mcpName": "io.github.aeoess/agent-passport-mcp",
|
|
5
|
-
"description": "MCP server for the Agent Passport System — enforcement infrastructure for the agent economy.
|
|
5
|
+
"description": "MCP server for the Agent Passport System — enforcement infrastructure for the agent economy. 143 tools across 103 modules. Policy eval <2ms. Identity, delegation, reputation, enforcement, attestation, feeless Nano wallet, commerce. Tracks SDK v1.42.0 (2,843 tests).",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"agent-passport-system-mcp": "./build/bin.js",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "npx tsc && chmod 755 build/bin.js build/index.js build/setup.js",
|
|
18
|
+
"test": "node --test tests/",
|
|
18
19
|
"watch": "tsc --watch",
|
|
19
20
|
"inspector": "npx @modelcontextprotocol/inspector build/index.js",
|
|
20
21
|
"prepublishOnly": "npm run build",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"homepage": "https://github.com/aeoess/agent-passport-mcp",
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
52
|
-
"agent-passport-system": "^1.
|
|
53
|
+
"agent-passport-system": "^1.42.0",
|
|
53
54
|
"zod": "^3.25.76"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|