agent-passport-system-mcp 4.0.0 → 5.0.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
@@ -6,19 +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
- Enforcement and accountability layer for AI agents. Bring your own identity. 150 tools by default across identity, delegation, enforcement, commerce, reputation, governance, coordination, and data.
9
+ Enforcement and accountability layer for AI agents. Bring your own identity. 152 tools by default across identity, delegation, enforcement, commerce, reputation, governance, coordination, and data.
10
10
 
11
11
  ```bash
12
12
  npx agent-passport-system-mcp
13
13
  ```
14
14
 
15
- The default profile is `full` — all 150 tools. Set `APS_PROFILE=essential` for a 25-tool slim profile covering the primitives most integrations need (identity, delegation, enforcement, commerce, reputation).
15
+ The default profile is `full` — all 152 tools. Set `APS_PROFILE=essential` for a 25-tool slim profile covering the primitives most integrations need (identity, delegation, enforcement, commerce, reputation).
16
16
 
17
17
  Available profiles: full (default), essential, identity, governance, coordination, commerce, data, gateway, comms, minimal.
18
18
 
19
19
  > **For AI agents:** visit [agent-passport.org/llms.txt](https://agent-passport.org/llms.txt) for machine-readable documentation or [llms-full.txt](https://agent-passport.org/llms-full.txt) for the complete technical reference. MCP discovery: [.well-known/mcp.json](https://agent-passport.org/.well-known/mcp.json).
20
20
 
21
- Works with any MCP client: Claude Desktop, Claude Code, Cursor, Windsurf, and more. Full surface area (the default): 150 tools across the protocol surface, including Wave 1 accountability primitives (Ed25519 ActionReceipt, AuthorityBoundaryReceipt, CustodyReceipt, ContestabilityReceipt, APSBundle, strict RFC 8785 JCS for interop-facing receipts, byte-match across implementations). Independently cited by [PDR in Production preprint (Nanook & Gerundium)](https://doi.org/10.5281/zenodo.19323172).
21
+ Works with any MCP client: Claude Desktop, Claude Code, Cursor, Windsurf, and more. Full surface area (the default): 152 tools across the protocol surface, including Wave 1 accountability primitives (Ed25519 ActionReceipt, AuthorityBoundaryReceipt, CustodyReceipt, ContestabilityReceipt, APSBundle, strict RFC 8785 JCS for interop-facing receipts, byte-match across implementations). Independently cited by [PDR in Production preprint (Nanook & Gerundium)](https://doi.org/10.5281/zenodo.19323172).
22
22
 
23
23
  ## Quick Start
24
24
 
@@ -69,7 +69,7 @@ Or for remote SSE:
69
69
  ```
70
70
  </details>
71
71
 
72
- ## Tools (150)
72
+ ## Tools (152)
73
73
 
74
74
  ### Identity (Layer 1) — 5 tools
75
75
 
@@ -215,9 +215,9 @@ Layer 1 — Agent Passport Protocol (Ed25519 identity)
215
215
 
216
216
  ## Links
217
217
 
218
- - npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v3.3.0, 4,360 tests)
219
- - Python SDK: [agent-passport-system](https://pypi.org/project/agent-passport-system/) (v2.8.0)
220
- - Go SDK: [agent-passport-go](https://pkg.go.dev/github.com/aeoess/agent-passport-go) (v0.3.0; `go get github.com/aeoess/agent-passport-go@v0.3.0`)
218
+ - npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v4.4.0, 4,500 tests)
219
+ - Python SDK: [agent-passport-system](https://pypi.org/project/agent-passport-system/) (v2.11.0)
220
+ - Go SDK: [agent-passport-go](https://pkg.go.dev/github.com/aeoess/agent-passport-go) (v0.5.0; `go get github.com/aeoess/agent-passport-go@v0.5.0`)
221
221
  - Paper (Social Contract): [doi.org/10.5281/zenodo.18749779](https://doi.org/10.5281/zenodo.18749779)
222
222
  - Paper (Monotonic Narrowing): [doi.org/10.5281/zenodo.18932404](https://doi.org/10.5281/zenodo.18932404)
223
223
  - Paper (Faceted Authority Attenuation): [doi.org/10.5281/zenodo.19260073](https://doi.org/10.5281/zenodo.19260073)
@@ -226,7 +226,8 @@ Layer 1 — Agent Passport Protocol (Ed25519 identity)
226
226
  - Paper (Governance in the Medium): [doi.org/10.5281/zenodo.19582550](https://doi.org/10.5281/zenodo.19582550)
227
227
  - Paper (Cognitive Attestation): [doi.org/10.5281/zenodo.19646276](https://doi.org/10.5281/zenodo.19646276)
228
228
  - Paper (The Evidence-Safety Gap): [doi.org/10.5281/zenodo.19914628](https://doi.org/10.5281/zenodo.19914628)
229
- - IETF Internet-Draft: `draft-pidlisnyi-aps-01`
229
+ - Paper (Plausibly Wrong): [doi.org/10.5281/zenodo.21208555](https://doi.org/10.5281/zenodo.21208555)
230
+ - IETF Internet-Draft: [`draft-pidlisnyi-aps`](https://datatracker.ietf.org/doc/draft-pidlisnyi-aps/)
230
231
  - Docs: [aeoess.com/llms-full.txt](https://agent-passport.org/llms-full.txt)
231
232
  - Agora: [aeoess.com/agora.html](https://aeoess.com/agora.html)
232
233
 
package/build/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { McpServer } from "@modelcontextprotocol/server";
3
+ export declare const SERVER_INFO: {
4
+ name: string;
5
+ version: string;
6
+ };
7
+ export declare const REGISTERED_TOOL_NAMES: string[];
3
8
  export declare function createSandboxServer(): McpServer;
package/build/index.js CHANGED
@@ -55,7 +55,7 @@ import { registerSelfAttestedSource, } from "agent-passport-system";
55
55
  // Data Lifecycle Governance (Modules 43+)
56
56
  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";
57
57
  // Rome-Complete: Charter, Approval, Time, Reserve, Federation
58
- import { createCharter, signCharter, verifyCharter, evaluateThreshold, createApprovalRequest, addApprovalSignature, createHybridTimestamp, compareTimestamps, validateTemporalRights, createReserveAttestation, vouchReputation, applyReputationDowngrade,
58
+ import { createCharter, signCharter, verifyCharter, createAmendment, signAmendment, verifyAmendment, createApprovalRequest, addApprovalSignature, createHybridTimestamp, compareTimestamps, validateTemporalRights, createReserveAttestation, vouchReputation, applyReputationDowngrade,
59
59
  // v2 boundary primitives (AttributionConsent, ProvisionalStatement, HumanEscalationFlag)
60
60
  createAttributionReceipt, signAttributionConsent, verifyAttributionConsent, checkArtifactCitations, receiptCore, createProvisional, promoteStatement, verifyPromotion, withdrawProvisional, withdrawalPayload, isBinding, checkEscalationRequired, requestOwnerConfirmation, recordOwnerConfirmation,
61
61
  // Attribution Primitive (unified four-axis signed Merkle receipt)
@@ -68,6 +68,7 @@ aggregateAttributionPrimitives, buildContributorQueryResponse, signSettlementRec
68
68
  // Mutual Authentication v1 (SDK v2.2.0)
69
69
  // ═══════════════════════════════════════
70
70
  import { buildCertificate, signCertificate, certificateId, verifyBundle, verifyAttest, deriveSession, } from "agent-passport-system";
71
+ import { toolCount } from "./toolManifest.js";
71
72
  // ═══════════════════════════════════════
72
73
  // Capability Token v0.1 (reference implementation)
73
74
  // Spec: agent-passport-system/docs/CAPABILITY-TOKEN-SPEC-DRAFT.md
@@ -160,6 +161,7 @@ const state = {
160
161
  derivationStore: new Map(),
161
162
  sessionAgent: null,
162
163
  charters: new Map(),
164
+ amendments: new Map(),
163
165
  approvalRequests: new Map(),
164
166
  // Agent Attestation Architecture (Phase 1)
165
167
  issuanceContexts: new Map(),
@@ -368,10 +370,23 @@ function movedToGateway(toolName) {
368
370
  // ═══════════════════════════════════════
369
371
  // Server Setup
370
372
  // ═══════════════════════════════════════
371
- const server = new McpServer({
373
+ // The advertised version is read from the package's own manifest rather than
374
+ // typed here. The literal had drifted: serverInfo said 3.3.0 while the package
375
+ // was already at 5.0.0, and nothing in the build could notice.
376
+ //
377
+ // Resolved from this module's own URL, so it works the same from build/ in an
378
+ // installed package as it does from src/ under tsx. npm always ships
379
+ // package.json, so the file is present in the published tarball.
380
+ const PACKAGE_MANIFEST = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
381
+ // The implementation name is the MCP server identity and stays stable on the
382
+ // wire ("agent-passport-mcp" since 3.3.0). It is deliberately NOT the npm
383
+ // package name; renaming the implementation is a compatibility-visible change
384
+ // and would ship as one. Only the version is derived from the manifest.
385
+ export const SERVER_INFO = {
372
386
  name: "agent-passport-mcp",
373
- version: "3.3.0",
374
- });
387
+ version: PACKAGE_MANIFEST.version,
388
+ };
389
+ const server = new McpServer(SERVER_INFO);
375
390
  // Track server start time for Tier 0 connection timing
376
391
  globalThis.__mcpStartTime = Date.now();
377
392
  // (try/catch wrapper merged into profile filter below)
@@ -397,7 +412,8 @@ const TOOL_PROFILES = {
397
412
  'create_agent_context', 'execute_with_context', 'complete_action',
398
413
  'create_delegation', 'verify_delegation', 'revoke_delegation',
399
414
  'create_charter', 'sign_charter', 'verify_charter',
400
- 'evaluate_threshold', 'create_approval_request', 'add_approval_signature',
415
+ 'propose_amendment', 'sign_amendment', 'verify_amendment',
416
+ 'create_approval_request', 'add_approval_signature',
401
417
  'create_outcome_record', 'add_principal_report',
402
418
  'activate_emergency', 'define_emergency_pathway',
403
419
  'create_artifact_provenance', 'create_policy_context',
@@ -437,7 +453,6 @@ const TOOL_PROFILES = {
437
453
  'gateway_stats', 'create_delegation', 'load_values_floor', 'attest_to_floor',
438
454
  'create_hybrid_timestamp', 'compare_timestamps', 'validate_temporal_rights',
439
455
  'create_reserve_attestation', 'vouch_reputation', 'apply_reputation_downgrade',
440
- 'evaluate_threshold',
441
456
  ]),
442
457
  comms: new Set([
443
458
  'identify', 'generate_keys',
@@ -479,8 +494,26 @@ const profileFilter = TOOL_PROFILES[activeProfile];
479
494
  // which would have silently disabled both profile filtering and the handler
480
495
  // try/catch. The wrapper body is unchanged: registerTool(name, config, cb)
481
496
  // still carries the handler as its last argument.
497
+ // Every tool name that reaches the wrapper, in registration order.
498
+ //
499
+ // This is the single structural source of truth for the tool inventory. The build
500
+ // step writes tools-manifest.json from this array, the boundary test asserts the
501
+ // live registry equals that manifest, and list_profiles and setup read its count.
502
+ // Nothing counts `server.registerTool(` call sites in source text: that is source
503
+ // scraping, and it is the coupling that let a downstream consumer silently report
504
+ // zero once the registration API was renamed.
505
+ //
506
+ // RECORDED BEFORE THE PROFILE FILTER ON PURPOSE. The wrapper below RETURNS EARLY
507
+ // when APS_PROFILE filters a tool out. Pushing after that early return would make
508
+ // the manifest a function of whichever profile happened to be set when the build
509
+ // ran, which is the same defect one layer up. The inventory is a property of the
510
+ // source, not of the environment, so the push happens first and unconditionally.
511
+ // tests/v2-boundary-tools.test.mjs asserts the manifest is identical under
512
+ // APS_PROFILE=full and APS_PROFILE=governance.
513
+ export const REGISTERED_TOOL_NAMES = [];
482
514
  const _origTool = server.registerTool.bind(server);
483
515
  server.registerTool = function (name, ...rest) {
516
+ REGISTERED_TOOL_NAMES.push(name);
484
517
  if (name !== 'list_profiles' && activeProfile !== 'full' && profileFilter && !profileFilter.has(name)) {
485
518
  return; // filtered out by profile
486
519
  }
@@ -586,7 +619,9 @@ const TOOL_SCOPE_MAP = {
586
619
  'create_charter': 'governance',
587
620
  'verify_charter': 'governance',
588
621
  'sign_charter': 'governance',
589
- 'evaluate_threshold': 'governance',
622
+ 'propose_amendment': 'governance',
623
+ 'sign_amendment': 'governance',
624
+ 'verify_amendment': 'governance',
590
625
  'create_approval_request': 'governance',
591
626
  'add_approval_signature': 'governance',
592
627
  'generate_governance_block': 'governance',
@@ -685,7 +720,9 @@ const TOOL_SCOPE_MAP = {
685
720
  server.registerTool("list_profiles", { description: "Show available tool profiles. Set APS_PROFILE env var to limit exposed tools (e.g. APS_PROFILE=data).", inputSchema: z.object({}) }, async () => {
686
721
  const lines = Object.entries(TOOL_PROFILES).map(([name, tools]) => `• ${name} (${tools.size} tools): ${Array.from(tools).slice(0, 6).join(', ')}${tools.size > 6 ? '...' : ''}`);
687
722
  const essentialSize = TOOL_PROFILES.essential.size;
688
- return { content: [{ type: "text", text: `📋 Tool Profiles (set APS_PROFILE env var):\n\nActive: ${activeProfile} (${activeProfile === 'full' ? '150' : profileFilter?.size || '150'} tools)\n\nRecommended: essential (${essentialSize} tools) - identity, delegation, enforcement, commerce, reputation.\n\n${lines.join('\n')}\n\n• full (150 tools): All tools exposed (default)` }] };
723
+ // Generated count, never a literal. See src/toolManifest.ts.
724
+ const total = toolCount(REGISTERED_TOOL_NAMES.length);
725
+ return { content: [{ type: "text", text: `📋 Tool Profiles (set APS_PROFILE env var):\n\nActive: ${activeProfile} (${activeProfile === 'full' ? total : profileFilter?.size || total} tools)\n\nRecommended: essential (${essentialSize} tools) - identity, delegation, enforcement, commerce, reputation.\n\n${lines.join('\n')}\n\n• full (${total} tools): All tools exposed (default)` }] };
689
726
  });
690
727
  // ═══════════════════════════════════════
691
728
  // TOOL: list_tools_for_scope (Primitive #9: Tool Pool Assembly)
@@ -1918,7 +1955,7 @@ server.registerTool("register_agora_agent", { description: "Register an agent in
1918
1955
  agent_name: z.string().describe("Display name"),
1919
1956
  public_key: z.string().describe("Ed25519 public key"),
1920
1957
  }) }, async (args) => {
1921
- registerAgent(state.agoraRegistry, {
1958
+ state.agoraRegistry = registerAgent(state.agoraRegistry, {
1922
1959
  agentId: args.agent_id,
1923
1960
  agentName: args.agent_name,
1924
1961
  publicKey: args.public_key,
@@ -3734,21 +3771,90 @@ server.registerTool("sign_charter", { description: "Add a founding signature to
3734
3771
  state.charters.set(signed.charterId, signed);
3735
3772
  return { content: [{ type: "text", text: `✅ Signature added to ${signed.charterId}\n\nTotal signatures: ${signed.foundingSignatures.length}\nNew signer role: ${args.signer_role}` }] };
3736
3773
  });
3737
- server.registerTool("evaluate_threshold", { description: "Evaluate whether signatures meet a multi-class threshold policy (Consilium Q5).", inputSchema: z.object({
3738
- charter_id: z.string().describe("Charter whose amendment policy to evaluate against"),
3739
- signatures: z.array(z.object({
3740
- publicKey: z.string(),
3741
- keyClass: z.string(),
3742
- signedAt: z.string().default(new Date().toISOString()),
3743
- signature: z.string().default(""),
3744
- })),
3774
+ // ═══════════════════════════════════════
3775
+ // TOOLS: charter amendment lifecycle
3776
+ // ═══════════════════════════════════════
3777
+ //
3778
+ // These three replace the removed `evaluate_threshold`, which counted declared
3779
+ // signers without verifying anything and still printed a threshold verdict.
3780
+ //
3781
+ // Boundary rule for this path: MCP never constructs a signing preimage, never
3782
+ // canonicalizes governance content, and never accepts signed bytes from a caller.
3783
+ // Every cryptographic meaning comes from an SDK call. `amendmentSignContent` stays
3784
+ // private to the SDK; a copy here would be a second preimage on a second release
3785
+ // cadence.
3786
+ //
3787
+ // WHY THESE SCHEMAS TAKE PRIVATE KEYS. The private-key parameters below are
3788
+ // preserved deliberately, not overlooked. The existing MCP signing tools already
3789
+ // use this model, `sign_charter` immediately above among them, and MCP accepts
3790
+ // private keys at roughly 50 call sites. Externalizing signing for these three
3791
+ // while their neighbours keep in-process keys would convert an inconsistency into
3792
+ // a fix. This preserves consistency for this release and does NOT decide the
3793
+ // broader MCP key custody question, which is open as its own decision across the
3794
+ // whole server. Do not read `propose_amendment(private_key)` as settled
3795
+ // architecture.
3796
+ server.registerTool("propose_amendment", { description: "Propose an amendment to a charter. Supplies a full replacement CharterCore, not a patch. The SDK derives the signing preimage and produces the proposer signature. Session state is not an authoritative registry: amendments live only in this process, are lost on restart, and carry no external trust.", inputSchema: z.object({
3797
+ charter_id: z.string().describe("Charter being amended"),
3798
+ proposed_charter: z.record(z.string(), z.any()).describe("Full CharterCore replacement, not a patch"),
3799
+ description: z.string().describe("Human-readable description of the change"),
3800
+ proposer_private_key: z.string(),
3801
+ proposer_public_key: z.string(),
3802
+ effective_at: z.string().optional().describe("ISO 8601, when the amendment takes effect if approved"),
3745
3803
  }) }, async (args) => {
3746
3804
  const charter = state.charters.get(args.charter_id);
3747
3805
  if (!charter)
3748
3806
  return { content: [{ type: "text", text: `❌ Charter ${args.charter_id} not found` }] };
3749
- const result = evaluateThreshold(charter.amendmentPolicy, args.signatures);
3750
- const classLines = result.classStatus.map(c => ` ${c.role}: ${c.collected}/${c.required} ${c.satisfied ? '✅' : '❌'}`).join('\n');
3751
- return { content: [{ type: "text", text: `${result.met ? '✅ THRESHOLD MET' : '❌ THRESHOLD NOT MET'}\n\nClasses:\n${classLines}\n\nTotal: ${result.totalValidSignatures}/${result.totalRequired}${result.errors.length ? '\n\nIssues:\n' + result.errors.join('\n') : ''}` }] };
3807
+ const amendment = createAmendment({
3808
+ charter,
3809
+ proposedCharter: args.proposed_charter,
3810
+ description: args.description,
3811
+ proposerPrivateKey: args.proposer_private_key,
3812
+ proposerPublicKey: args.proposer_public_key,
3813
+ ...(args.effective_at ? { effectiveAt: args.effective_at } : {}),
3814
+ });
3815
+ state.amendments.set(amendment.amendmentId, amendment);
3816
+ return { content: [{ type: "text", text: `✅ Amendment proposed\n\namendment_id: ${amendment.amendmentId}\ncharter_id: ${amendment.charterId}\nfrom_version: ${amendment.fromVersion}\nto_version: ${amendment.toVersion}\nsignatures: ${amendment.signatures.length}\nstatus: ${amendment.status}\n\nNext: sign_amendment to collect signatures, then verify_amendment.` }] };
3817
+ });
3818
+ server.registerTool("sign_amendment", { description: "Add a signature to a proposed amendment. The SDK derives the preimage and signs it; MCP never sees or builds the signed bytes. Session state is not an authoritative registry: amendments live only in this process, are lost on restart, and carry no external trust.", inputSchema: z.object({
3819
+ amendment_id: z.string(),
3820
+ signer_private_key: z.string(),
3821
+ signer_public_key: z.string(),
3822
+ signer_role: z.string().describe("The key class the charter's amendment policy counts this signature against"),
3823
+ }) }, async (args) => {
3824
+ const amendment = state.amendments.get(args.amendment_id);
3825
+ if (!amendment)
3826
+ return { content: [{ type: "text", text: `❌ Amendment ${args.amendment_id} not found` }] };
3827
+ const signed = signAmendment(amendment, args.signer_private_key, args.signer_public_key, args.signer_role);
3828
+ state.amendments.set(signed.amendmentId, signed);
3829
+ const roles = signed.signatures.map(sig => sig.role).join(', ');
3830
+ return { content: [{ type: "text", text: `✅ Signature added to ${signed.amendmentId}\n\nsignatures: ${signed.signatures.length}\nroles collected: ${roles || '(none)'}\nstatus: ${signed.status}\n\nSignature counting and threshold evaluation happen in verify_amendment.` }] };
3831
+ });
3832
+ server.registerTool("verify_amendment", { description: "Verify an amendment against its charter's amendment policy. Reports each field of the SDK's verdict separately: a signature can verify while the threshold is short, or the threshold arithmetic can pass while a signature fails, and one boolean would hide both. Session state is not an authoritative registry: amendments live only in this process, are lost on restart, and carry no external trust.", inputSchema: z.object({
3833
+ charter_id: z.string(),
3834
+ amendment_id: z.string(),
3835
+ }) }, async (args) => {
3836
+ const charter = state.charters.get(args.charter_id);
3837
+ if (!charter)
3838
+ return { content: [{ type: "text", text: `❌ Charter ${args.charter_id} not found` }] };
3839
+ const amendment = state.amendments.get(args.amendment_id);
3840
+ if (!amendment)
3841
+ return { content: [{ type: "text", text: `❌ Amendment ${args.amendment_id} not found` }] };
3842
+ const v = verifyAmendment(amendment, charter);
3843
+ const mark = (b) => b ? '✅' : '❌';
3844
+ // Field order is deliberate: `valid` is rendered LAST and labelled as the
3845
+ // conjunction of the fields above it, never as a headline verdict. A bare
3846
+ // `valid: false` answers nothing on its own; the field that flipped, plus
3847
+ // `errors`, is the answer.
3848
+ const lines = [
3849
+ `charter_exists: ${mark(v.charterExists)} ${v.charterExists}`,
3850
+ `version_match: ${mark(v.versionMatch)} ${v.versionMatch}`,
3851
+ `signatures_valid: ${mark(v.signaturesValid)} ${v.signaturesValid}`,
3852
+ `proposed_charter_valid: ${mark(v.proposedCharterValid)} ${v.proposedCharterValid}`,
3853
+ `threshold_met: ${mark(v.thresholdMet)} ${v.thresholdMet}`,
3854
+ ];
3855
+ const errs = v.errors.length ? `\n\nerrors:\n${v.errors.map(e => ` - ${e}`).join('\n')}` : '\n\nerrors: (none)';
3856
+ const conj = `\n\nvalid: ${v.valid} (the conjunction of the five fields above, not a standalone verdict)`;
3857
+ return { content: [{ type: "text", text: `Amendment ${amendment.amendmentId} against charter ${charter.charterId}\n\n${lines.join('\n')}${errs}${conj}` }] };
3752
3858
  });
3753
3859
  server.registerTool("create_approval_request", { description: "Create a multi-party approval request for charter amendments, office transfers, etc.", inputSchema: z.object({
3754
3860
  policy_id: z.string(),
package/build/setup.js CHANGED
@@ -3,6 +3,7 @@
3
3
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { homedir, platform } from "node:os";
6
+ import { toolCount } from "./toolManifest.js";
6
7
  const LOCAL_CONFIG = {
7
8
  command: "npx",
8
9
  args: ["agent-passport-system-mcp"],
@@ -87,7 +88,7 @@ function setup() {
87
88
  console.log(JSON.stringify({ mcpServers: { "agent-passport": serverConfig } }, null, 2));
88
89
  }
89
90
  else {
90
- console.log(`\n Restart your AI client to activate Agent Passport (150 tools).`);
91
+ console.log(`\n Restart your AI client to activate Agent Passport (${toolCount()} tools).`);
91
92
  console.log(` Then say: "Create an agent identity" or "Delegate authority"\n`);
92
93
  if (!useRemote) {
93
94
  console.log(` Tip: Use --remote for zero-install SSE mode: npx agent-passport-system-mcp setup --remote\n`);
@@ -0,0 +1,14 @@
1
+ export interface ToolManifest {
2
+ generated_by: string;
3
+ count: number;
4
+ tools: string[];
5
+ }
6
+ export declare function readToolManifest(): ToolManifest | null;
7
+ /**
8
+ * The generated tool count.
9
+ *
10
+ * `fallback` should be the caller's live registry length where one is available, so
11
+ * the pre-first-build case degrades to the true runtime number rather than a stale
12
+ * literal. tests/v2-boundary-tools.test.mjs asserts the two are equal.
13
+ */
14
+ export declare function toolCount(fallback?: number): number;
@@ -0,0 +1,38 @@
1
+ // Reader for the generated tool manifest.
2
+ //
3
+ // tools-manifest.json sits at the package root and is GENERATED by
4
+ // scripts/generate-manifest.mjs as part of `npm run build`. It is never hand-edited.
5
+ // Its contents come from src/index.ts's REGISTERED_TOOL_NAMES, which every tool
6
+ // registration passes through, so the manifest and the runtime registry are the same
7
+ // data by construction rather than by anyone remembering to update a literal.
8
+ //
9
+ // Do not replace this with a count of `server.registerTool(` occurrences in source
10
+ // text. That is source scraping: it breaks silently the moment the registration API
11
+ // is renamed, and it reports whatever the grep happens to match rather than what the
12
+ // server actually registered.
13
+ import { readFileSync } from "node:fs";
14
+ /** Resolves from build/*.js to the package root, in the repo and when installed. */
15
+ const MANIFEST_URL = new URL("../tools-manifest.json", import.meta.url);
16
+ export function readToolManifest() {
17
+ try {
18
+ return JSON.parse(readFileSync(MANIFEST_URL, "utf8"));
19
+ }
20
+ catch {
21
+ // Absent only before the first build has generated it. Callers pass a live
22
+ // fallback so a fresh checkout never prints a wrong number.
23
+ return null;
24
+ }
25
+ }
26
+ /**
27
+ * The generated tool count.
28
+ *
29
+ * `fallback` should be the caller's live registry length where one is available, so
30
+ * the pre-first-build case degrades to the true runtime number rather than a stale
31
+ * literal. tests/v2-boundary-tools.test.mjs asserts the two are equal.
32
+ */
33
+ export function toolCount(fallback) {
34
+ const m = readToolManifest();
35
+ if (m && typeof m.count === "number")
36
+ return m.count;
37
+ return fallback ?? 0;
38
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "agent-passport-system-mcp",
3
- "version": "4.0.0",
3
+ "version": "5.0.1",
4
4
  "mcpName": "io.github.aeoess/agent-passport-mcp",
5
- "description": "MCP server for the Agent Passport System - protocol-layer tools only. 150 tools (132 protocol + 10 gateway deprecation stubs). Identity, delegation, reputation, attestation, coordination, commerce, attribution primitive, attribution settlement. Tracks SDK v3.3.0 (Wave 1 accountability primitives + Phase 4.1 payment rails shipped in SDK; MCP rail-tool exposure deferred). For gateway-runtime tools (ProxyGateway, AgentContext, DataEnforcementGate), use gateway.aeoess.com REST API or pin to v3.1.x.",
5
+ "description": "MCP server for the Agent Passport System, protocol-layer tools only. Identity, delegation, reputation, attestation, coordination, commerce, charter amendment lifecycle, attribution. Counts and the SDK version it tracks live in the README.",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "agent-passport-system-mcp": "./build/bin.js",
@@ -11,15 +11,16 @@
11
11
  "files": [
12
12
  "build",
13
13
  "CONTRIBUTING.md",
14
- "CODE_OF_CONDUCT.md"
14
+ "CODE_OF_CONDUCT.md",
15
+ "tools-manifest.json"
15
16
  ],
16
17
  "scripts": {
17
- "build": "npx tsc && chmod 755 build/bin.js build/index.js build/setup.js",
18
+ "build": "npx tsc && chmod 755 build/bin.js build/index.js build/setup.js && node scripts/generate-manifest.mjs",
18
19
  "test": "npm run build && node --test tests/*.test.mjs build/__tests__/*.test.js",
19
20
  "watch": "tsc --watch",
20
21
  "inspector": "npx @modelcontextprotocol/inspector build/index.js",
21
22
  "prepublishOnly": "npm run build && npm test",
22
- "postinstall": "echo '\\n🔑 Agent Passport MCP installed! Run: npx agent-passport-system-mcp setup\\n Or for zero-install remote: npx agent-passport-system-mcp setup --remote\\n'",
23
+ "postinstall": "echo '\\n\ud83d\udd11 Agent Passport MCP installed! Run: npx agent-passport-system-mcp setup\\n Or for zero-install remote: npx agent-passport-system-mcp setup --remote\\n'",
23
24
  "postversion": "if [ -f ~/aps-web/scripts/sync-project-state.mjs ]; then node ~/aps-web/scripts/sync-project-state.mjs mcp $npm_package_version; else echo 'postversion: ~/aps-web/scripts/sync-project-state.mjs not found, skipping project-state sync'; fi"
24
25
  },
25
26
  "keywords": [
@@ -50,7 +51,7 @@
50
51
  "homepage": "https://github.com/aeoess/agent-passport-mcp",
51
52
  "dependencies": {
52
53
  "@modelcontextprotocol/server": "2.0.0",
53
- "agent-passport-system": "^3.3.1",
54
+ "agent-passport-system": "^4.4.0",
54
55
  "zod": "^4.2.0"
55
56
  },
56
57
  "overrides": {
@@ -0,0 +1,158 @@
1
+ {
2
+ "generated_by": "scripts/generate-manifest.mjs from src/index.ts REGISTERED_TOOL_NAMES. Generated file, do not hand-edit.",
3
+ "count": 152,
4
+ "tools": [
5
+ "accept_assignment",
6
+ "activate_emergency",
7
+ "add_approval_signature",
8
+ "add_principal_report",
9
+ "apply_reputation_downgrade",
10
+ "aps_aggregate_settlement",
11
+ "aps_attribution_receipt_id",
12
+ "aps_build_contributor_query",
13
+ "aps_capability_evaluate_authority",
14
+ "aps_capability_issue_challenge",
15
+ "aps_capability_mint_receipt",
16
+ "aps_capability_sign_effect",
17
+ "aps_check_artifact_citations",
18
+ "aps_check_escalation_required",
19
+ "aps_check_projection_consistency",
20
+ "aps_compute_attribution_action_ref",
21
+ "aps_compute_compute_axis_weights",
22
+ "aps_compute_data_axis_weights",
23
+ "aps_construct_attribution_primitive",
24
+ "aps_create_attribution_receipt",
25
+ "aps_create_provisional",
26
+ "aps_project_attribution",
27
+ "aps_promote_statement",
28
+ "aps_record_owner_confirmation",
29
+ "aps_sign_attribution_consent",
30
+ "aps_verify_attribution_consent",
31
+ "aps_verify_attribution_primitive",
32
+ "aps_verify_attribution_projection",
33
+ "aps_verify_promotion",
34
+ "aps_verify_settlement",
35
+ "aps_withdraw_provisional",
36
+ "assign_agent",
37
+ "attest_to_floor",
38
+ "broadcast",
39
+ "check_aggregate_constraints",
40
+ "check_combination_permitted",
41
+ "check_jurisdiction_transfer",
42
+ "check_messages",
43
+ "check_purpose_permitted",
44
+ "check_retention_expired",
45
+ "check_tier",
46
+ "check_usage_permitted",
47
+ "classify_evidence_quality",
48
+ "commerce_preflight",
49
+ "compare_timestamps",
50
+ "complete_action",
51
+ "complete_task",
52
+ "compute_action_ref",
53
+ "compute_governance_taint",
54
+ "create_access_receipt",
55
+ "create_access_snapshot",
56
+ "create_agent_context",
57
+ "create_approval_request",
58
+ "create_artifact_provenance",
59
+ "create_chained_governance_block",
60
+ "create_charter",
61
+ "create_data_enforcement_gate",
62
+ "create_decision_lineage_receipt",
63
+ "create_delegation",
64
+ "create_derivation_receipt",
65
+ "create_disclosure",
66
+ "create_gateway",
67
+ "create_hybrid_timestamp",
68
+ "create_intent",
69
+ "create_outcome_record",
70
+ "create_policy_context",
71
+ "create_principal",
72
+ "create_reserve_attestation",
73
+ "create_task_brief",
74
+ "create_v2_delegation",
75
+ "declare_reidentification_risk",
76
+ "define_emergency_pathway",
77
+ "detect_purpose_drift",
78
+ "endorse_agent",
79
+ "evaluate_intent",
80
+ "evaluate_revocation_impact",
81
+ "execute_with_context",
82
+ "file_data_dispute",
83
+ "gateway_approve",
84
+ "gateway_process_tool_call",
85
+ "gateway_stats",
86
+ "generate_aps_txt",
87
+ "generate_governance_block",
88
+ "generate_keys",
89
+ "generate_settlement",
90
+ "get_agora_by_topic",
91
+ "get_agora_thread",
92
+ "get_agora_topics",
93
+ "get_behavioral_sequence",
94
+ "get_commerce_spend",
95
+ "get_digest",
96
+ "get_evidence",
97
+ "get_fleet_status",
98
+ "get_my_role",
99
+ "get_passport_grade",
100
+ "get_promotion_history",
101
+ "get_task_detail",
102
+ "governance_360",
103
+ "handoff_evidence",
104
+ "identify",
105
+ "is_evidence_fresh",
106
+ "is_key_active",
107
+ "issue_passport",
108
+ "list_agents",
109
+ "list_issuance_records",
110
+ "list_profiles",
111
+ "list_tasks",
112
+ "list_tools_for_scope",
113
+ "load_values_floor",
114
+ "mutualAuthBuildCertificate",
115
+ "mutualAuthDeriveSession",
116
+ "mutualAuthVerifyAttest",
117
+ "mutualAuthVerifyTrustBundle",
118
+ "parse_governance_block_html",
119
+ "post_agora_message",
120
+ "propose_amendment",
121
+ "query_contributions",
122
+ "register_agora_agent",
123
+ "register_agora_public",
124
+ "register_data_source",
125
+ "remove_intent_card",
126
+ "request_human_approval",
127
+ "request_intro",
128
+ "resolve_authority",
129
+ "resolve_lineage",
130
+ "resolve_path_terms",
131
+ "resolve_rights_propagation",
132
+ "respond_to_intro",
133
+ "review_evidence",
134
+ "review_promotion",
135
+ "revoke_delegation",
136
+ "revoke_endorsement",
137
+ "rotate_key",
138
+ "search_matches",
139
+ "send_message",
140
+ "sign_amendment",
141
+ "sign_charter",
142
+ "sub_delegate",
143
+ "submit_deliverable",
144
+ "submit_evidence",
145
+ "supersede_v2_delegation",
146
+ "update_reputation",
147
+ "validate_temporal_rights",
148
+ "verify_amendment",
149
+ "verify_aps_txt",
150
+ "verify_charter",
151
+ "verify_delegation",
152
+ "verify_endorsement",
153
+ "verify_governance_block",
154
+ "verify_issuer",
155
+ "verify_rotation_chain",
156
+ "vouch_reputation"
157
+ ]
158
+ }