mcp-aiven 0.1.5

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 (132) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +173 -0
  3. package/dist/client.d.ts +16 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +84 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/config.d.ts +15 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +35 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/errors.d.ts +8 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +42 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/generated/aiven-api.d.ts +49982 -0
  16. package/dist/generated/aiven-api.d.ts.map +1 -0
  17. package/dist/generated/aiven-api.js +6 -0
  18. package/dist/generated/aiven-api.js.map +1 -0
  19. package/dist/index.d.ts +3 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +85 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/manifests/core.yaml +206 -0
  24. package/dist/manifests/integrations.yaml +72 -0
  25. package/dist/manifests/kafka.yaml +143 -0
  26. package/dist/manifests/pg.yaml +43 -0
  27. package/dist/prompts.d.ts +5 -0
  28. package/dist/prompts.d.ts.map +1 -0
  29. package/dist/prompts.js +10 -0
  30. package/dist/prompts.js.map +1 -0
  31. package/dist/security.d.ts +5 -0
  32. package/dist/security.d.ts.map +1 -0
  33. package/dist/security.js +52 -0
  34. package/dist/security.js.map +1 -0
  35. package/dist/shared/service-info.d.ts +5 -0
  36. package/dist/shared/service-info.d.ts.map +1 -0
  37. package/dist/shared/service-info.js +24 -0
  38. package/dist/shared/service-info.js.map +1 -0
  39. package/dist/tool-result-limit.d.ts +7 -0
  40. package/dist/tool-result-limit.d.ts.map +1 -0
  41. package/dist/tool-result-limit.js +44 -0
  42. package/dist/tool-result-limit.js.map +1 -0
  43. package/dist/tools/api-tool.d.ts +4 -0
  44. package/dist/tools/api-tool.d.ts.map +1 -0
  45. package/dist/tools/api-tool.js +80 -0
  46. package/dist/tools/api-tool.js.map +1 -0
  47. package/dist/tools/applications/handlers.d.ts +4 -0
  48. package/dist/tools/applications/handlers.d.ts.map +1 -0
  49. package/dist/tools/applications/handlers.js +345 -0
  50. package/dist/tools/applications/handlers.js.map +1 -0
  51. package/dist/tools/applications/index.d.ts +2 -0
  52. package/dist/tools/applications/index.d.ts.map +1 -0
  53. package/dist/tools/applications/index.js +2 -0
  54. package/dist/tools/applications/index.js.map +1 -0
  55. package/dist/tools/applications/schemas.d.ts +276 -0
  56. package/dist/tools/applications/schemas.d.ts.map +1 -0
  57. package/dist/tools/applications/schemas.js +204 -0
  58. package/dist/tools/applications/schemas.js.map +1 -0
  59. package/dist/tools/json-schema-to-zod.d.ts +4 -0
  60. package/dist/tools/json-schema-to-zod.d.ts.map +1 -0
  61. package/dist/tools/json-schema-to-zod.js +118 -0
  62. package/dist/tools/json-schema-to-zod.js.map +1 -0
  63. package/dist/tools/kafka/descriptions.d.ts +3 -0
  64. package/dist/tools/kafka/descriptions.d.ts.map +1 -0
  65. package/dist/tools/kafka/descriptions.js +43 -0
  66. package/dist/tools/kafka/descriptions.js.map +1 -0
  67. package/dist/tools/kafka/handlers.d.ts +4 -0
  68. package/dist/tools/kafka/handlers.d.ts.map +1 -0
  69. package/dist/tools/kafka/handlers.js +65 -0
  70. package/dist/tools/kafka/handlers.js.map +1 -0
  71. package/dist/tools/kafka/helpers.d.ts +4 -0
  72. package/dist/tools/kafka/helpers.d.ts.map +1 -0
  73. package/dist/tools/kafka/helpers.js +79 -0
  74. package/dist/tools/kafka/helpers.js.map +1 -0
  75. package/dist/tools/kafka/index.d.ts +2 -0
  76. package/dist/tools/kafka/index.d.ts.map +1 -0
  77. package/dist/tools/kafka/index.js +2 -0
  78. package/dist/tools/kafka/index.js.map +1 -0
  79. package/dist/tools/kafka/schemas.d.ts +43 -0
  80. package/dist/tools/kafka/schemas.d.ts.map +1 -0
  81. package/dist/tools/kafka/schemas.js +23 -0
  82. package/dist/tools/kafka/schemas.js.map +1 -0
  83. package/dist/tools/pg/connection.d.ts +5 -0
  84. package/dist/tools/pg/connection.d.ts.map +1 -0
  85. package/dist/tools/pg/connection.js +28 -0
  86. package/dist/tools/pg/connection.js.map +1 -0
  87. package/dist/tools/pg/descriptions.d.ts +4 -0
  88. package/dist/tools/pg/descriptions.d.ts.map +1 -0
  89. package/dist/tools/pg/descriptions.js +66 -0
  90. package/dist/tools/pg/descriptions.js.map +1 -0
  91. package/dist/tools/pg/handlers.d.ts +4 -0
  92. package/dist/tools/pg/handlers.d.ts.map +1 -0
  93. package/dist/tools/pg/handlers.js +91 -0
  94. package/dist/tools/pg/handlers.js.map +1 -0
  95. package/dist/tools/pg/index.d.ts +2 -0
  96. package/dist/tools/pg/index.d.ts.map +1 -0
  97. package/dist/tools/pg/index.js +2 -0
  98. package/dist/tools/pg/index.js.map +1 -0
  99. package/dist/tools/pg/query.d.ts +6 -0
  100. package/dist/tools/pg/query.d.ts.map +1 -0
  101. package/dist/tools/pg/query.js +120 -0
  102. package/dist/tools/pg/query.js.map +1 -0
  103. package/dist/tools/pg/schemas.d.ts +59 -0
  104. package/dist/tools/pg/schemas.d.ts.map +1 -0
  105. package/dist/tools/pg/schemas.js +69 -0
  106. package/dist/tools/pg/schemas.js.map +1 -0
  107. package/dist/tools/pg/validation.d.ts +10 -0
  108. package/dist/tools/pg/validation.d.ts.map +1 -0
  109. package/dist/tools/pg/validation.js +77 -0
  110. package/dist/tools/pg/validation.js.map +1 -0
  111. package/dist/tools/registry.d.ts +4 -0
  112. package/dist/tools/registry.d.ts.map +1 -0
  113. package/dist/tools/registry.js +120 -0
  114. package/dist/tools/registry.js.map +1 -0
  115. package/dist/tools/response-filter.d.ts +3 -0
  116. package/dist/tools/response-filter.d.ts.map +1 -0
  117. package/dist/tools/response-filter.js +19 -0
  118. package/dist/tools/response-filter.js.map +1 -0
  119. package/dist/transport.d.ts +14 -0
  120. package/dist/transport.d.ts.map +1 -0
  121. package/dist/transport.js +111 -0
  122. package/dist/transport.js.map +1 -0
  123. package/dist/types.d.ts +127 -0
  124. package/dist/types.d.ts.map +1 -0
  125. package/dist/types.js +81 -0
  126. package/dist/types.js.map +1 -0
  127. package/generator/schemas/api-schemas.json +2106 -0
  128. package/package.json +78 -0
  129. package/src/manifests/core.yaml +206 -0
  130. package/src/manifests/integrations.yaml +72 -0
  131. package/src/manifests/kafka.yaml +143 -0
  132. package/src/manifests/pg.yaml +43 -0
