agent-passport-system-mcp 2.12.3 → 2.15.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 CHANGED
@@ -10,7 +10,7 @@ MCP server for the [Agent Passport System](https://github.com/aeoess/agent-passp
10
10
 
11
11
  > **🤖 For AI agents:** If you are an agent reading this, 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. This README is designed for humans.
12
12
 
13
- **83 tools** across 42 core modules + 32 v2 constitutional governance modules (separation of powers, circuit breakers, approval fatigue detection, and more). Works with any MCP client: Claude Desktop, Cursor, Windsurf, and more.
13
+ **108 tools** across 42 core modules + 32 v2 constitutional governance modules (separation of powers, circuit breakers, approval fatigue detection, and more). Works with any MCP client: Claude Desktop, Cursor, Windsurf, and more.
14
14
 
15
15
  ## Quick Start
16
16
 
@@ -29,7 +29,7 @@ npm install -g agent-passport-system-mcp
29
29
  npx agent-passport-system-mcp setup
30
30
  ```
31
31
 
32
- Auto-configures Claude Desktop and Cursor. Restart your AI client. 83 tools ready.
32
+ Auto-configures Claude Desktop and Cursor. Restart your AI client. 108 tools ready.
33
33
 
34
34
  <details>
35
35
  <summary>Manual config (if setup doesn't detect your client)</summary>
@@ -206,7 +206,7 @@ Layer 1 — Agent Passport Protocol (Ed25959 identity)
206
206
 
207
207
  ## Links
208
208
 
209
- - npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v1.21.7, 1358 tests)
209
+ - npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v1.24.0, 1445 tests)
210
210
  - Python SDK: [agent-passport-system](https://pypi.org/project/agent-passport-system/) (v0.5.1)
211
211
  - Paper: [doi.org/10.5281/zenodo.18749779](https://doi.org/10.5281/zenodo.18749779)
212
212
  - Docs: [aeoess.com/llms-full.txt](https://aeoess.com/llms-full.txt)
package/build/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ // Copyright 2024-2026 Tymofii Pidlisnyi. Apache-2.0 license. See LICENSE.
2
3
  // ══════════════════════════════════════════════════════════════
3
4
  // Agent Passport MCP Server v2.0
4
5
  // ══════════════════════════════════════════════════════════════
@@ -53,7 +54,7 @@ createV2Attestation, assessV2AttestationQuality, } from "agent-passport-system";
53
54
  // Data Governance (Modules 36A, 38, 39 + Enforcement Gate + Training Attribution)
54
55
  import { registerSelfAttestedSource, createContributionLedger, queryContributions, getSourceMetrics, getAgentDataFootprint, generateSettlement, verifySettlement, generateDataComplianceReport, DataEnforcementGate, createTrainingAttribution, verifyTrainingAttribution, createTrainingLedger, recordTrainingAttribution, getModelDataSources, } from "agent-passport-system";
55
56
  // Data Lifecycle Governance (Modules 43+)
56
- import { createDerivationReceipt, resolveExtendedLineage, evaluateRevocationImpact, createDecisionLineageReceipt, isPurposePermitted, purposeCategory, isRetentionExpired, checkAggregateConstraints, isTransferPermitted, computeGovernanceTaint, fileDispute, checkCombinationPermitted, createAccessSnapshot, resolveRightsPropagation, DEFAULT_RIGHTS_PROPAGATION, detectPurposeDrift, declareReidentificationRisk, } from "agent-passport-system";
57
+ 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
58
  // ═══════════════════════════════════════
58
59
  // State Management
59
60
  // ═══════════════════════════════════════
@@ -3494,6 +3495,150 @@ server.tool("declare_reidentification_risk", "Declare re-identification risk for
3494
3495
  return { content: [{ type: "text", text: `🔒 Re-identification Risk Declaration\n\nRisk: ${decl.risk}\nMethod: ${decl.assessmentMethod || 'N/A'}\nMitigations: ${decl.mitigationsApplied?.join(', ') || 'none'}\nAssessed by: ${decl.assessedBy}\nAt: ${decl.assessedAt}` }] };
3495
3496
  });
3496
3497
  // ═══════════════════════════════════════
3498
+ // Governance Block (HTML-embedded governance)
3499
+ // ═══════════════════════════════════════
3500
+ server.tool("generate_governance_block", "Generate a cryptographically signed governance block for embedding in HTML pages. Includes terms, revocation policy, and content hash.", {
3501
+ content: z.string().describe("Article/page content to hash and govern"),
3502
+ publicKey: z.string().describe("Publisher's Ed25519 public key (hex)"),
3503
+ privateKey: z.string().describe("Publisher's Ed25519 private key (hex)"),
3504
+ inference: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3505
+ training: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3506
+ redistribution: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3507
+ derivative: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3508
+ caching: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3509
+ license_url: z.string().optional(),
3510
+ terms_version: z.string().optional(),
3511
+ }, async (p) => {
3512
+ const { block, html, meta } = embedGovernance({
3513
+ content: p.content,
3514
+ publicKey: p.publicKey,
3515
+ privateKey: p.privateKey,
3516
+ terms: {
3517
+ inference: p.inference, training: p.training,
3518
+ redistribution: p.redistribution, derivative: p.derivative,
3519
+ caching: p.caching, license_url: p.license_url, version: p.terms_version,
3520
+ },
3521
+ });
3522
+ return { content: [{ type: "text", text: `📋 Governance Block Generated\n\nDID: ${block.source_did}\nContent Hash: ${block.content_hash}\nTerms: inference=${p.inference || 'not set'}, training=${p.training || 'not set'}\n\n--- HTML EMBED (script tag) ---\n${html}\n\n--- META EMBED (base64) ---\n${meta}` }] };
3523
+ });
3524
+ server.tool("verify_governance_block", "Verify a governance block's signature, content hash, and DID consistency against the original content.", {
3525
+ block: z.string().describe("Governance block JSON string"),
3526
+ content: z.string().describe("Original content to verify against"),
3527
+ publicKey: z.string().describe("Publisher's Ed25519 public key (hex)"),
3528
+ }, async (p) => {
3529
+ const parsed = JSON.parse(p.block);
3530
+ const result = verifyGovernanceBlock(parsed, p.content, p.publicKey);
3531
+ return { content: [{ type: "text", text: `🔍 Governance Block Verification\n\nValid: ${result.valid ? '✅' : '❌'}\nSignature: ${result.signatureValid ? '✅' : '❌'}\nContent Hash: ${result.contentHashValid ? '✅' : '❌'}\nDID Consistent: ${result.didConsistent ? '✅' : '❌'}${result.errors.length > 0 ? '\n\nErrors:\n' + result.errors.join('\n') : ''}` }] };
3532
+ });
3533
+ server.tool("parse_governance_block_html", "Extract a governance block from an HTML page. Looks for APS governance script tags or meta tags.", {
3534
+ html: z.string().describe("HTML content to parse"),
3535
+ }, async (p) => {
3536
+ const block = parseGovernanceBlockFromHTML(p.html);
3537
+ if (!block) {
3538
+ return { content: [{ type: "text", text: "No governance block found in HTML." }] };
3539
+ }
3540
+ return { content: [{ type: "text", text: `📋 Governance Block Found\n\nDID: ${block.source_did}\nContent Hash: ${block.content_hash}\nPublished: ${block.published_at}\nTerms: ${JSON.stringify(block.terms, null, 2)}\nRevocation Policy: ${JSON.stringify(block.revocation_policy, null, 2)}` }] };
3541
+ });
3542
+ server.tool("check_usage_permitted", "Check if a specific usage type is permitted under a governance block's terms.", {
3543
+ block: z.string().describe("Governance block JSON string"),
3544
+ usage: z.enum(["inference", "training", "redistribution", "derivative", "caching"]),
3545
+ }, async (p) => {
3546
+ const parsed = JSON.parse(p.block);
3547
+ const result = isUsagePermitted(parsed, p.usage);
3548
+ return { content: [{ type: "text", text: `${result.permitted ? '✅' : '❌'} Usage "${p.usage}": ${result.condition}` }] };
3549
+ });
3550
+ // ═══════════════════════════════════════
3551
+ // aps.txt + HTTP Headers + Chained Blocks
3552
+ // ═══════════════════════════════════════
3553
+ server.tool("generate_aps_txt", "Generate a signed aps.txt file for site-wide governance. Like robots.txt but cryptographically signed with terms, revocation endpoint, and MCP upgrade path.", {
3554
+ domain: z.string().describe("Domain this declaration covers (e.g. theagenttimes.com)"),
3555
+ publisherName: z.string().describe("Human-readable publisher name"),
3556
+ publicKey: z.string().describe("Publisher's Ed25519 public key (hex)"),
3557
+ privateKey: z.string().describe("Publisher's Ed25519 private key (hex)"),
3558
+ inference: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3559
+ training: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3560
+ redistribution: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3561
+ mcpEndpoint: z.string().optional(),
3562
+ revocationEndpoint: z.string().optional(),
3563
+ }, async (p) => {
3564
+ const doc = generateApsTxt({
3565
+ domain: p.domain, publisherName: p.publisherName,
3566
+ publicKey: p.publicKey, privateKey: p.privateKey,
3567
+ defaultTerms: { inference: p.inference, training: p.training, redistribution: p.redistribution },
3568
+ mcpEndpoint: p.mcpEndpoint, revocationEndpoint: p.revocationEndpoint,
3569
+ });
3570
+ const serialized = JSON.stringify(doc, null, 2);
3571
+ return { content: [{ type: "text", text: `📄 aps.txt Generated\n\nDomain: ${doc.domain}\nDID: ${doc.publisher_did}\nMCP: ${doc.mcp_endpoint || 'none'}\n\nServe at: ${p.domain}/.well-known/aps.txt\n\n${serialized}` }] };
3572
+ });
3573
+ server.tool("verify_aps_txt", "Verify a signed aps.txt file — checks signature and DID consistency.", {
3574
+ content: z.string().describe("aps.txt JSON content"),
3575
+ publicKey: z.string().describe("Publisher's Ed25519 public key (hex)"),
3576
+ }, async (p) => {
3577
+ const doc = JSON.parse(p.content);
3578
+ const result = verifyApsTxt(doc, p.publicKey);
3579
+ return { content: [{ type: "text", text: `${result.valid ? '✅' : '❌'} aps.txt Verification: ${result.valid ? 'VALID' : 'INVALID'}${result.errors.length ? '\nErrors: ' + result.errors.join('; ') : ''}` }] };
3580
+ });
3581
+ server.tool("resolve_path_terms", "Resolve governance terms for a specific URL path using aps.txt path overrides.", {
3582
+ apsTxt: z.string().describe("aps.txt JSON content"),
3583
+ path: z.string().describe("URL path to resolve (e.g. /blog/my-article)"),
3584
+ }, async (p) => {
3585
+ const doc = JSON.parse(p.apsTxt);
3586
+ const terms = resolveTermsForPath(doc, p.path);
3587
+ return { content: [{ type: "text", text: `📋 Terms for "${p.path}":\n${JSON.stringify(terms, null, 2)}` }] };
3588
+ });
3589
+ server.tool("create_chained_governance_block", "Create a governance block for derivative content that references the original publisher's block. Preserves the chain of provenance.", {
3590
+ content: z.string().describe("Derivative content"),
3591
+ publicKey: z.string().describe("Derivative agent's Ed25519 public key (hex)"),
3592
+ privateKey: z.string().describe("Derivative agent's Ed25519 private key (hex)"),
3593
+ parentBlock: z.string().describe("Original governance block JSON string"),
3594
+ derivationType: z.string().describe("Type: summary, embedding, rag_chunk, translation, etc."),
3595
+ inference: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3596
+ training: z.enum(["permitted", "prohibited", "compensation_required", "attribution_required"]).optional(),
3597
+ }, async (p) => {
3598
+ const parent = JSON.parse(p.parentBlock);
3599
+ const chained = createChainedGovernanceBlock({
3600
+ content: p.content, publicKey: p.publicKey, privateKey: p.privateKey,
3601
+ terms: { inference: p.inference, training: p.training },
3602
+ parentBlock: parent, derivationType: p.derivationType,
3603
+ });
3604
+ return { content: [{ type: "text", text: `🔗 Chained Block Created\n\nOriginal publisher: ${chained.source_did}\nDerivative agent: ${chained.derivative_agent_did}\nDerivation: ${chained.derivation_type}\nParent hash: ${chained.parent_block_hash}\nContent hash: ${chained.content_hash}` }] };
3605
+ });
3606
+ // ═══════════════════════════════════════
3607
+ // Governance Consumer (agent-side 360 loop)
3608
+ // ═══════════════════════════════════════
3609
+ server.tool("governance_360", "Execute the full governance 360 loop on HTML content: extract governance block → verify signature + content hash → check usage terms → create signed access receipt. This is what an agent calls on every page it reads.", {
3610
+ html: z.string().describe("Full HTML of the page"),
3611
+ contentBody: z.string().describe("Article text content (for hash verification)"),
3612
+ publisherPublicKey: z.string().describe("Publisher's Ed25519 public key (hex)"),
3613
+ agentPublicKey: z.string().describe("Your agent's Ed25519 public key (hex)"),
3614
+ agentPrivateKey: z.string().describe("Your agent's Ed25519 private key (hex)"),
3615
+ intendedUsage: z.enum(["inference", "training", "redistribution", "derivative", "caching"]),
3616
+ sourceUrl: z.string().describe("URL of the page"),
3617
+ }, async (p) => {
3618
+ const result = governanceLoop360({
3619
+ html: p.html, contentBody: p.contentBody,
3620
+ publisherPublicKey: p.publisherPublicKey,
3621
+ agentPublicKey: p.agentPublicKey, agentPrivateKey: p.agentPrivateKey,
3622
+ intendedUsage: p.intendedUsage, sourceUrl: p.sourceUrl,
3623
+ });
3624
+ return { content: [{ type: "text", text: `🔄 Governance 360 Loop\n\n${result.summary}\n\n${result.receipt ? `Receipt ID: ${result.receipt.receiptId}\nAccessed: ${result.receipt.accessed_at}` : 'No receipt (ungoverned content)'}` }] };
3625
+ });
3626
+ server.tool("create_access_receipt", "Create a signed access receipt — cryptographic proof that your agent consumed content under specific terms. The receipt captures terms and revocation policy at access time.", {
3627
+ agentPublicKey: z.string().describe("Your agent's Ed25519 public key (hex)"),
3628
+ agentPrivateKey: z.string().describe("Your agent's Ed25519 private key (hex)"),
3629
+ block: z.string().describe("Governance block JSON string"),
3630
+ sourceUrl: z.string().describe("URL where content was accessed"),
3631
+ intendedUsage: z.string().describe("How you intend to use this content"),
3632
+ }, async (p) => {
3633
+ const parsed = JSON.parse(p.block);
3634
+ const receipt = createAccessReceipt({
3635
+ agentPublicKey: p.agentPublicKey, agentPrivateKey: p.agentPrivateKey,
3636
+ block: parsed, sourceUrl: p.sourceUrl, intendedUsage: p.intendedUsage,
3637
+ governanceVerified: true,
3638
+ });
3639
+ return { content: [{ type: "text", text: `📝 Access Receipt Created\n\nID: ${receipt.receiptId}\nAgent: ${receipt.agent_did}\nPublisher: ${receipt.publisher_did}\nUsage: ${receipt.intended_usage}\nTerms: training=${receipt.terms_at_access.training || 'N/A'}\nRevocation: cached=${receipt.revocation_policy_at_access.cached_copy}` }] };
3640
+ });
3641
+ // ═══════════════════════════════════════
3497
3642
  // MCP Prompts — Role-Specific
3498
3643
  // ═══════════════════════════════════════
3499
3644
  server.prompt("coordination_role", "Get instructions for your assigned coordination role", {}, async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-passport-system-mcp",
3
- "version": "2.12.3",
3
+ "version": "2.15.0",
4
4
  "mcpName": "io.github.aeoess/agent-passport-mcp",
5
5
  "description": "MCP server for Agent Passport System — cryptographic identity, delegation, governance, and deliberation for AI agents",
6
6
  "type": "module",
@@ -49,7 +49,7 @@
49
49
  "homepage": "https://github.com/aeoess/agent-passport-mcp",
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.27.1",
52
- "agent-passport-system": "^1.21.7",
52
+ "agent-passport-system": "^1.24.0",
53
53
  "zod": "^3.25.76"
54
54
  },
55
55
  "devDependencies": {