@ktmcp/adyencomheckoutervice 1.0.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 (4) hide show
  1. package/README.md +58 -0
  2. package/index.js +84 -0
  3. package/openapi.json +19134 -0
  4. package/package.json +22 -0
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # Adyen Checkout API MCP Server
2
+
3
+ Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including 3D Secure), mobile wallets, and local payment methods (for example, iDEAL and Sofort).
4
+
5
+ This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [online payments documentation](https://docs.adyen.com/online-payments).
6
+
7
+ ## Authentication
8
+ Each request to Checkout API must be signed with an API key. For this, [get your API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key) from your Customer Area, and set this key to the `X-API-Key` header value, for example:
9
+
10
+ ```
11
+ curl
12
+ -H "Content-Type: application/json" \
13
+ -H "X-API-Key: YOUR_API_KEY" \
14
+ ...
15
+ ```
16
+ ## Versioning
17
+ Checkout API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: "vXX", where XX is the version number.
18
+
19
+ For example:
20
+ ```
21
+ https://checkout-test.adyen.com/v70/payments
22
+ ```
23
+
24
+ ## Going live
25
+
26
+ To access the live endpoints, you need an API key from your live Customer Area.
27
+
28
+ The live endpoint URLs contain a prefix which is unique to your company account, for example:
29
+ ```
30
+ https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v70/payments
31
+ ```
32
+
33
+ Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**.
34
+
35
+ When preparing to do live transactions with Checkout API, follow the [go-live checklist](https://docs.adyen.com/online-payments/go-live-checklist) to make sure you've got all the required configuration in place.
36
+
37
+ ## Release notes
38
+ Have a look at the [release notes](https://docs.adyen.com/online-payments/release-notes?integration_type=api&version=70) to find out what changed in this version!
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ npm install -g @ktmcp/adyencomheckoutervice
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ ```bash
49
+ adyencomheckoutervice
50
+ ```
51
+
52
+ ## API Provider
53
+
54
+ adyen.com:CheckoutService
55
+
56
+ ## Category
57
+
58
+ payment
package/index.js ADDED
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import OpenAPIClientAxios from 'openapi-client-axios';
5
+ import fs from 'fs';
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+
12
+ const spec = JSON.parse(fs.readFileSync(path.join(__dirname, 'openapi.json'), 'utf8'));
13
+
14
+ class AdyencomheckouterviceServer {
15
+ constructor() {
16
+ this.server = new Server(
17
+ {
18
+ name: 'adyencomheckoutervice',
19
+ version: '1.0.0',
20
+ },
21
+ {
22
+ capabilities: {
23
+ tools: {},
24
+ },
25
+ }
26
+ );
27
+
28
+ this.setupHandlers();
29
+ this.server.onerror = (error) => console.error('[MCP Error]', error);
30
+ process.on('SIGINT', async () => {
31
+ await this.server.close();
32
+ process.exit(0);
33
+ });
34
+ }
35
+
36
+ setupHandlers() {
37
+ this.server.setRequestHandler('tools/list', async () => {
38
+ const api = new OpenAPIClientAxios({ definition: spec });
39
+ await api.init();
40
+
41
+ const operations = api.getOperations();
42
+ return {
43
+ tools: operations.map(op => ({
44
+ name: op.operationId || op.path,
45
+ description: op.summary || op.description || 'No description',
46
+ inputSchema: {
47
+ type: 'object',
48
+ properties: op.parameters?.reduce((acc, param) => {
49
+ acc[param.name] = {
50
+ type: param.schema?.type || 'string',
51
+ description: param.description || ''
52
+ };
53
+ return acc;
54
+ }, {}) || {}
55
+ }
56
+ }))
57
+ };
58
+ });
59
+
60
+ this.server.setRequestHandler('tools/call', async (request) => {
61
+ const api = new OpenAPIClientAxios({ definition: spec });
62
+ const client = await api.init();
63
+
64
+ const result = await client.request(request.params.name, request.params.arguments);
65
+ return {
66
+ content: [
67
+ {
68
+ type: 'text',
69
+ text: JSON.stringify(result.data, null, 2)
70
+ }
71
+ ]
72
+ };
73
+ });
74
+ }
75
+
76
+ async run() {
77
+ const transport = new StdioServerTransport();
78
+ await this.server.connect(transport);
79
+ console.error('Adyen Checkout API MCP server running on stdio');
80
+ }
81
+ }
82
+
83
+ const server = new AdyencomheckouterviceServer();
84
+ server.run().catch(console.error);