@tocharianou/mcp-server-kibana 0.6.1

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 (48) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +530 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.js +417 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/kibana-openapi-source.yaml +52597 -0
  7. package/dist/src/analysis-tools.d.ts +6 -0
  8. package/dist/src/analysis-tools.js +134 -0
  9. package/dist/src/analysis-tools.js.map +1 -0
  10. package/dist/src/base-tools.d.ts +2 -0
  11. package/dist/src/base-tools.js +349 -0
  12. package/dist/src/base-tools.js.map +1 -0
  13. package/dist/src/dependency-analyzer.d.ts +65 -0
  14. package/dist/src/dependency-analyzer.js +233 -0
  15. package/dist/src/dependency-analyzer.js.map +1 -0
  16. package/dist/src/health-analyzer.d.ts +60 -0
  17. package/dist/src/health-analyzer.js +301 -0
  18. package/dist/src/health-analyzer.js.map +1 -0
  19. package/dist/src/kibana-openapi-source.yaml +52597 -0
  20. package/dist/src/openapi-simplifier.d.ts +33 -0
  21. package/dist/src/openapi-simplifier.js +122 -0
  22. package/dist/src/openapi-simplifier.js.map +1 -0
  23. package/dist/src/prompts.d.ts +2 -0
  24. package/dist/src/prompts.js +91 -0
  25. package/dist/src/prompts.js.map +1 -0
  26. package/dist/src/resources.d.ts +2 -0
  27. package/dist/src/resources.js +125 -0
  28. package/dist/src/resources.js.map +1 -0
  29. package/dist/src/types.d.ts +150 -0
  30. package/dist/src/types.js +38 -0
  31. package/dist/src/types.js.map +1 -0
  32. package/dist/src/vl_create_tools.d.ts +5 -0
  33. package/dist/src/vl_create_tools.js +264 -0
  34. package/dist/src/vl_create_tools.js.map +1 -0
  35. package/dist/src/vl_delete_tools.d.ts +5 -0
  36. package/dist/src/vl_delete_tools.js +158 -0
  37. package/dist/src/vl_delete_tools.js.map +1 -0
  38. package/dist/src/vl_get_tools.d.ts +5 -0
  39. package/dist/src/vl_get_tools.js +201 -0
  40. package/dist/src/vl_get_tools.js.map +1 -0
  41. package/dist/src/vl_search_tools.d.ts +9 -0
  42. package/dist/src/vl_search_tools.js +290 -0
  43. package/dist/src/vl_search_tools.js.map +1 -0
  44. package/dist/src/vl_update_tools.d.ts +5 -0
  45. package/dist/src/vl_update_tools.js +372 -0
  46. package/dist/src/vl_update_tools.js.map +1 -0
  47. package/kibana-openapi-source.yaml +52597 -0
  48. package/package.json +95 -0
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Smart OpenAPI Simplifier
3
+ * Converts verbose OpenAPI Spec into compact format that LLM can easily understand
4
+ */
5
+ interface SimplifiedParam {
6
+ name: string;
7
+ in: string;
8
+ required: boolean;
9
+ type: string;
10
+ description?: string;
11
+ }
12
+ interface SimplifiedEndpoint {
13
+ method: string;
14
+ path: string;
15
+ summary?: string;
16
+ description?: string;
17
+ params: SimplifiedParam[];
18
+ requestBody?: string;
19
+ responses: Record<string, string>;
20
+ }
21
+ /**
22
+ * Convert JSON Schema to TypeScript Interface style string
23
+ */
24
+ export declare function schemaToTsType(schema: any, indentLevel?: number): string;
25
+ /**
26
+ * Simplify API endpoint details
27
+ */
28
+ export declare function simplifyEndpointDetail(endpoint: any): SimplifiedEndpoint;
29
+ /**
30
+ * Format to Markdown for LLM readability
31
+ */
32
+ export declare function formatEndpointToMarkdown(detail: SimplifiedEndpoint): string;
33
+ export {};
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Convert JSON Schema to TypeScript Interface style string
3
+ */
4
+ export function schemaToTsType(schema, indentLevel = 0) {
5
+ if (!schema)
6
+ return 'any';
7
+ const indent = ' '.repeat(indentLevel);
8
+ // Handle references (already resolved in base-tools, but for robustness)
9
+ if (schema.$ref) {
10
+ return schema.$ref.split('/').pop() || 'object';
11
+ }
12
+ // Handle basic types
13
+ switch (schema.type) {
14
+ case 'string':
15
+ if (schema.enum)
16
+ return `enum<${schema.enum.map((e) => `'${e}'`).join(' | ')}>`;
17
+ return 'string';
18
+ case 'number':
19
+ case 'integer':
20
+ return 'number';
21
+ case 'boolean':
22
+ return 'boolean';
23
+ case 'array':
24
+ const itemType = schemaToTsType(schema.items, indentLevel);
25
+ return `${itemType}[]`;
26
+ }
27
+ // Handle objects
28
+ if (schema.type === 'object' || schema.properties) {
29
+ if (!schema.properties && !schema.additionalProperties)
30
+ return 'object';
31
+ let lines = [];
32
+ lines.push('{');
33
+ if (schema.properties) {
34
+ for (const [key, prop] of Object.entries(schema.properties)) {
35
+ const isRequired = schema.required?.includes(key);
36
+ const propSchema = prop;
37
+ const propType = schemaToTsType(propSchema, indentLevel + 1);
38
+ const desc = propSchema.description ? ` // ${propSchema.description.slice(0, 50)}${propSchema.description.length > 50 ? '...' : ''}` : '';
39
+ lines.push(`${indent} ${key}${isRequired ? '' : '?'}: ${propType};${desc}`);
40
+ }
41
+ }
42
+ if (schema.additionalProperties) {
43
+ lines.push(`${indent} [key: string]: any;`);
44
+ }
45
+ lines.push(`${indent}}`);
46
+ return lines.join('\n');
47
+ }
48
+ // Handle union types (oneOf, anyOf, allOf)
49
+ if (schema.oneOf)
50
+ return schema.oneOf.map((s) => schemaToTsType(s, indentLevel)).join(' | ');
51
+ if (schema.anyOf)
52
+ return schema.anyOf.map((s) => schemaToTsType(s, indentLevel)).join(' | ');
53
+ if (schema.allOf)
54
+ return schema.allOf.map((s) => schemaToTsType(s, indentLevel)).join(' & ');
55
+ return 'any';
56
+ }
57
+ /**
58
+ * Simplify API endpoint details
59
+ */
60
+ export function simplifyEndpointDetail(endpoint) {
61
+ // 1. Simplify parameters
62
+ const params = (endpoint.parameters || []).map((p) => ({
63
+ name: p.name,
64
+ in: p.in,
65
+ required: p.required || false,
66
+ type: p.schema?.type || 'string',
67
+ description: p.description
68
+ }));
69
+ // 2. Simplify Request Body
70
+ let requestBody = '';
71
+ if (endpoint.requestBody?.content?.['application/json']?.schema) {
72
+ requestBody = schemaToTsType(endpoint.requestBody.content['application/json'].schema);
73
+ }
74
+ // 3. Simplify Responses
75
+ const responses = {};
76
+ if (endpoint.responses) {
77
+ for (const [code, resp] of Object.entries(endpoint.responses)) {
78
+ const respObj = resp;
79
+ responses[code] = respObj.description || '';
80
+ }
81
+ }
82
+ return {
83
+ method: endpoint.method,
84
+ path: endpoint.path,
85
+ summary: endpoint.summary,
86
+ description: endpoint.description,
87
+ params,
88
+ requestBody: requestBody || undefined,
89
+ responses
90
+ };
91
+ }
92
+ /**
93
+ * Format to Markdown for LLM readability
94
+ */
95
+ export function formatEndpointToMarkdown(detail) {
96
+ let md = `## ${detail.method} ${detail.path}\n\n`;
97
+ if (detail.summary)
98
+ md += `**Summary**: ${detail.summary}\n\n`;
99
+ if (detail.description)
100
+ md += `**Description**: ${detail.description}\n\n`;
101
+ if (detail.params.length > 0) {
102
+ md += `### Parameters\n`;
103
+ detail.params.forEach(p => {
104
+ md += `- \`${p.name}\` (${p.in}, ${p.required ? 'required' : 'optional'}): ${p.description || ''}\n`;
105
+ });
106
+ md += '\n';
107
+ }
108
+ if (detail.requestBody) {
109
+ md += `### Request Body (TypeScript Interface)\n`;
110
+ md += "```typescript\n";
111
+ md += detail.requestBody;
112
+ md += "\n```\n\n";
113
+ }
114
+ if (Object.keys(detail.responses).length > 0) {
115
+ md += `### Responses\n`;
116
+ for (const [code, desc] of Object.entries(detail.responses)) {
117
+ md += `- **${code}**: ${desc}\n`;
118
+ }
119
+ }
120
+ return md;
121
+ }
122
+ //# sourceMappingURL=openapi-simplifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi-simplifier.js","sourceRoot":"","sources":["../../src/openapi-simplifier.ts"],"names":[],"mappings":"AA0BA;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAW,EAAE,WAAW,GAAG,CAAC;IACzD,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAE1B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAExC,yEAAyE;IACzE,IAAI,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CAAC;QACxB,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YAC5D,EAAE,IAAI,OAAO,IAAI,OAAO,IAAI,IAAI,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ServerBase } from "./types";
2
+ export declare function registerPrompts(server: ServerBase, defaultSpace: string): void;
@@ -0,0 +1,91 @@
1
+ import { z } from "zod";
2
+ export function registerPrompts(server, defaultSpace) {
3
+ // 1. Kibana Tool Expert - Tool-based Kibana expert using tools defined in base-tools.ts
4
+ const kibanaToolExpertSchema = z.object({
5
+ query: z
6
+ .string()
7
+ .describe("User's question or request about Kibana"),
8
+ context: z
9
+ .string()
10
+ .optional()
11
+ .describe("Optional context information to help understand the user's needs or Kibana environment"),
12
+ });
13
+ server.prompt("kibana-tool-expert", kibanaToolExpertSchema, async (input) => {
14
+ return {
15
+ description: `Multi-space Kibana expert assistant (default space: '${defaultSpace}')`,
16
+ messages: [
17
+ {
18
+ role: "user",
19
+ content: {
20
+ type: "text",
21
+ text: `[System Instruction] You are a Kibana expert with multi-space capabilities.
22
+
23
+ [Default Space] ${defaultSpace}
24
+
25
+ Key capabilities:
26
+ 1. All tools now support an optional 'space' parameter - you can specify different spaces for different operations
27
+ 2. When no space is specified, operations use the default space: '${defaultSpace}'
28
+ 3. You can discover available spaces using the 'get_available_spaces' tool
29
+ 4. Always inform the user which space an operation will target
30
+
31
+ Important: When creating dashboards, saved objects, or other Kibana resources, you can specify the target space in the tool parameters. For example:
32
+ - execute_api({method: "POST", path: "/api/saved_objects/dashboard", space: "marketing-team", body: {...}})
33
+
34
+ ${input.context ? `\n[Context Information]\n${input.context}` : ''}
35
+
36
+ [User Question] ${input.query}`
37
+ }
38
+ }
39
+ ]
40
+ };
41
+ });
42
+ // 2. Kibana Resource Helper - Assistant designed for clients that only support resources
43
+ const kibanaResourceHelperSchema = z.object({
44
+ query: z
45
+ .string()
46
+ .describe("User's question about Kibana API or resources"),
47
+ specificResource: z
48
+ .string()
49
+ .optional()
50
+ .describe("Optional specific resource name, such as 'kibana-api-paths' or 'kibana-api-path-detail'"),
51
+ });
52
+ server.prompt("kibana-resource-helper", kibanaResourceHelperSchema, async (input) => {
53
+ return {
54
+ description: `Multi-space Kibana API resource assistant (default space: '${defaultSpace}')`,
55
+ messages: [
56
+ {
57
+ role: "user",
58
+ content: {
59
+ type: "text",
60
+ text: `[System Instruction] You are a professional Kibana API resource expert with multi-space support.
61
+
62
+ [Default Space] ${defaultSpace}
63
+
64
+ Guidelines:
65
+ 1. You can guide users to use space-aware resource URIs
66
+ 2. Resources can include space parameters for targeted operations
67
+ 3. Available resources:
68
+ - kibana-api://paths - Get a list of all API paths, can be filtered with the search parameter
69
+ - kibana-api://path/{method}/{encoded_path} - Get detailed information for a specific API endpoint
70
+
71
+ 4. Space-aware API patterns:
72
+ - Most Kibana APIs support space-specific endpoints: /s/{space-id}/api/...
73
+ - When no space is specified, operations target the default space
74
+ - Users can specify target spaces in API calls
75
+
76
+ 5. Interaction Guidelines:
77
+ - Provide clear resource URI examples
78
+ - Explain space parameter usage
79
+ - Show how to construct space-aware API calls
80
+ - Provide complete workflow examples including space targeting
81
+
82
+ ${input.specificResource ? `\n[Specified Resource] The user mentioned a specific resource: ${input.specificResource}` : ''}
83
+
84
+ [User Question] ${input.query}`
85
+ }
86
+ }
87
+ ]
88
+ };
89
+ });
90
+ }
91
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,eAAe,CAAC,MAAkB,EAAE,YAAoB;IACtE,wFAAwF;IACxF,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,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AgB,CAAC,CAAC,CAAC,kEAAkE,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE;;kBAExG,KAAK,CAAC,KAAK,EAAE;qBAClB;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ServerBase, KibanaClient } from "./types";
2
+ export declare function registerResources(server: ServerBase, kibanaClient: KibanaClient, spaceName: string): void;
@@ -0,0 +1,125 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import yaml from 'js-yaml';
4
+ import { fileURLToPath } from 'url';
5
+ import { dirname } from 'path';
6
+ // ESM-compatible __dirname
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+ let apiEndpointIndex = [];
10
+ let isIndexBuilt = false;
11
+ let YAML_FILE_PATH = '';
12
+ // Build the API index from the OpenAPI YAML file
13
+ async function buildApiIndex() {
14
+ if (isIndexBuilt)
15
+ return;
16
+ // Only search for YAML file in the main directory
17
+ const possiblePaths = [
18
+ path.join(process.cwd(), 'kibana-openapi-source.yaml')
19
+ ];
20
+ for (const p of possiblePaths) {
21
+ if (fs.existsSync(p)) {
22
+ YAML_FILE_PATH = p;
23
+ break;
24
+ }
25
+ }
26
+ if (!YAML_FILE_PATH) {
27
+ isIndexBuilt = true;
28
+ return;
29
+ }
30
+ const yamlContent = fs.readFileSync(YAML_FILE_PATH, 'utf8');
31
+ const openApiDoc = yaml.load(yamlContent);
32
+ if (!openApiDoc || !openApiDoc.paths) {
33
+ isIndexBuilt = true;
34
+ return;
35
+ }
36
+ for (const [pathStr, pathObj] of Object.entries(openApiDoc.paths)) {
37
+ for (const [method, methodObj] of Object.entries(pathObj)) {
38
+ if (["get", "post", "put", "delete", "patch"].includes(method)) {
39
+ apiEndpointIndex.push({
40
+ path: pathStr,
41
+ method: method.toUpperCase(),
42
+ description: methodObj.description,
43
+ summary: methodObj.summary,
44
+ parameters: methodObj.parameters,
45
+ requestBody: methodObj.requestBody,
46
+ responses: methodObj.responses,
47
+ deprecated: methodObj.deprecated,
48
+ tags: methodObj.tags
49
+ });
50
+ }
51
+ }
52
+ }
53
+ isIndexBuilt = true;
54
+ }
55
+ function searchApiEndpoints(query) {
56
+ if (!isIndexBuilt)
57
+ throw new Error('API index not built yet');
58
+ const q = query.toLowerCase();
59
+ return apiEndpointIndex.filter(e => e.path.toLowerCase().includes(q) ||
60
+ (e.description && e.description.toLowerCase().includes(q)) ||
61
+ (e.summary && e.summary.toLowerCase().includes(q)) ||
62
+ (e.tags && e.tags.some(tag => tag.toLowerCase().includes(q))));
63
+ }
64
+ export function registerResources(server, kibanaClient, spaceName) {
65
+ // 1. API path list resource
66
+ server.resource("kibana-api-paths", "kibana-api://paths", async (uri, params) => {
67
+ await buildApiIndex();
68
+ const search = params.search || "";
69
+ const endpoints = search ? searchApiEndpoints(search) : apiEndpointIndex;
70
+ return {
71
+ contents: [
72
+ {
73
+ uri: uri.href,
74
+ mimeType: "application/json",
75
+ text: JSON.stringify({
76
+ space: spaceName,
77
+ total_endpoints: endpoints.length,
78
+ search_query: search || "all",
79
+ endpoints: endpoints.map(e => ({
80
+ method: e.method,
81
+ path: e.path,
82
+ summary: e.summary,
83
+ description: e.description
84
+ }))
85
+ }, null, 2)
86
+ }
87
+ ]
88
+ };
89
+ });
90
+ // 2. Single API endpoint detail resource
91
+ server.resource("kibana-api-path-detail", "kibana-api://path/{method}/{encoded_path}", async (uri, params) => {
92
+ await buildApiIndex();
93
+ const method = params.method?.toUpperCase();
94
+ const path = decodeURIComponent(params.encoded_path);
95
+ const endpoint = apiEndpointIndex.find(e => e.method === method && e.path === path);
96
+ if (!endpoint) {
97
+ return {
98
+ contents: [
99
+ {
100
+ uri: uri.href,
101
+ mimeType: "application/json",
102
+ text: JSON.stringify({
103
+ space: spaceName,
104
+ error: "API endpoint not found",
105
+ requested: { method, path }
106
+ }, null, 2)
107
+ }
108
+ ]
109
+ };
110
+ }
111
+ return {
112
+ contents: [
113
+ {
114
+ uri: uri.href,
115
+ mimeType: "application/json",
116
+ text: JSON.stringify({
117
+ space: spaceName,
118
+ endpoint: endpoint
119
+ }, null, 2)
120
+ }
121
+ ]
122
+ };
123
+ });
124
+ }
125
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/resources.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,2BAA2B;AAC3B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAetC,IAAI,gBAAgB,GAAkB,EAAE,CAAC;AACzC,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,IAAI,cAAc,GAAG,EAAE,CAAC;AAExB,iDAAiD;AACjD,KAAK,UAAU,aAAa;IAC1B,IAAI,YAAY;QAAE,OAAO;IACzB,kDAAkD;IAClD,MAAM,aAAa,GAAG;QACpB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,4BAA4B,CAAC;KACvD,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;QAC9B,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YACrB,cAAc,GAAG,CAAC,CAAC;YACnB,MAAM;QACR,CAAC;IACH,CAAC;IACD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,YAAY,GAAG,IAAI,CAAC;QACpB,OAAO;IACT,CAAC;IACD,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc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AI,EAAE,CAAC,CAAC;iBACZ;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,150 @@
1
+ import { z } from "zod";
2
+ export declare const BaseSearchSchema: z.ZodObject<{
3
+ search: z.ZodOptional<z.ZodString>;
4
+ page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
5
+ per_page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ page: number;
8
+ per_page: number;
9
+ search?: string | undefined;
10
+ }, {
11
+ search?: string | undefined;
12
+ page?: number | undefined;
13
+ per_page?: number | undefined;
14
+ }>;
15
+ export declare const BaseIdSchema: z.ZodObject<{
16
+ id: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ id: string;
19
+ }, {
20
+ id: string;
21
+ }>;
22
+ export declare const BaseNameSchema: z.ZodObject<{
23
+ name: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ name: string;
26
+ }, {
27
+ name: string;
28
+ }>;
29
+ export declare const BaseDescriptionSchema: z.ZodObject<{
30
+ description: z.ZodOptional<z.ZodString>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ description?: string | undefined;
33
+ }, {
34
+ description?: string | undefined;
35
+ }>;
36
+ export declare const KibanaConfigSchema: z.ZodObject<{
37
+ url: z.ZodString;
38
+ username: z.ZodOptional<z.ZodString>;
39
+ password: z.ZodOptional<z.ZodString>;
40
+ cookies: z.ZodOptional<z.ZodString>;
41
+ apiKey: z.ZodOptional<z.ZodString>;
42
+ caCert: z.ZodOptional<z.ZodString>;
43
+ timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
44
+ maxRetries: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
45
+ defaultSpace: z.ZodDefault<z.ZodOptional<z.ZodString>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ url: string;
48
+ timeout: number;
49
+ maxRetries: number;
50
+ defaultSpace: string;
51
+ username?: string | undefined;
52
+ password?: string | undefined;
53
+ cookies?: string | undefined;
54
+ apiKey?: string | undefined;
55
+ caCert?: string | undefined;
56
+ }, {
57
+ url: string;
58
+ username?: string | undefined;
59
+ password?: string | undefined;
60
+ cookies?: string | undefined;
61
+ apiKey?: string | undefined;
62
+ caCert?: string | undefined;
63
+ timeout?: number | undefined;
64
+ maxRetries?: number | undefined;
65
+ defaultSpace?: string | undefined;
66
+ }>;
67
+ export type KibanaConfig = z.infer<typeof KibanaConfigSchema>;
68
+ export interface ToolResponse {
69
+ content: Array<{
70
+ type: "text";
71
+ text: string;
72
+ }>;
73
+ isError?: boolean;
74
+ }
75
+ export interface ResourceResponse {
76
+ contents: Array<{
77
+ uri: string;
78
+ mimeType: string;
79
+ text?: string;
80
+ binary?: Uint8Array;
81
+ size?: number;
82
+ }>;
83
+ }
84
+ export interface PromptResponse {
85
+ description?: string;
86
+ messages: Array<{
87
+ role: "user" | "assistant" | "system";
88
+ content: {
89
+ type: "text";
90
+ text: string;
91
+ };
92
+ }>;
93
+ }
94
+ export interface KibanaClient {
95
+ get: (url: string, options?: {
96
+ params?: any;
97
+ headers?: any;
98
+ space?: string;
99
+ }) => Promise<any>;
100
+ post: (url: string, data?: any, options?: {
101
+ headers?: any;
102
+ space?: string;
103
+ }) => Promise<any>;
104
+ put: (url: string, data?: any, options?: {
105
+ headers?: any;
106
+ space?: string;
107
+ }) => Promise<any>;
108
+ delete: (url: string, options?: {
109
+ headers?: any;
110
+ space?: string;
111
+ }) => Promise<any>;
112
+ patch?: (url: string, data?: any, options?: {
113
+ headers?: any;
114
+ space?: string;
115
+ }) => Promise<any>;
116
+ }
117
+ export interface ServerBase {
118
+ tool: {
119
+ (name: string, cb: (extra: RequestHandlerExtra) => Promise<ToolResponse> | ToolResponse): void;
120
+ (name: string, description: string, schema: any, handler: (args: any, extra: RequestHandlerExtra) => Promise<ToolResponse> | ToolResponse): void;
121
+ };
122
+ prompt: {
123
+ (name: string, schema: any, handler: (args: any, extra?: RequestHandlerExtra) => Promise<PromptResponse> | PromptResponse): void;
124
+ };
125
+ resource: {
126
+ (name: string, uri: string, handler: (uri: URL, params: Record<string, string>, extra?: RequestHandlerExtra) => Promise<ResourceResponse> | ResourceResponse): void;
127
+ (name: string, template: any, handler: (uri: URL, params: Record<string, string>, extra?: RequestHandlerExtra) => Promise<ResourceResponse> | ResourceResponse): void;
128
+ };
129
+ }
130
+ export interface RequestHandlerExtra {
131
+ [key: string]: unknown;
132
+ signal: AbortSignal;
133
+ }
134
+ export declare class KibanaError extends Error {
135
+ statusCode?: number | undefined;
136
+ details?: any | undefined;
137
+ constructor(message: string, statusCode?: number | undefined, details?: any | undefined);
138
+ }
139
+ export interface ToolRegistrationResult {
140
+ name: string;
141
+ success: boolean;
142
+ error?: string;
143
+ }
144
+ export interface ServerCreationOptions {
145
+ name: string;
146
+ version: string;
147
+ transport?: any;
148
+ config: KibanaConfig;
149
+ description?: string;
150
+ }
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ // Base schema types
3
+ export const BaseSearchSchema = z.object({
4
+ search: z.string().optional(),
5
+ page: z.number().optional().default(1),
6
+ per_page: z.number().optional().default(20)
7
+ });
8
+ export const BaseIdSchema = z.object({
9
+ id: z.string()
10
+ });
11
+ export const BaseNameSchema = z.object({
12
+ name: z.string()
13
+ });
14
+ export const BaseDescriptionSchema = z.object({
15
+ description: z.string().optional()
16
+ });
17
+ // Configuration schema
18
+ export const KibanaConfigSchema = z.object({
19
+ url: z.string().trim().min(1, "Kibana URL cannot be empty").url("Invalid Kibana URL format"),
20
+ username: z.string().optional(),
21
+ password: z.string().optional(),
22
+ cookies: z.string().optional(),
23
+ apiKey: z.string().optional(),
24
+ caCert: z.string().optional(),
25
+ timeout: z.number().optional().default(30000),
26
+ maxRetries: z.number().optional().default(3),
27
+ defaultSpace: z.string().optional().default('default'),
28
+ });
29
+ // Error types
30
+ export class KibanaError extends Error {
31
+ constructor(message, statusCode, details) {
32
+ super(message);
33
+ this.statusCode = statusCode;
34
+ this.details = details;
35
+ this.name = "KibanaError";
36
+ }
37
+ }
38
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oBAAoB;AACpB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,uBAAuB;AACvB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,4BAA4B,CAAC,CAAC,GAAG,CAAC,2BAA2B,CAAC;IAC5F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC7C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;CACvD,CAAC,CAAC;AAoEH,cAAc;AACd,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YACE,OAAe,EACR,UAAmB,EACnB,OAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,eAAU,GAAV,UAAU,CAAS;QACnB,YAAO,GAAP,OAAO,CAAM;QAGpB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import { ServerBase, KibanaClient } from './types.js';
2
+ /**
3
+ * Register VL (Visualization Layer) create tools with the MCP server
4
+ */
5
+ export declare function registerVLCreateTools(server: ServerBase, kibanaClient: KibanaClient): void;