@attesso/mcp 1.2.0 → 1.3.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/dist/src/schemas.d.ts +18 -42
- package/dist/src/schemas.d.ts.map +1 -1
- package/dist/src/schemas.js +10 -19
- package/dist/src/schemas.js.map +1 -1
- package/dist/src/server.d.ts +2 -2
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +10 -33
- package/dist/src/server.js.map +1 -1
- package/dist/src/tools.d.ts +4 -7
- package/dist/src/tools.d.ts.map +1 -1
- package/dist/src/tools.js +23 -52
- package/dist/src/tools.js.map +1 -1
- package/package.json +5 -6
package/dist/src/schemas.d.ts
CHANGED
|
@@ -11,54 +11,33 @@ export declare const schemas: {
|
|
|
11
11
|
}, {
|
|
12
12
|
mandateId: string;
|
|
13
13
|
}>;
|
|
14
|
-
|
|
14
|
+
issueCard: z.ZodObject<{
|
|
15
15
|
mandateId: z.ZodString;
|
|
16
16
|
amount: z.ZodNumber;
|
|
17
|
-
|
|
17
|
+
ttlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
allowedMccs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
+
blockedMccs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
20
|
}, "strip", z.ZodTypeAny, {
|
|
19
21
|
mandateId: string;
|
|
20
22
|
amount: number;
|
|
21
|
-
|
|
23
|
+
ttlSeconds?: number | undefined;
|
|
24
|
+
allowedMccs?: string[] | undefined;
|
|
25
|
+
blockedMccs?: string[] | undefined;
|
|
22
26
|
}, {
|
|
23
27
|
mandateId: string;
|
|
24
28
|
amount: number;
|
|
25
|
-
|
|
29
|
+
ttlSeconds?: number | undefined;
|
|
30
|
+
allowedMccs?: string[] | undefined;
|
|
31
|
+
blockedMccs?: string[] | undefined;
|
|
26
32
|
}>;
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
getCard: z.ZodObject<{
|
|
34
|
+
cardId: z.ZodString;
|
|
29
35
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
|
|
36
|
+
cardId: string;
|
|
31
37
|
}, {
|
|
32
|
-
|
|
38
|
+
cardId: string;
|
|
33
39
|
}>;
|
|
34
|
-
|
|
35
|
-
mandateId: z.ZodString;
|
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
|
37
|
-
mandateId: string;
|
|
38
|
-
}, {
|
|
39
|
-
mandateId: string;
|
|
40
|
-
}>;
|
|
41
|
-
capture: z.ZodObject<{
|
|
42
|
-
paymentId: z.ZodString;
|
|
43
|
-
amount: z.ZodNumber;
|
|
44
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
amount: number;
|
|
47
|
-
paymentId: string;
|
|
48
|
-
metadata?: Record<string, string> | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
amount: number;
|
|
51
|
-
paymentId: string;
|
|
52
|
-
metadata?: Record<string, string> | undefined;
|
|
53
|
-
}>;
|
|
54
|
-
cancel: z.ZodObject<{
|
|
55
|
-
paymentId: z.ZodString;
|
|
56
|
-
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
paymentId: string;
|
|
58
|
-
}, {
|
|
59
|
-
paymentId: string;
|
|
60
|
-
}>;
|
|
61
|
-
checkBalance: z.ZodObject<{
|
|
40
|
+
revokeMandate: z.ZodObject<{
|
|
62
41
|
mandateId: z.ZodString;
|
|
63
42
|
}, "strip", z.ZodTypeAny, {
|
|
64
43
|
mandateId: string;
|
|
@@ -67,10 +46,7 @@ export declare const schemas: {
|
|
|
67
46
|
}>;
|
|
68
47
|
};
|
|
69
48
|
export type GetMandateInput = z.infer<typeof schemas.getMandate>;
|
|
70
|
-
export type
|
|
71
|
-
export type
|
|
72
|
-
export type
|
|
73
|
-
export type CaptureInput = z.infer<typeof schemas.capture>;
|
|
74
|
-
export type CancelInput = z.infer<typeof schemas.cancel>;
|
|
75
|
-
export type CheckBalanceInput = z.infer<typeof schemas.checkBalance>;
|
|
49
|
+
export type IssueCardInput = z.infer<typeof schemas.issueCard>;
|
|
50
|
+
export type GetCardInput = z.infer<typeof schemas.getCard>;
|
|
51
|
+
export type RevokeMandateInput = z.infer<typeof schemas.revokeMandate>;
|
|
76
52
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;AACjE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC"}
|
package/dist/src/schemas.js
CHANGED
|
@@ -7,27 +7,18 @@ export const schemas = {
|
|
|
7
7
|
getMandate: z.object({
|
|
8
8
|
mandateId: z.string().describe('The unique identifier of the mandate to retrieve'),
|
|
9
9
|
}),
|
|
10
|
-
|
|
11
|
-
mandateId: z.string().describe('The mandate ID
|
|
12
|
-
amount: z.number().positive().describe('Amount
|
|
13
|
-
|
|
10
|
+
issueCard: z.object({
|
|
11
|
+
mandateId: z.string().describe('The mandate ID to issue an ephemeral card from'),
|
|
12
|
+
amount: z.number().positive().describe('Amount in cents the agent wants to spend (e.g., 34700 for $347.00)'),
|
|
13
|
+
ttlSeconds: z.number().int().min(60).max(900).optional().describe('Card time-to-live in seconds (60-900, default 300)'),
|
|
14
|
+
allowedMccs: z.array(z.string()).optional().describe('Restrict card to these merchant category codes'),
|
|
15
|
+
blockedMccs: z.array(z.string()).optional().describe('Block card from these merchant category codes'),
|
|
14
16
|
}),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
getCard: z.object({
|
|
18
|
+
cardId: z.string().describe('The unique identifier of the card to retrieve'),
|
|
17
19
|
}),
|
|
18
|
-
|
|
19
|
-
mandateId: z.string().describe('The mandate ID to
|
|
20
|
-
}),
|
|
21
|
-
capture: z.object({
|
|
22
|
-
paymentId: z.string().describe('The payment ID to capture'),
|
|
23
|
-
amount: z.number().positive().describe('Final amount to capture in cents (must be <= authorized amount)'),
|
|
24
|
-
metadata: z.record(z.string()).optional().describe('Optional metadata to attach to the capture'),
|
|
25
|
-
}),
|
|
26
|
-
cancel: z.object({
|
|
27
|
-
paymentId: z.string().describe('The payment ID to cancel and release funds'),
|
|
28
|
-
}),
|
|
29
|
-
checkBalance: z.object({
|
|
30
|
-
mandateId: z.string().describe('The mandate ID to check remaining balance for'),
|
|
20
|
+
revokeMandate: z.object({
|
|
21
|
+
mandateId: z.string().describe('The mandate ID to revoke'),
|
|
31
22
|
}),
|
|
32
23
|
};
|
|
33
24
|
//# sourceMappingURL=schemas.js.map
|
package/dist/src/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,OAAO,GA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AAa,EAAE,CAAC,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;KAC3D,CAAC;CACH,CAAC"}
|
package/dist/src/server.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ export interface AttessoMCPServerConfig {
|
|
|
23
23
|
*/
|
|
24
24
|
mandateId?: string;
|
|
25
25
|
/**
|
|
26
|
-
* If true, only expose read-only tools (get_mandate,
|
|
27
|
-
* Write operations (
|
|
26
|
+
* If true, only expose read-only tools (get_mandate, get_card).
|
|
27
|
+
* Write operations (issue_card, revoke_mandate) will not be available.
|
|
28
28
|
* @default false
|
|
29
29
|
*/
|
|
30
30
|
readOnlyMode?: boolean;
|
package/dist/src/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAoBnE,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,GAAE,sBAA2B,GAAG,MAAM,CAmIlF"}
|
package/dist/src/server.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
8
8
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
9
9
|
import { AttessoClient, AttessoError } from '@attesso/sdk';
|
|
10
|
-
import { randomUUID } from 'crypto';
|
|
11
10
|
import { getToolByName, getReadOnlyTools, getAllTools, } from './tools.js';
|
|
12
11
|
/**
|
|
13
12
|
* Creates an Attesso MCP server with the specified configuration.
|
|
@@ -150,49 +149,27 @@ async function executeToolCall(client, toolName, input, defaultMandateId) {
|
|
|
150
149
|
}
|
|
151
150
|
return client.getMandate(id);
|
|
152
151
|
}
|
|
153
|
-
case '
|
|
154
|
-
const { mandateId } = input;
|
|
152
|
+
case 'attesso_issue_card': {
|
|
153
|
+
const { mandateId, amount, ttlSeconds, allowedMccs, blockedMccs } = input;
|
|
155
154
|
const id = mandateId ?? defaultMandateId;
|
|
156
155
|
if (!id) {
|
|
157
156
|
throw new AttessoError('MANDATE_NOT_FOUND', 'mandateId is required');
|
|
158
157
|
}
|
|
159
|
-
|
|
160
|
-
return {
|
|
161
|
-
available: mandate.maxAmount,
|
|
162
|
-
currency: mandate.currency,
|
|
163
|
-
status: mandate.status,
|
|
164
|
-
};
|
|
158
|
+
return client.issueCard(id, { amount, ttlSeconds, allowedMccs, blockedMccs });
|
|
165
159
|
}
|
|
166
|
-
case '
|
|
167
|
-
const {
|
|
168
|
-
|
|
160
|
+
case 'attesso_get_card': {
|
|
161
|
+
const { cardId } = input;
|
|
162
|
+
// Use the SDK's request method via a direct API call
|
|
163
|
+
return client.request('GET', `/v1/cards/${cardId}`);
|
|
169
164
|
}
|
|
170
|
-
case '
|
|
165
|
+
case 'attesso_revoke_mandate': {
|
|
171
166
|
const { mandateId } = input;
|
|
172
167
|
const id = mandateId ?? defaultMandateId;
|
|
173
168
|
if (!id) {
|
|
174
169
|
throw new AttessoError('MANDATE_NOT_FOUND', 'mandateId is required');
|
|
175
170
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
case 'attesso_execute_payment': {
|
|
179
|
-
const { mandateId, amount, merchant } = input;
|
|
180
|
-
const id = mandateId ?? defaultMandateId;
|
|
181
|
-
if (!id) {
|
|
182
|
-
throw new AttessoError('MANDATE_NOT_FOUND', 'mandateId is required');
|
|
183
|
-
}
|
|
184
|
-
// Generate idempotency key for safe retries
|
|
185
|
-
const idempotencyKey = `mcp_${randomUUID()}`;
|
|
186
|
-
// Note: idempotency key would be passed as header in production
|
|
187
|
-
return client.executePayment({ mandateId: id, amount, merchant });
|
|
188
|
-
}
|
|
189
|
-
case 'attesso_capture': {
|
|
190
|
-
const { paymentId, amount, metadata } = input;
|
|
191
|
-
return client.capture(paymentId, { amount, metadata });
|
|
192
|
-
}
|
|
193
|
-
case 'attesso_cancel': {
|
|
194
|
-
const { paymentId } = input;
|
|
195
|
-
return client.cancel(paymentId);
|
|
171
|
+
// Use the SDK's request method via a direct API call
|
|
172
|
+
return client.request('DELETE', `/v1/mandates/${id}`);
|
|
196
173
|
}
|
|
197
174
|
default:
|
|
198
175
|
throw new Error(`Unknown tool: ${toolName}`);
|
package/dist/src/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MA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CAAC;AACH,CAAC"}
|
package/dist/src/tools.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Tool Definitions for Attesso
|
|
3
3
|
*
|
|
4
|
-
* Defines the
|
|
4
|
+
* Defines the 4 tools exposed via MCP:
|
|
5
5
|
* - attesso_get_mandate (read)
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* - attesso_execute_payment (write)
|
|
10
|
-
* - attesso_capture (write)
|
|
11
|
-
* - attesso_cancel (write)
|
|
6
|
+
* - attesso_issue_card (write)
|
|
7
|
+
* - attesso_get_card (read)
|
|
8
|
+
* - attesso_revoke_mandate (write)
|
|
12
9
|
*/
|
|
13
10
|
import { z } from 'zod';
|
|
14
11
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
package/dist/src/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,EAAE,cAAc,EA0C3C,CAAC;AAEF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEtE;AAED,wBAAgB,gBAAgB,IAAI,cAAc,EAAE,CAEnD;AAED,wBAAgB,WAAW,IAAI,cAAc,EAAE,CAE9C"}
|
package/dist/src/tools.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Tool Definitions for Attesso
|
|
3
3
|
*
|
|
4
|
-
* Defines the
|
|
4
|
+
* Defines the 4 tools exposed via MCP:
|
|
5
5
|
* - attesso_get_mandate (read)
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* - attesso_execute_payment (write)
|
|
10
|
-
* - attesso_capture (write)
|
|
11
|
-
* - attesso_cancel (write)
|
|
6
|
+
* - attesso_issue_card (write)
|
|
7
|
+
* - attesso_get_card (read)
|
|
8
|
+
* - attesso_revoke_mandate (write)
|
|
12
9
|
*/
|
|
13
10
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
14
11
|
import { schemas } from './schemas.js';
|
|
@@ -16,64 +13,38 @@ export const toolDefinitions = [
|
|
|
16
13
|
// Read operations
|
|
17
14
|
{
|
|
18
15
|
name: 'attesso_get_mandate',
|
|
19
|
-
description: 'Get details about a spending mandate including the
|
|
20
|
-
'Use this to check how much money is available before
|
|
16
|
+
description: 'Get details about a spending mandate including the spending limit, status, and restrictions. ' +
|
|
17
|
+
'Use this to check how much money is available before issuing a card.',
|
|
21
18
|
inputSchema: zodToJsonSchema(schemas.getMandate, 'GetMandateInput'),
|
|
22
19
|
zodSchema: schemas.getMandate,
|
|
23
20
|
isWriteOperation: false,
|
|
24
21
|
},
|
|
25
22
|
{
|
|
26
|
-
name: '
|
|
27
|
-
description: '
|
|
28
|
-
'
|
|
29
|
-
inputSchema: zodToJsonSchema(schemas.
|
|
30
|
-
zodSchema: schemas.
|
|
31
|
-
isWriteOperation: false,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'attesso_get_payment',
|
|
35
|
-
description: 'Get the status and details of a specific payment. ' +
|
|
36
|
-
'Use this to verify a payment was successful or check its current status.',
|
|
37
|
-
inputSchema: zodToJsonSchema(schemas.getPayment, 'GetPaymentInput'),
|
|
38
|
-
zodSchema: schemas.getPayment,
|
|
39
|
-
isWriteOperation: false,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'attesso_get_passport',
|
|
43
|
-
description: 'Get a passport token that proves authorized spending power to merchants. ' +
|
|
44
|
-
'Some merchants require this for fast-lane checkout without additional verification. ' +
|
|
45
|
-
'The passport includes solvency proof and risk attestation data.',
|
|
46
|
-
inputSchema: zodToJsonSchema(schemas.getPassport, 'GetPassportInput'),
|
|
47
|
-
zodSchema: schemas.getPassport,
|
|
23
|
+
name: 'attesso_get_card',
|
|
24
|
+
description: 'Get the status and details of an issued ephemeral card. ' +
|
|
25
|
+
'Use this to check if a card is still active or has been used.',
|
|
26
|
+
inputSchema: zodToJsonSchema(schemas.getCard, 'GetCardInput'),
|
|
27
|
+
zodSchema: schemas.getCard,
|
|
48
28
|
isWriteOperation: false,
|
|
49
29
|
},
|
|
50
30
|
// Write operations
|
|
51
31
|
{
|
|
52
|
-
name: '
|
|
53
|
-
description:
|
|
32
|
+
name: 'attesso_issue_card',
|
|
33
|
+
description: 'Issue an ephemeral virtual card from a standing mandate. ' +
|
|
34
|
+
'This auth-holds the user\'s payment method and creates a card with a TTL. ' +
|
|
35
|
+
'The card auto-destructs after use or when the TTL expires. ' +
|
|
54
36
|
'Amount must be in cents (e.g., 34700 for $347.00). ' +
|
|
55
|
-
'Only call this
|
|
56
|
-
inputSchema: zodToJsonSchema(schemas.
|
|
57
|
-
zodSchema: schemas.
|
|
58
|
-
isWriteOperation: true,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'attesso_capture',
|
|
62
|
-
description: 'Capture a previously authorized payment with the final amount. ' +
|
|
63
|
-
'Use this when the exact price is known (e.g., after finding the best flight). ' +
|
|
64
|
-
'The capture amount must be less than or equal to the authorized amount. ' +
|
|
65
|
-
'Any excess funds are automatically released.',
|
|
66
|
-
inputSchema: zodToJsonSchema(schemas.capture, 'CaptureInput'),
|
|
67
|
-
zodSchema: schemas.capture,
|
|
37
|
+
'Only call this when you are ready to make a purchase.',
|
|
38
|
+
inputSchema: zodToJsonSchema(schemas.issueCard, 'IssueCardInput'),
|
|
39
|
+
zodSchema: schemas.issueCard,
|
|
68
40
|
isWriteOperation: true,
|
|
69
41
|
},
|
|
70
42
|
{
|
|
71
|
-
name: '
|
|
72
|
-
description: '
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
zodSchema: schemas.cancel,
|
|
43
|
+
name: 'attesso_revoke_mandate',
|
|
44
|
+
description: 'Revoke a mandate so it can no longer be used to issue cards. ' +
|
|
45
|
+
'Use this when the mandate is no longer needed.',
|
|
46
|
+
inputSchema: zodToJsonSchema(schemas.revokeMandate, 'RevokeMandateInput'),
|
|
47
|
+
zodSchema: schemas.revokeMandate,
|
|
77
48
|
isWriteOperation: true,
|
|
78
49
|
},
|
|
79
50
|
];
|
package/dist/src/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAUvC,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,kBAAkB;IAClB;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,+FAA+F;YAC/F,sEAAsE;QACxE,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,iBAAiB,CAAC;QACnE,SAAS,EAAE,OAAO,CAAC,UAAU;QAC7B,gBAAgB,EAAE,KAAK;KACxB;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,0DAA0D;YAC1D,+DAA+D;QACjE,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC;QAC7D,SAAS,EAAE,OAAO,CAAC,OAAO;QAC1B,gBAAgB,EAAE,KAAK;KACxB;IACD,mBAAmB;IACnB;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,2DAA2D;YAC3D,4EAA4E;YAC5E,6DAA6D;YAC7D,qDAAqD;YACrD,uDAAuD;QACzD,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,SAAS,EAAE,gBAAgB,CAAC;QACjE,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,gBAAgB,EAAE,IAAI;KACvB;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EACT,+DAA+D;YAC/D,gDAAgD;QAClD,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,aAAa,EAAE,oBAAoB,CAAC;QACzE,SAAS,EAAE,OAAO,CAAC,aAAa;QAChC,gBAAgB,EAAE,IAAI;KACvB;CACF,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attesso/mcp",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Model Context Protocol server for Attesso
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Model Context Protocol server for Attesso — lets MCP-compliant AI agents create mandates and issue virtual cards.",
|
|
5
5
|
"author": "Attesso",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -42,10 +42,9 @@
|
|
|
42
42
|
"mcp",
|
|
43
43
|
"model-context-protocol",
|
|
44
44
|
"ai-agents",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"hardware-attestation",
|
|
45
|
+
"mandates",
|
|
46
|
+
"virtual-cards",
|
|
47
|
+
"payments",
|
|
49
48
|
"claude",
|
|
50
49
|
"llm"
|
|
51
50
|
],
|