@ktmcp/adyencomccountervice 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 +54 -0
  2. package/index.js +84 -0
  3. package/openapi.json +5623 -0
  4. package/package.json +22 -0
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # Account API MCP Server
2
+
3
+ This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead.
4
+
5
+ The Account API provides endpoints for managing account-related entities on your platform. These related entities include account holders, accounts, bank accounts, shareholders, and verification-related documents. The management operations include actions such as creation, retrieval, updating, and deletion of them.
6
+
7
+ For more information, refer to our [documentation](https://docs.adyen.com/marketplaces-and-platforms/classic).
8
+ ## Authentication
9
+ Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example:
10
+
11
+ ```
12
+ curl
13
+ -H "Content-Type: application/json" \
14
+ -H "X-API-Key: YOUR_API_KEY" \
15
+ ...
16
+ ```
17
+
18
+ Alternatively, you can use the username and password to connect to the API using basic authentication. For example:
19
+
20
+ ```
21
+ curl
22
+ -U "ws@MarketPlace.YOUR_PLATFORM_ACCOUNT":"YOUR_WS_PASSWORD" \
23
+ -H "Content-Type: application/json" \
24
+ ...
25
+ ```
26
+ When going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints).
27
+
28
+ ## Versioning
29
+ The Account 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.
30
+
31
+ For example:
32
+ ```
33
+ https://cal-test.adyen.com/cal/services/Account/v6/createAccountHolder
34
+ ```
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ npm install -g @ktmcp/adyencomccountervice
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ ```bash
45
+ adyencomccountervice
46
+ ```
47
+
48
+ ## API Provider
49
+
50
+ adyen.com:AccountService
51
+
52
+ ## Category
53
+
54
+ 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 AdyencomccounterviceServer {
15
+ constructor() {
16
+ this.server = new Server(
17
+ {
18
+ name: 'adyencomccountervice',
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('Account API MCP server running on stdio');
80
+ }
81
+ }
82
+
83
+ const server = new AdyencomccounterviceServer();
84
+ server.run().catch(console.error);