agent-passport-system-mcp 2.6.0 → 2.7.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.
Files changed (3) hide show
  1. package/README.md +24 -2
  2. package/build/index.js +239 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  MCP server for the [Agent Passport System](https://github.com/aeoess/agent-passport-system) — cryptographic identity, delegation, governance, and commerce for AI agents.
10
10
 
11
- **55 tools** across all 8 protocol layers. Works with any MCP client: Claude Desktop, Cursor, Windsurf, and more.
11
+ **61 tools** across all 16 protocol modules. Works with any MCP client: Claude Desktop, Cursor, Windsurf, and more.
12
12
 
13
13
  ## Quick Start
14
14
 
@@ -158,6 +158,28 @@ Add to your MCP config:
158
158
  | `update_reputation` | Bayesian (mu, sigma) updates from task results |
159
159
  | `get_promotion_history` | List all promotion reviews this session |
160
160
 
161
+ ### Proxy Gateway — 6 tools
162
+
163
+ | Tool | Description |
164
+ |------|-------------|
165
+ | `gateway_create` | Create a ProxyGateway with enforcement config and tool executor |
166
+ | `gateway_register_agent` | Register agent (passport + attestation + delegations) with gateway |
167
+ | `gateway_process` | Execute tool call through full enforcement pipeline (identity → scope → policy → execute → receipt) |
168
+ | `gateway_approve` | Two-phase: approve request without executing (returns approval token) |
169
+ | `gateway_execute` | Two-phase: execute previously approved request (rechecks revocation) |
170
+ | `gateway_stats` | Get gateway counters (requests, permits, denials, replays, revocation rechecks) |
171
+
172
+ ### Intent Network (Agent-Mediated Matching) — 6 tools
173
+
174
+ | Tool | Description |
175
+ |------|-------------|
176
+ | `publish_intent_card` | Publish what your human needs, offers, and is open to. Signed, scoped, auto-expiring |
177
+ | `search_matches` | Find relevant IntentCards — ranked by need/offer overlap, tags, budget compatibility |
178
+ | `get_digest` | "What matters to me right now?" — matches, pending intros, incoming requests |
179
+ | `request_intro` | Propose connecting two humans based on a match. Both sides must approve |
180
+ | `respond_to_intro` | Approve or decline an introduction request |
181
+ | `remove_intent_card` | Remove your card when needs/offers change |
182
+
161
183
  ## Architecture
162
184
 
163
185
  ```
@@ -173,7 +195,7 @@ Layer 1 — Agent Passport Protocol (Ed25519 identity)
173
195
 
174
196
  ## Links
175
197
 
176
- - npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v1.12.0, 511 tests)
198
+ - npm SDK: [agent-passport-system](https://www.npmjs.com/package/agent-passport-system) (v1.13.0, 534 tests)
177
199
  - Python SDK: [agent-passport-system](https://pypi.org/project/agent-passport-system/) (v0.4.0, 86 tests)
178
200
  - Paper: [doi.org/10.5281/zenodo.18749779](https://doi.org/10.5281/zenodo.18749779)
179
201
  - Docs: [aeoess.com/llms-full.txt](https://aeoess.com/llms-full.txt)
package/build/index.js CHANGED
@@ -33,7 +33,9 @@ commercePreflight, createCommerceDelegation, getSpendSummary, requestHumanApprov
33
33
  // Principal Identity
34
34
  createPrincipalIdentity, endorseAgent, verifyEndorsement, revokeEndorsement, createDisclosure, createFleet, addToFleet, getFleetStatus, revokeFromFleet,
35
35
  // Reputation-Gated Authority (Layer 9)
36
- computeEffectiveScore, createScopedReputation, resolveAuthorityTier, checkTierForIntent, advisoryTierPrecheck, createPromotionReview, updateReputationFromResult, DEFAULT_TIERS, createProxyGateway, } from "agent-passport-system";
36
+ computeEffectiveScore, createScopedReputation, resolveAuthorityTier, checkTierForIntent, advisoryTierPrecheck, createPromotionReview, updateReputationFromResult, DEFAULT_TIERS, createProxyGateway,
37
+ // Intent Network (Agent-Mediated Matching)
38
+ createIntentNetwork, createIntentCard, publishCard, removeCard, searchMatches, requestIntro, respondToIntro, getDigest, } from "agent-passport-system";
37
39
  // ═══════════════════════════════════════
38
40
  // State Management
39
41
  // ═══════════════════════════════════════
@@ -66,6 +68,7 @@ const state = {
66
68
  promotionHistory: [],
67
69
  gateway: null,
68
70
  gatewayKeys: null,
71
+ intentNetwork: createIntentNetwork(),
69
72
  };
70
73
  // Load persisted task state
71
74
  function loadTasks() {
@@ -2324,6 +2327,241 @@ server.tool("gateway_stats", "Get gateway statistics: total requests, permits, d
2324
2327
  };
2325
2328
  });
2326
2329
  // ═══════════════════════════════════════
2330
+ // Intent Network (Agent-Mediated Matching)
2331
+ // ═══════════════════════════════════════
2332
+ server.tool("publish_intent_card", "Publish an IntentCard to the network. Represents what your human needs, offers, and is open to. Cards are signed, scoped, and expire automatically.", {
2333
+ principal_alias: z.string().describe("Human's display name or alias"),
2334
+ needs: z.array(z.object({
2335
+ category: z.string().describe("Category (e.g. 'engineering', 'design', 'funding')"),
2336
+ description: z.string().describe("What is needed"),
2337
+ priority: z.enum(["critical", "high", "medium", "low"]).default("medium"),
2338
+ tags: z.array(z.string()).optional(),
2339
+ budget_amount: z.number().optional(),
2340
+ budget_currency: z.string().optional(),
2341
+ })).optional().describe("What the human needs"),
2342
+ offers: z.array(z.object({
2343
+ category: z.string().describe("Category of what's offered"),
2344
+ description: z.string().describe("What is offered"),
2345
+ priority: z.enum(["critical", "high", "medium", "low"]).default("medium"),
2346
+ tags: z.array(z.string()).optional(),
2347
+ budget_amount: z.number().optional(),
2348
+ budget_currency: z.string().optional(),
2349
+ })).optional().describe("What the human offers"),
2350
+ open_to: z.array(z.string()).optional().describe("Categories open to (e.g. ['introductions', 'partnerships'])"),
2351
+ not_open_to: z.array(z.string()).optional().describe("Categories explicitly not open to"),
2352
+ approval_required: z.array(z.string()).optional().describe("What needs human approval before sharing"),
2353
+ visibility: z.enum(["public", "verified", "minimal"]).default("public"),
2354
+ ttl_hours: z.number().default(24).describe("Hours until card expires"),
2355
+ }, async (args) => {
2356
+ const keyErr = requireKey();
2357
+ if (keyErr)
2358
+ return { content: [{ type: "text", text: keyErr }], isError: true };
2359
+ const mapItem = (item) => ({
2360
+ category: item.category,
2361
+ description: item.description,
2362
+ priority: item.priority || 'medium',
2363
+ tags: item.tags || [],
2364
+ budget: item.budget_amount ? { amount: item.budget_amount, currency: item.budget_currency || 'USD' } : undefined,
2365
+ visibility: 'public',
2366
+ });
2367
+ const card = createIntentCard({
2368
+ agentId: state.agentId || 'anonymous',
2369
+ principalAlias: args.principal_alias,
2370
+ publicKey: state.agentKey,
2371
+ privateKey: state.privateKey,
2372
+ needs: (args.needs || []).map(mapItem),
2373
+ offers: (args.offers || []).map(mapItem),
2374
+ openTo: args.open_to || [],
2375
+ notOpenTo: args.not_open_to || [],
2376
+ approvalRequired: args.approval_required || [],
2377
+ ttlSeconds: (args.ttl_hours || 24) * 3600,
2378
+ });
2379
+ const result = publishCard(state.intentNetwork, card);
2380
+ if (!result.published) {
2381
+ return { content: [{ type: "text", text: `Failed to publish: ${result.error}` }], isError: true };
2382
+ }
2383
+ return {
2384
+ content: [{
2385
+ type: "text",
2386
+ text: JSON.stringify({
2387
+ published: true,
2388
+ cardId: card.cardId,
2389
+ agentId: card.agentId,
2390
+ principalAlias: card.principalAlias,
2391
+ needs: card.needs.length,
2392
+ offers: card.offers.length,
2393
+ expiresAt: card.expiresAt,
2394
+ networkSize: state.intentNetwork.cards.size,
2395
+ note: 'Card published. Other agents can now discover matches. Use search_matches to find relevant cards.',
2396
+ }, null, 2),
2397
+ }],
2398
+ };
2399
+ });
2400
+ server.tool("search_matches", "Search the network for IntentCards relevant to your human. Returns ranked matches based on need/offer overlap, tag similarity, and budget compatibility.", {
2401
+ min_score: z.number().optional().describe("Minimum relevance score 0-1 (default: 0.1)"),
2402
+ max_results: z.number().optional().describe("Maximum results to return (default: 10)"),
2403
+ category_filter: z.string().optional().describe("Only match within this category"),
2404
+ }, async (args) => {
2405
+ const keyErr = requireKey();
2406
+ if (keyErr)
2407
+ return { content: [{ type: "text", text: keyErr }], isError: true };
2408
+ const agentId = state.agentId || 'anonymous';
2409
+ const matches = searchMatches(state.intentNetwork, agentId, {
2410
+ minScore: args.min_score,
2411
+ maxResults: args.max_results,
2412
+ categories: args.category_filter ? [args.category_filter] : undefined,
2413
+ });
2414
+ return {
2415
+ content: [{
2416
+ type: "text",
2417
+ text: JSON.stringify({
2418
+ matchCount: matches.length,
2419
+ matches: matches.map(m => {
2420
+ const isA = m.agentA === agentId;
2421
+ return {
2422
+ matchId: m.matchId,
2423
+ otherAgent: isA ? m.agentB : m.agentA,
2424
+ otherCard: isA ? m.cardB : m.cardA,
2425
+ score: m.score,
2426
+ mutual: m.mutual,
2427
+ needOfferMatches: m.needOfferMatches.map(nom => ({
2428
+ needCategory: nom.need.category,
2429
+ offerCategory: nom.offer.category,
2430
+ matchType: nom.matchType,
2431
+ relevanceScore: nom.relevanceScore,
2432
+ })),
2433
+ explanation: m.explanation,
2434
+ };
2435
+ }),
2436
+ networkSize: state.intentNetwork.cards.size,
2437
+ }, null, 2),
2438
+ }],
2439
+ };
2440
+ });
2441
+ server.tool("get_digest", "Get a personalized digest: relevant matches, pending intro requests, and incoming intros. The killer feature — 'what matters to me right now?'", {}, async () => {
2442
+ const agentId = state.agentId || 'anonymous';
2443
+ const digest = getDigest(state.intentNetwork, agentId);
2444
+ return {
2445
+ content: [{
2446
+ type: "text",
2447
+ text: JSON.stringify({
2448
+ agentId: digest.agentId,
2449
+ generatedAt: digest.generatedAt,
2450
+ summary: digest.summary,
2451
+ matchCount: digest.matches.length,
2452
+ topMatches: digest.matches.slice(0, 5).map((m) => {
2453
+ const isA = m.agentA === agentId;
2454
+ return {
2455
+ otherAgent: isA ? m.agentB : m.agentA,
2456
+ score: m.score,
2457
+ explanation: m.explanation,
2458
+ };
2459
+ }),
2460
+ introsPending: digest.introsPending.length,
2461
+ introsReceived: digest.introsReceived.length,
2462
+ introsReceivedDetail: digest.introsReceived.map((intro) => ({
2463
+ introId: intro.introId,
2464
+ fromAgent: intro.requestedBy,
2465
+ message: intro.message,
2466
+ status: intro.status,
2467
+ })),
2468
+ }, null, 2),
2469
+ }],
2470
+ };
2471
+ });
2472
+ server.tool("request_intro", "Request an introduction to another agent's human based on a match. Both sides must approve before real information crosses.", {
2473
+ match_id: z.string().describe("Match ID from search_matches"),
2474
+ target_card_id: z.string().describe("Card ID of the agent you want an intro to"),
2475
+ message: z.string().describe("Brief message explaining why this intro would be valuable"),
2476
+ disclose_fields: z.array(z.string()).optional().describe("Fields you're willing to share (e.g. ['needs', 'offers', 'openTo'])"),
2477
+ }, async (args) => {
2478
+ const keyErr = requireKey();
2479
+ if (keyErr)
2480
+ return { content: [{ type: "text", text: keyErr }], isError: true };
2481
+ try {
2482
+ const result = requestIntro(state.intentNetwork, {
2483
+ requestedBy: state.agentId || 'anonymous',
2484
+ targetAgentId: args.target_card_id,
2485
+ matchId: args.match_id,
2486
+ message: args.message,
2487
+ fieldsToDisclose: args.disclose_fields || ['needs', 'offers'],
2488
+ privateKey: state.privateKey,
2489
+ });
2490
+ if ('error' in result) {
2491
+ return { content: [{ type: "text", text: `Intro request failed: ${result.error}` }], isError: true };
2492
+ }
2493
+ return {
2494
+ content: [{
2495
+ type: "text",
2496
+ text: JSON.stringify({
2497
+ introId: result.introId,
2498
+ status: result.status,
2499
+ targetAgent: result.targetAgentId,
2500
+ message: result.message,
2501
+ note: 'Intro request sent. The other agent\'s human will see this in their digest and can approve or decline.',
2502
+ }, null, 2),
2503
+ }],
2504
+ };
2505
+ }
2506
+ catch (e) {
2507
+ return { content: [{ type: "text", text: `Intro request failed: ${e.message}` }], isError: true };
2508
+ }
2509
+ });
2510
+ server.tool("respond_to_intro", "Respond to an introduction request. Approve to share your disclosed information, or decline.", {
2511
+ intro_id: z.string().describe("Intro request ID"),
2512
+ approved: z.boolean().describe("Whether to approve the introduction"),
2513
+ message: z.string().optional().describe("Optional response message"),
2514
+ disclose_fields: z.array(z.string()).optional().describe("Fields you're willing to share back"),
2515
+ }, async (args) => {
2516
+ const keyErr = requireKey();
2517
+ if (keyErr)
2518
+ return { content: [{ type: "text", text: keyErr }], isError: true };
2519
+ try {
2520
+ const result = respondToIntro(state.intentNetwork, {
2521
+ introId: args.intro_id,
2522
+ respondedBy: state.agentId || 'anonymous',
2523
+ verdict: args.approved ? 'approve' : 'decline',
2524
+ message: args.message,
2525
+ disclosedFields: args.disclose_fields ? Object.fromEntries(args.disclose_fields.map(f => [f, 'disclosed'])) : undefined,
2526
+ privateKey: state.privateKey,
2527
+ });
2528
+ if ('error' in result) {
2529
+ return { content: [{ type: "text", text: `Intro response failed: ${result.error}` }], isError: true };
2530
+ }
2531
+ return {
2532
+ content: [{
2533
+ type: "text",
2534
+ text: JSON.stringify({
2535
+ introId: result.introId,
2536
+ verdict: result.verdict,
2537
+ approved: args.approved,
2538
+ note: args.approved
2539
+ ? 'Introduction approved. Both parties can now see disclosed information.'
2540
+ : 'Introduction declined.',
2541
+ }, null, 2),
2542
+ }],
2543
+ };
2544
+ }
2545
+ catch (e) {
2546
+ return { content: [{ type: "text", text: `Intro response failed: ${e.message}` }], isError: true };
2547
+ }
2548
+ });
2549
+ server.tool("remove_intent_card", "Remove your IntentCard from the network. Use when your needs or offers have changed.", {
2550
+ card_id: z.string().describe("Card ID to remove"),
2551
+ }, async (args) => {
2552
+ const removed = removeCard(state.intentNetwork, args.card_id);
2553
+ return {
2554
+ content: [{
2555
+ type: "text",
2556
+ text: JSON.stringify({
2557
+ removed,
2558
+ cardId: args.card_id,
2559
+ networkSize: state.intentNetwork.cards.size,
2560
+ }, null, 2),
2561
+ }],
2562
+ };
2563
+ });
2564
+ // ═══════════════════════════════════════
2327
2565
  // MCP Prompts — Role-Specific
2328
2566
  // ═══════════════════════════════════════
2329
2567
  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.6.0",
3
+ "version": "2.7.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",
@@ -47,7 +47,7 @@
47
47
  "homepage": "https://github.com/aeoess/agent-passport-mcp",
48
48
  "dependencies": {
49
49
  "@modelcontextprotocol/sdk": "^1.12.0",
50
- "agent-passport-system": "file:../agent-passport-system/agent-passport-system-1.12.0.tgz",
50
+ "agent-passport-system": "file:../agent-passport-system/agent-passport-system-1.13.0.tgz",
51
51
  "zod": "^3.25.0"
52
52
  },
53
53
  "devDependencies": {