@@ -0,0 +1,52 @@
1
+ export const REDACTED_PLACEHOLDER = '[REDACTED]';
2
+ export const REDACTED_FIELDS = new Set([
3
+ 'password', 'access_key', 'access_secret', 'secret_key', 'api_key',
4
+ 'token', 'auth_token', 'private_key', 'client_secret',
5
+ 'connection_uri', 'service_uri', 'postgres_uri', 'kafka_uri',
6
+ 'redis_uri', 'opensearch_uri', 'mysql_uri', 'connection_string',
7
+ 'sasl_password', 'keystore_password', 'truststore_password',
8
+ 'ca_cert', 'client_cert', 'client_key', 'ssl_cert', 'ssl_key', 'certificate',
9
+ ]);
10
+ const REDACTED_KEY = /(?:^|\.)(password|token|secret|api_key|access_key|access_secret|secret_key|auth_token|private_key|client_secret|connection_string|sasl_password|keystore_password|truststore_password|.*_uri|.*_url|ca_cert|client_cert|client_key|ssl_cert|ssl_key|certificate|.*_cert|.*_key|.*_ca|.*_certificate|.*_pem)$/i;
11
+ const SENSITIVE_VALUE = /-----BEGIN [A-Z ]*(?:PRIVATE KEY|CERTIFICATE)-----|^[a-z]+:\/\/[^:]+:[^@]+@/i;
12
+ const SCRUB_PATTERNS = [
13
+ {
14
+ pattern: /-----BEGIN [A-Z ]*CERTIFICATE-----[\s\S]*?-----END [A-Z ]*CERTIFICATE-----/g,
15
+ replacement: '[REDACTED_CERTIFICATE]',
16
+ },
17
+ {
18
+ pattern: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,
19
+ replacement: '[REDACTED_KEY]',
20
+ },
21
+ {
22
+ pattern: /[a-z]+:\/\/[^:]+:[^@\s]+@[^\s'"]+/gi,
23
+ replacement: '[REDACTED_URI]',
24
+ },
25
+ ];
26
+ export function scrubSensitiveValues(value) {
27
+ let result = value;
28
+ for (const { pattern, replacement } of SCRUB_PATTERNS) {
29
+ result = result.replace(pattern, replacement);
30
+ }
31
+ return result;
32
+ }
33
+ export function redactSensitiveData(data) {
34
+ if (data == null)
35
+ return data;
36
+ if (typeof data === 'string') {
37
+ return (SENSITIVE_VALUE.test(data) ? REDACTED_PLACEHOLDER : data);
38
+ }
39
+ if (typeof data !== 'object')
40
+ return data;
41
+ const json = JSON.stringify(data, (key, value) => {
42
+ if (!key)
43
+ return value;
44
+ if (REDACTED_KEY.test(key))
45
+ return REDACTED_PLACEHOLDER;
46
+ if (typeof value === 'string' && SENSITIVE_VALUE.test(value))
47
+ return REDACTED_PLACEHOLDER;
48
+ return value;
49
+ });
50
+ return JSON.parse(json);
51
+ }
52
+ //# sourceMappingURL=security.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.js","sourceRoot":"","sources":["../src/security.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IACrC,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS;IAClE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe;IACrD,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW;IAC5D,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB;IAC/D,eAAe,EAAE,mBAAmB,EAAE,qBAAqB;IAC3D,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa;CAC7E,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,+S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IACf,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { AivenClient } from '../client.js';
2
+ import type { RequestOptions, ServiceConnectionInfo } from '../types.js';
3
+ export declare function getProjectCaCert(client: AivenClient, project: string, token?: string): Promise<string>;
4
+ export declare function getServiceConnectionInfo(client: AivenClient, project: string, serviceName: string, opts?: RequestOptions): Promise<ServiceConnectionInfo>;
5
+ //# sourceMappingURL=service-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-info.d.ts","sourceRoot":"","sources":["../../src/shared/service-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAoBzE,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,qBAAqB,CAAC,CAmBhC"}
@@ -0,0 +1,24 @@
1
+ export async function getProjectCaCert(client, project, token) {
2
+ const opts = token ? { token } : undefined;
3
+ const data = await client.get(`/project/${encodeURIComponent(project)}/kms/ca`, opts);
4
+ if (!data.certificate) {
5
+ throw new Error(`Failed to retrieve the CA certificate for project "${project}". ` +
6
+ 'A valid CA certificate is required to securely connect to PostgreSQL. ' +
7
+ 'Refusing to connect without TLS verification.');
8
+ }
9
+ return data.certificate;
10
+ }
11
+ export async function getServiceConnectionInfo(client, project, serviceName, opts) {
12
+ const data = await client.get(`/project/${encodeURIComponent(project)}/service/${encodeURIComponent(serviceName)}`, opts);
13
+ const params = data.service.service_uri_params;
14
+ if (!params) {
15
+ throw new Error(`No connection info available for service ${serviceName}. Ensure the service is running.`);
16
+ }
17
+ const { host, port: portStr, user, password, dbname = 'defaultdb' } = params;
18
+ const port = Number(portStr);
19
+ if (!host || !port || !user || !password) {
20
+ throw new Error(`Incomplete connection details for service ${serviceName}. Ensure the service is running.`);
21
+ }
22
+ return { host, port, user, password, dbname };
23
+ }
24
+ //# sourceMappingURL=service-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-info.js","sourceRoot":"","sources":["../../src/shared/service-info.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAmB,EACnB,OAAe,EACf,KAAc;IAEd,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAC3B,YAAY,kBAAkB,CAAC,OAAO,CAAC,SAAS,EAChD,IAAI,CACL,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,sDAAsD,OAAO,KAAK;YAChE,wEAAwE;YACxE,+CAA+C,CAClD,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,MAAmB,EACnB,OAAe,EACf,WAAmB,EACnB,IAAqB;IAErB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAC3B,YAAY,kBAAkB,CAAC,OAAO,CAAC,YAAY,kBAAkB,CAAC,WAAW,CAAC,EAAE,EACpF,IAAI,CACL,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;IAC/C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,4CAA4C,WAAW,kCAAkC,CAAC,CAAC;IAC7G,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC;IAC7E,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAE7B,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,6CAA6C,WAAW,kCAAkC,CAAC,CAAC;IAC9G,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function getMaxToolResultChars(): number;
2
+ /**
3
+ * If over cap, returns a prefix of `text` plus a trim notice so total length ≤ `limit`.
4
+ * Logs to stderr (safe for stdio MCP: protocol uses stdout). No-op when under cap or uncapped.
5
+ */
6
+ export declare function applyToolResultCharCap(text: string): string;
7
+ //# sourceMappingURL=tool-result-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-result-limit.d.ts","sourceRoot":"","sources":["../src/tool-result-limit.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,IAAI,MAAM,CAO9C;AAWD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoC3D"}
@@ -0,0 +1,44 @@
1
+ const DEFAULT_MAX_CHARS = 100_000;
2
+ export function getMaxToolResultChars() {
3
+ const raw = process.env['MCP_MAX_TOOL_RESULT_CHARS'];
4
+ if (raw === undefined || raw === '')
5
+ return DEFAULT_MAX_CHARS;
6
+ const n = parseInt(raw, 10);
7
+ if (!Number.isFinite(n))
8
+ return DEFAULT_MAX_CHARS;
9
+ if (n <= 0)
10
+ return 0;
11
+ return n;
12
+ }
13
+ function trimSuffix(originalLength, limit) {
14
+ return (`\n\n---\n**Trimmed:** This response was cut because it exceeded the maximum tool output size ` +
15
+ `(${originalLength} characters; cap ${limit} from MCP_MAX_TOOL_RESULT_CHARS). ` +
16
+ `Only the beginning of the payload is included—the rest was omitted. ` +
17
+ `If this was JSON, the tail may be incomplete. Narrow the request or raise the cap if needed.`);
18
+ }
19
+ /**
20
+ * If over cap, returns a prefix of `text` plus a trim notice so total length ≤ `limit`.
21
+ * Logs to stderr (safe for stdio MCP: protocol uses stdout). No-op when under cap or uncapped.
22
+ */
23
+ export function applyToolResultCharCap(text) {
24
+ const limit = getMaxToolResultChars();
25
+ if (limit <= 0 || text.length <= limit)
26
+ return text;
27
+ const suffix = trimSuffix(text.length, limit);
28
+ let headLen = limit - suffix.length;
29
+ if (headLen < 0) {
30
+ const minimal = `\n… [mcp-aiven: trimmed ${String(text.length)}→${String(limit)} chars]`;
31
+ headLen = limit - minimal.length;
32
+ if (headLen <= 0) {
33
+ console.error('mcp-aiven: Tool result trim: cap %d too small for payload of %d chars; returning truncated notice only', limit, text.length);
34
+ return minimal.slice(0, limit);
35
+ }
36
+ const out = text.slice(0, headLen) + minimal;
37
+ console.error('mcp-aiven: Tool result trimmed: %d -> %d chars (MCP_MAX_TOOL_RESULT_CHARS=%d)', text.length, out.length, limit);
38
+ return out;
39
+ }
40
+ const out = text.slice(0, headLen) + suffix;
41
+ console.error('mcp-aiven: Tool result trimmed: %d -> %d chars (MCP_MAX_TOOL_RESULT_CHARS=%d)', text.length, out.length, limit);
42
+ return out;
43
+ }
44
+ //# sourceMappingURL=tool-result-limit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-result-limit.js","sourceRoot":"","sources":["../src/tool-result-limit.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAElC,MAAM,UAAU,qBAAqB;IACnC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAA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QACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;QAC7C,OAAO,CAAC,KAAK,CACX,+EAA+E,EAC/E,IAAI,CAAC,MAAM,EACX,GAAG,CAAC,MAAM,EACV,KAAK,CACN,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAC5C,OAAO,CAAC,KAAK,CACX,+EAA+E,EAC/E,IAAI,CAAC,MAAM,EACX,GAAG,CAAC,MAAM,EACV,KAAK,CACN,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { AivenClient } from '../client.js';
2
+ import type { ToolDefinition, ApiToolConfig } from '../types.js';
3
+ export declare function createApiTool(config: ApiToolConfig, client: AivenClient): ToolDefinition;
4
+ //# sourceMappingURL=api-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-tool.d.ts","sourceRoot":"","sources":["../../src/tools/api-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAA8B,aAAa,EAAkB,MAAM,aAAa,CAAC;AAwE7G,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,cAAc,CAiCxF"}
@@ -0,0 +1,80 @@
1
+ import { toolSuccess, toolError } from '../types.js';
2
+ import { errorMessage } from '../errors.js';
3
+ import { redactSensitiveData } from '../security.js';
4
+ import { applyResponseFilter } from './response-filter.js';
5
+ function extractPathParams(path) {
6
+ return new Set([...path.matchAll(/\{([^}]+)\}/g)]
7
+ .map((m) => m[1])
8
+ .filter((s) => s !== undefined));
9
+ }
10
+ function buildUrl(template, args) {
11
+ return template.replace(/\{([^}]+)\}/g, (_, key) => encodeURIComponent(String(args[key])));
12
+ }
13
+ function collectNonPathParams(args, pathParams) {
14
+ const result = {};
15
+ for (const [k, v] of Object.entries(args)) {
16
+ if (!pathParams.has(k))
17
+ result[k] = v;
18
+ }
19
+ return result;
20
+ }
21
+ function buildQueryOpts(args, pathParams, opts) {
22
+ const query = {};
23
+ for (const [k, v] of Object.entries(args)) {
24
+ if (!pathParams.has(k) && v !== undefined) {
25
+ query[k] = v;
26
+ }
27
+ }
28
+ if (Object.keys(query).length === 0)
29
+ return opts;
30
+ return { ...opts, query };
31
+ }
32
+ async function executeRequest(client, config, args, pathParams, opts) {
33
+ const url = buildUrl(config.path, args);
34
+ if (config.method === 'GET') {
35
+ return client.get(url, buildQueryOpts(args, pathParams, opts));
36
+ }
37
+ if (config.method === 'DELETE') {
38
+ return client.delete(url, opts);
39
+ }
40
+ const body = collectNonPathParams(args, pathParams);
41
+ if (config.defaults) {
42
+ for (const [k, v] of Object.entries(config.defaults)) {
43
+ if (!(k in body))
44
+ body[k] = v;
45
+ }
46
+ }
47
+ return client.request(config.method, url, body, opts);
48
+ }
49
+ export function createApiTool(config, client) {
50
+ const pathParams = extractPathParams(config.path);
51
+ return {
52
+ name: config.name,
53
+ category: config.category,
54
+ definition: {
55
+ title: config.title,
56
+ description: config.description,
57
+ inputSchema: config.inputSchema,
58
+ annotations: config.annotations,
59
+ },
60
+ handler: async (params, context) => {
61
+ try {
62
+ const args = params;
63
+ const opts = {
64
+ token: context?.token,
65
+ mcpClient: context?.mcpClient,
66
+ toolName: config.name,
67
+ };
68
+ const data = await executeRequest(client, config, args, pathParams, opts);
69
+ const filtered = config.responseFilter
70
+ ? applyResponseFilter(data, config.responseFilter)
71
+ : data;
72
+ return toolSuccess(redactSensitiveData(filtered));
73
+ }
74
+ catch (err) {
75
+ return toolError(errorMessage(err));
76
+ }
77
+ },
78
+ };
79
+ }
80
+ //# sourceMappingURL=api-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-tool.js","s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,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { AivenClient } from '../../client.js';
2
+ import type { ToolDefinition } from '../../types.js';
3
+ export declare function createApplicationTools(client: AivenClient): ToolDefinition[];
4
+ //# sourceMappingURL=handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/tools/applications/handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAA8B,MAAM,gBAAgB,CAAC;AAwGjF,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc,EAAE,CAwW5E"}
@@ -0,0 +1,345 @@
1
+ import { ServiceCategory, ApplicationToolName, CREATE_ANNOTATIONS, UPDATE_ANNOTATIONS, READ_ONLY_ANNOTATIONS, toolSuccess, toolError, } from '../../types.js';
2
+ import { errorMessage } from '../../errors.js';
3
+ import { redactSensitiveData } from '../../security.js';
4
+ import { getProjectCaCert } from '../../shared/service-info.js';
5
+ import { deployApplicationInput, redeployApplicationInput, vcsIntegrationListInput, vcsIntegrationRepositoryListInput, } from './schemas.js';
6
+ /** Max repositories returned in one call — stops pagination early (avoids huge payloads). */
7
+ const MAX_VCS_REPOSITORY_LIST_ITEMS = 1000;
8
+ /** Safety cap on HTTP pages if the API keeps returning data. */
9
+ const MAX_VCS_REPOSITORY_LIST_PAGES = 100;
10
+ async function fetchServiceDetails(client, project, serviceName, token) {
11
+ const opts = token ? { token } : undefined;
12
+ const result = await client.get(`/project/${encodeURIComponent(project)}/service/${encodeURIComponent(serviceName)}`, opts);
13
+ return result.service;
14
+ }
15
+ async function fetchAppUrl(client, project, serviceName, token) {
16
+ const service = await fetchServiceDetails(client, project, serviceName, token);
17
+ const component = service.components?.[0];
18
+ if (!component?.path) {
19
+ throw new Error(`No public URL available for application service ${serviceName}. Ensure the service is running.`);
20
+ }
21
+ return component.path;
22
+ }
23
+ /**
24
+ * Maps a service_integrations input item to the API shape for application_service_credential.
25
+ * pg / valkey / opensearch all use a single connection_string_environment_variable_name.
26
+ * kafka exposes all 5 SSL credential env var names so the app code never needs to change.
27
+ */
28
+ function buildServiceIntegration(integration) {
29
+ if (integration.service_type === 'kafka') {
30
+ return {
31
+ integration_type: 'application_service_credential',
32
+ source_service: integration.service_name,
33
+ user_config: {
34
+ service_type: 'kafka',
35
+ bootstrap_servers_environment_variable_name: integration.bootstrap_servers_env,
36
+ security_protocol_environment_variable_name: integration.security_protocol_env,
37
+ access_key_environment_variable_name: integration.access_key_env,
38
+ access_cert_environment_variable_name: integration.access_cert_env,
39
+ ca_cert_environment_variable_name: integration.ca_cert_env,
40
+ },
41
+ };
42
+ }
43
+ // pg, valkey, opensearch share the same user_config shape
44
+ return {
45
+ integration_type: 'application_service_credential',
46
+ source_service: integration.service_name,
47
+ user_config: {
48
+ service_type: integration.service_type,
49
+ connection_string_environment_variable_name: integration.env_key,
50
+ },
51
+ };
52
+ }
53
+ export function createApplicationTools(client) {
54
+ return [
55
+ {
56
+ name: ApplicationToolName.Deploy,
57
+ category: ServiceCategory.Application,
58
+ definition: {
59
+ title: 'Deploy Application to Aiven',
60
+ description: `Deploy a Dockerized application to Aiven. Creates an Aiven app service that pulls, builds, and runs the Docker image.
61
+
62
+ ## Mandatory pre-deploy verification (read-only checks — do NOT create, push, or modify anything)
63
+
64
+ Inspect the local project files and confirm each applicable item. Report findings to the user. Do not call this tool until the user confirms all checks pass.
65
+
66
+ - \`repository_url\` visibility → fetch repository metadata and check the \`private\` field. Do not infer from file access — being able to read files tells you nothing about visibility. If you cannot determine it, ask the user.
67
+ - VCS credentials (private repos only) → if the repo is private, call \`aiven_vcs_integration_list\` (project), then for each integration call \`aiven_vcs_integration_repository_list\` and find the repo whose \`source_url\` matches (strip trailing \`.git\`, lowercase both sides). If matched, use the resolved \`vcs_integration_id\` and \`remote_repository_id\` — do NOT ask the user for these. If no match found, continue remaining checks but do NOT call this tool; after all checks, tell the user: "⚠️ This repository is private but is not connected to Aiven. Please connect your GitHub account via the Aiven Console and grant access to this repo, then try again."
68
+ - \`build_path\` → verify Dockerfile exists, contains \`EXPOSE\` matching \`port\` param, has \`CMD\`/\`ENTRYPOINT\`
69
+ - \`port\` → verify app source binds to \`0.0.0.0\`, not \`localhost\`/\`127.0.0.1\`
70
+ - \`service_integrations\` → for each entry, verify the source service is RUNNING (\`aiven_service_get\`); verify app reads the configured env var names
71
+ - PostgreSQL/Valkey SSL → the deploy tool injects \`PROJECT_CA_CERT\` (base64-encoded Aiven CA cert). App code MUST strip \`sslmode\` from the connection URL (pg v8 ignores the \`ssl\` option when \`sslmode\` is in the URL) and use the CA cert for proper TLS. Required pattern for Node.js pg client:
72
+ \`\`\`js
73
+ const url = new URL(process.env.DATABASE_URL);
74
+ url.searchParams.delete('sslmode');
75
+ const pool = new pg.Pool({
76
+ connectionString: url.toString(),
77
+ ssl: { ca: Buffer.from(process.env.PROJECT_CA_CERT, 'base64').toString() },
78
+ });
79
+ \`\`\`
80
+ Verify this pattern exists in the source before deploying. If missing, add it and push before calling this tool.
81
+ - OpenSearch SSL → Aiven OpenSearch uses a publicly-trusted TLS certificate. No \`PROJECT_CA_CERT\` is injected and none is needed. App code should connect using the \`OPENSEARCH_URL\` directly without any custom CA cert (the default system trust store is sufficient).
82
+ - \`app_service_name\` → verify target app is RUNNING (\`aiven_service_get\`); source reads \`app_env_key\` env var
83
+ - \`repository_url\` → ask the user to provide the repo URL and confirm code is pushed to \`branch\`
84
+ - \`.gitignore\` → verify \`node_modules/\` and \`dist/\` are listed so they are not pushed to the repo
85
+ - Dockerfile → use \`npm install\` (not \`npm ci\`) and only \`COPY package.json\` — lockfiles may not be in the repo
86
+ - \`project_vpc_id\` → normally not needed — the backend auto-selects the VPC when the project has exactly one. Only required if the project has multiple VPCs (the API will return a CONFLICT error asking you to specify); in that case call \`aiven_project_vpc_list\` to list VPCs and ask the user which to use
87
+
88
+ Example Dockerfile for a TypeScript Node.js app:
89
+ \`\`\`dockerfile
90
+ FROM node:22-alpine
91
+ WORKDIR /app
92
+ COPY package.json ./
93
+ RUN npm install
94
+ COPY . .
95
+ RUN npx tsc
96
+ RUN npm prune --production
97
+ EXPOSE 3000
98
+ CMD ["node", "dist/index.js"]
99
+ \`\`\``,
100
+ inputSchema: deployApplicationInput,
101
+ annotations: CREATE_ANNOTATIONS,
102
+ },
103
+ handler: async (params, context) => {
104
+ const { project, service_name: serviceName, repository_url: repositoryUrl, vcs_integration_id: vcsIntegrationId, remote_repository_id: remoteRepositoryId, branch, build_path: buildPath, port, port_name: portName, plan, cloud, environment_variables: envVars, service_integrations: serviceIntegrationsInput, app_service_name: appServiceName, app_env_key: appEnvKey, project_vpc_id: projectVpcId, } = params;
105
+ // Build environment variables list (user-provided only)
106
+ const allEnvVars = [];
107
+ if (envVars && envVars.length > 0) {
108
+ for (const v of envVars) {
109
+ allEnvVars.push({ key: v.key, kind: v.kind, value: v.value });
110
+ }
111
+ }
112
+ // Build service integrations for automatic credential injection
113
+ const serviceIntegrations = serviceIntegrationsInput?.map(buildServiceIntegration) ?? [];
114
+ // Inject PROJECT_CA_CERT when connecting to services that use TLS with Aiven's self-signed CA.
115
+ // Matches App Builder behaviour: fetch from /project/{project}/kms/ca and base64-encode.
116
+ // Kafka credentials are injected as raw PEM files by the platform itself — no CA cert needed here.
117
+ const needsCaCert = serviceIntegrationsInput?.some((i) => i.service_type === 'pg' || i.service_type === 'valkey');
118
+ if (needsCaCert) {
119
+ try {
120
+ const caCert = await getProjectCaCert(client, project, context?.token);
121
+ if (caCert) {
122
+ allEnvVars.push({
123
+ key: 'PROJECT_CA_CERT',
124
+ kind: 'secret',
125
+ value: Buffer.from(caCert).toString('base64'),
126
+ });
127
+ }
128
+ }
129
+ catch (err) {
130
+ return toolError(`Failed to fetch project CA certificate required for TLS with pg/valkey: ${errorMessage(err)}`);
131
+ }
132
+ }
133
+ // Resolve application service URL if requested (app-to-app, not a credential integration)
134
+ if (appServiceName) {
135
+ try {
136
+ const url = await fetchAppUrl(client, project, appServiceName, context?.token);
137
+ allEnvVars.push({ key: appEnvKey, kind: 'variable', value: url });
138
+ }
139
+ catch (err) {
140
+ return toolError(errorMessage(err));
141
+ }
142
+ }
143
+ // Ensure repository URL ends with .git for proper cloning
144
+ const repoUrl = repositoryUrl.endsWith('.git')
145
+ ? repositoryUrl
146
+ : `${repositoryUrl}.git`;
147
+ // Ensure build_path has ./ prefix
148
+ const normalizedBuildPath = buildPath.startsWith('./')
149
+ ? buildPath
150
+ : `./${buildPath}`;
151
+ // Build source config - include VCS integration IDs for private repo access
152
+ const sourceConfig = {
153
+ repository_url: repoUrl,
154
+ branch,
155
+ build_path: normalizedBuildPath,
156
+ };
157
+ // Add VCS integration IDs if provided (required for private repos)
158
+ if (vcsIntegrationId) {
159
+ sourceConfig['vcs_integration_id'] = vcsIntegrationId;
160
+ }
161
+ if (remoteRepositoryId) {
162
+ sourceConfig['remote_repository_id'] = remoteRepositoryId;
163
+ }
164
+ const applicationConfig = {
165
+ source: sourceConfig,
166
+ ports: [{ name: portName, port, protocol: 'HTTP' }],
167
+ environment_variables: allEnvVars,
168
+ };
169
+ const data = {
170
+ service_name: serviceName,
171
+ service_type: 'application',
172
+ plan,
173
+ cloud,
174
+ ...(projectVpcId !== undefined ? { project_vpc_id: projectVpcId } : {}),
175
+ service_integrations: serviceIntegrations.length > 0 ? serviceIntegrations : undefined,
176
+ user_config: {
177
+ application: applicationConfig,
178
+ },
179
+ };
180
+ try {
181
+ const opts = context?.token ? { token: context.token } : undefined;
182
+ const result = await client.post(`/project/${encodeURIComponent(project)}/service`, data, opts);
183
+ const service = result['service'];
184
+ if (service) {
185
+ const summary = {
186
+ service_name: service['service_name'],
187
+ service_type: service['service_type'],
188
+ state: service['state'],
189
+ plan: service['plan'],
190
+ cloud_name: service['cloud_name'],
191
+ };
192
+ return toolSuccess(redactSensitiveData(summary));
193
+ }
194
+ return toolSuccess(redactSensitiveData(result));
195
+ }
196
+ catch (err) {
197
+ return toolError(errorMessage(err));
198
+ }
199
+ },
200
+ },
201
+ {
202
+ name: ApplicationToolName.Redeploy,
203
+ category: ServiceCategory.Application,
204
+ definition: {
205
+ title: 'Redeploy Application',
206
+ description: `Rebuild and redeploy an existing Aiven application service after new code has been pushed to its repository.
207
+
208
+ Use this ONLY when:
209
+ - The application service already exists and was previously deployed successfully with \`aiven_application_deploy\`
210
+ - The user has pushed a code change to the same repository and branch the service was deployed from
211
+ - Everything else stays the same: same repo, same branch, same port, same service configuration
212
+
213
+ Do NOT use this tool:
214
+ - When the Aiven service itself was never created (e.g. \`aiven_application_deploy\` returned an API error and no service exists) — call \`aiven_application_deploy\` again instead.
215
+ - To change service configuration (plan, cloud, env vars, integrations) — use \`aiven_service_update\` or redeploy via \`aiven_application_deploy\` with updated parameters.
216
+
217
+ Runtime errors in the app (500s, crashes, SSL errors) are NOT deploy failures — the service exists and is running. Use this tool to pick up a code fix in those cases.
218
+
219
+ The rebuild pulls the latest commit from the configured branch and rebuilds the Docker image. It does not change any service settings.`,
220
+ inputSchema: redeployApplicationInput,
221
+ annotations: UPDATE_ANNOTATIONS,
222
+ },
223
+ handler: async (params, context) => {
224
+ const { project, service_name: serviceName } = params;
225
+ try {
226
+ const opts = context?.token ? { token: context.token } : undefined;
227
+ // No dedicated redeploy endpoint exists yet. A no-op service update (empty PUT body)
228
+ // triggers Meta Core's Executor to pick up the change and redeploy — same mechanism
229
+ // used by the Aiven Console redeploy button.
230
+ await client.put(`/project/${encodeURIComponent(project)}/service/${encodeURIComponent(serviceName)}`, {}, opts);
231
+ return toolSuccess({
232
+ service_name: serviceName,
233
+ message: 'Redeploy triggered. The service will pull latest code, rebuild, and deploy.',
234
+ });
235
+ }
236
+ catch (err) {
237
+ return toolError(errorMessage(err));
238
+ }
239
+ },
240
+ },
241
+ {
242
+ name: ApplicationToolName.VcsIntegrationList,
243
+ category: ServiceCategory.Application,
244
+ definition: {
245
+ title: 'List VCS Integrations',
246
+ description: `List connected VCS (GitHub) accounts for the organization that owns a project.
247
+
248
+ Use this as the first step when deploying from a repository — run it silently before \`aiven_application_deploy\` to discover available VCS integrations and their IDs. The organization_id is resolved internally from the project name.
249
+
250
+ Returns each integration's \`vcs_integration_id\` (needed for \`aiven_vcs_integration_repository_list\`) and \`vcs_account_name\` (the GitHub org or user name).`,
251
+ inputSchema: vcsIntegrationListInput,
252
+ annotations: READ_ONLY_ANNOTATIONS,
253
+ },
254
+ handler: async (params, context) => {
255
+ const { project } = params;
256
+ const opts = context?.token ? { token: context.token } : undefined;
257
+ let organizationId;
258
+ try {
259
+ const projectResult = await client.get(`/project/${encodeURIComponent(project)}`, opts);
260
+ organizationId = projectResult.project.organization_id;
261
+ if (!organizationId) {
262
+ return toolError(`Project '${project}' has no associated organization.`);
263
+ }
264
+ }
265
+ catch (err) {
266
+ return toolError(`Failed to fetch project '${project}': ${errorMessage(err)}`);
267
+ }
268
+ try {
269
+ const result = await client.get(`/organization/${encodeURIComponent(organizationId)}/application/vcs-integrations`, opts);
270
+ return toolSuccess({
271
+ organization_id: organizationId,
272
+ vcs_integrations: result.vcs_integrations,
273
+ });
274
+ }
275
+ catch (err) {
276
+ return toolError(errorMessage(err));
277
+ }
278
+ },
279
+ },
280
+ {
281
+ name: ApplicationToolName.VcsIntegrationRepositoryList,
282
+ category: ServiceCategory.Application,
283
+ definition: {
284
+ title: 'List VCS Integration Repositories',
285
+ description: `List repositories accessible via a VCS integration (connected GitHub account).
286
+
287
+ Use this after \`aiven_vcs_integration_list\` to find the \`remote_repository_id\` needed for deploying a private repository. Compare each repository's \`source_url\` against the user's repository URL to find the match (normalize: strip trailing \`.git\`, lowercase both sides before comparing).
288
+
289
+ The tool follows pagination until there are no more pages, or until ${MAX_VCS_REPOSITORY_LIST_ITEMS} repositories have been collected (whichever comes first). If truncated, \`truncated\` is true and \`next\` may still be set when more pages exist.
290
+
291
+ Returns \`remote_repository_id\`, \`full_name\`, \`source_url\`, and \`default_branch_name\` for each repository.`,
292
+ inputSchema: vcsIntegrationRepositoryListInput,
293
+ annotations: READ_ONLY_ANNOTATIONS,
294
+ },
295
+ handler: async (params, context) => {
296
+ const { organization_id: organizationId, vcs_integration_id: vcsIntegrationId } = params;
297
+ const opts = context?.token ? { token: context.token } : undefined;
298
+ try {
299
+ const path = `/organization/${encodeURIComponent(organizationId)}/application/vcs-integrations/${encodeURIComponent(vcsIntegrationId)}/repositories`;
300
+ const repositories = [];
301
+ let cursor;
302
+ for (let page = 0; page < MAX_VCS_REPOSITORY_LIST_PAGES; page++) {
303
+ const result = await client.get(path, {
304
+ ...opts,
305
+ query: cursor ? { cursor } : undefined,
306
+ });
307
+ const batch = result.repositories;
308
+ const next = result.next ?? null;
309
+ const room = MAX_VCS_REPOSITORY_LIST_ITEMS - repositories.length;
310
+ if (room > 0) {
311
+ repositories.push(...batch.slice(0, room));
312
+ }
313
+ const hitItemCap = repositories.length >= MAX_VCS_REPOSITORY_LIST_ITEMS;
314
+ const hitEnd = !next;
315
+ if (hitEnd) {
316
+ return toolSuccess({
317
+ repositories,
318
+ next: null,
319
+ truncated: false,
320
+ });
321
+ }
322
+ if (hitItemCap) {
323
+ return toolSuccess({
324
+ repositories,
325
+ next,
326
+ truncated: true,
327
+ });
328
+ }
329
+ cursor = next;
330
+ }
331
+ return toolSuccess({
332
+ repositories,
333
+ next: cursor ?? null,
334
+ truncated: true,
335
+ note: `Pagination stopped after ${MAX_VCS_REPOSITORY_LIST_PAGES} pages (safety limit).`,
336
+ });
337
+ }
338
+ catch (err) {
339
+ return toolError(errorMessage(err));
340
+ }
341
+ },
342
+ },
343
+ ];
344
+ }
345
+ //# sourceMappingURL=handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/tools/applications/handlers.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,SAAS,GACV,MAA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