@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
package/README.md ADDED
@@ -0,0 +1,530 @@
1
+ [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/tocharianou-mcp-server-kibana-badge.png)](https://mseep.ai/app/tocharianou-mcp-server-kibana)
2
+
3
+ # Kibana MCP Server
4
+ [![npm version](https://badge.fury.io/js/@tocharianou%2Fmcp-server-kibana.svg)](https://www.npmjs.com/package/@tocharianou/mcp-server-kibana)
5
+ [![Downloads](https://img.shields.io/npm/dm/@tocharianou/mcp-server-kibana.svg)](https://www.npmjs.com/package/@tocharianou/mcp-server-kibana)
6
+ [![MCP Registry](https://img.shields.io/badge/MCP_Registry-listed-blue)](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.TocharianOU/kibana)
7
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
8
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/TocharianOU/mcp-server-kibana)
9
+
10
+ > **API Specification**
11
+ >
12
+ > This project is based on the official Elastic Kibana API documentation and uses the OpenAPI YAML specification from Elastic Stack 8.x (ES8) to dynamically retrieve and manage all Kibana API endpoints. For the latest details, see the [Kibana API documentation](https://www.elastic.co/docs/api/doc/kibana/).
13
+
14
+ A Kibana MCP server implementation that allows any MCP-compatible client (such as Claude Desktop) to access your Kibana instance via natural language or programmatic requests.
15
+
16
+ **Key Features:**
17
+ - Dynamic API discovery from Kibana OpenAPI specification
18
+ - Comprehensive Kibana management (dashboards, visualizations, saved objects)
19
+ - Health monitoring and dependency analysis
20
+ - Dual transport modes (stdio and HTTP)
21
+ - Full integration with Elastic Stack ecosystem
22
+
23
+ **This project is community-maintained and is not an official product of Elastic or MCP.**
24
+
25
+ > **💡 Companion Project**
26
+ >
27
+ > For complete Elastic Stack integration, pair this with [**Elasticsearch MCP Server**](https://github.com/TocharianOU/elasticsearch-mcp) for direct Elasticsearch data operations. Together, they provide comprehensive observability and data management capabilities for your Elastic Stack environment.
28
+
29
+ ---
30
+
31
+ ## 🚀 Installation
32
+
33
+ ### Quick Install
34
+ ```bash
35
+ # Global installation (recommended)
36
+ npm install -g @tocharianou/mcp-server-kibana
37
+
38
+ # Or local installation
39
+ npm install @tocharianou/mcp-server-kibana
40
+ ```
41
+
42
+ ### Alternative: From Source
43
+ ```bash
44
+ git clone https://github.com/TocharianOU/mcp-server-kibana.git
45
+ cd mcp-server-kibana
46
+ npm install
47
+ npm run build
48
+ ```
49
+
50
+ ---
51
+
52
+ ## 🎯 Quick Start
53
+
54
+ ### Method 1: Direct CLI Usage
55
+
56
+ #### Using Basic Authentication
57
+ ```bash
58
+ # Set your Kibana credentials and run
59
+ KIBANA_URL=http://your-kibana-server:5601 \
60
+ KIBANA_USERNAME=your-username \
61
+ KIBANA_PASSWORD=your-password \
62
+ npx @tocharianou/mcp-server-kibana
63
+ ```
64
+
65
+ #### Using Cookie Authentication
66
+ ```bash
67
+ # Set your Kibana session cookies and run
68
+ KIBANA_URL=http://your-kibana-server:5601 \
69
+ KIBANA_COOKIES="sid=your-session-id; security-session=your-security-session" \
70
+ npx @tocharianou/mcp-server-kibana
71
+ ```
72
+
73
+ #### Using API Key Authentication
74
+
75
+ ```bash
76
+ # Set your Kibana API Key and run
77
+ KIBANA_URL=http://your-kibana-server:5601 \
78
+ KIBANA_API_KEY=your-base64-encoded-api-key \
79
+ npx @tocharianou/mcp-server-kibana
80
+ ```
81
+
82
+ ### Method 2: Claude Desktop Integration (Recommended)
83
+
84
+ Add to your Claude Desktop configuration file:
85
+
86
+ **Config file locations:**
87
+
88
+ - **MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
89
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
90
+
91
+ #### Using Basic Authentication
92
+
93
+ ```json
94
+ {
95
+ "mcpServers": {
96
+ "kibana-mcp-server": {
97
+ "command": "npx",
98
+ "args": ["@tocharianou/mcp-server-kibana"],
99
+ "env": {
100
+ "KIBANA_URL": "http://your-kibana-server:5601",
101
+ "KIBANA_USERNAME": "your-username",
102
+ "KIBANA_PASSWORD": "your-password",
103
+ "KIBANA_DEFAULT_SPACE": "default",
104
+ "NODE_TLS_REJECT_UNAUTHORIZED": "0"
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ #### Using Cookie Authentication
112
+
113
+ ```json
114
+ {
115
+ "mcpServers": {
116
+ "kibana-mcp-server": {
117
+ "command": "npx",
118
+ "args": ["@tocharianou/mcp-server-kibana"],
119
+ "env": {
120
+ "KIBANA_URL": "http://your-kibana-server:5601",
121
+ "KIBANA_COOKIES": "sid=your-session-id; security-session=your-security-session",
122
+ "KIBANA_DEFAULT_SPACE": "default",
123
+ "NODE_TLS_REJECT_UNAUTHORIZED": "0"
124
+ }
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ #### Using API Key Authentication
131
+
132
+ ```json
133
+ {
134
+ "mcpServers": {
135
+ "kibana-mcp-server": {
136
+ "command": "npx",
137
+ "args": ["@tocharianou/mcp-server-kibana"],
138
+ "env": {
139
+ "KIBANA_URL": "http://your-kibana-server:5601",
140
+ "KIBANA_API_KEY": "your-base64-encoded-api-key",
141
+ "KIBANA_DEFAULT_SPACE": "default",
142
+ "NODE_TLS_REJECT_UNAUTHORIZED": "0"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ ### Method 3: Using Environment File
150
+
151
+ ```bash
152
+ # Create .env file
153
+ cat > kibana-mcp.env << EOF
154
+ KIBANA_URL=http://your-kibana-server:5601
155
+ KIBANA_USERNAME=your-username
156
+ KIBANA_PASSWORD=your-password
157
+ NODE_TLS_REJECT_UNAUTHORIZED=0
158
+ EOF
159
+
160
+ # Run with environment file
161
+ env $(cat kibana-mcp.env | xargs) npx @tocharianou/mcp-server-kibana
162
+ ```
163
+
164
+ ### Method 4: Streamable HTTP Mode (NEW in v0.4.0)
165
+
166
+ Run the server as a standalone HTTP service for remote access and API integration:
167
+
168
+ ```bash
169
+ # Start HTTP server (default port 3000)
170
+ MCP_TRANSPORT=http \
171
+ KIBANA_URL=http://your-kibana-server:5601 \
172
+ KIBANA_USERNAME=your-username \
173
+ KIBANA_PASSWORD=your-password \
174
+ npx @tocharianou/mcp-server-kibana
175
+
176
+ # Or with custom port and host
177
+ MCP_TRANSPORT=http \
178
+ MCP_HTTP_PORT=9000 \
179
+ MCP_HTTP_HOST=0.0.0.0 \
180
+ KIBANA_URL=http://your-kibana-server:5601 \
181
+ KIBANA_USERNAME=your-username \
182
+ KIBANA_PASSWORD=your-password \
183
+ npx @tocharianou/mcp-server-kibana
184
+ ```
185
+
186
+ **HTTP Mode Features:**
187
+
188
+ - Exposes MCP server at `http://host:port/mcp` endpoint
189
+ - Health check available at `http://host:port/health`
190
+ - Session-based connection management
191
+ - Supports both POST (JSON-RPC requests) and GET (SSE streams)
192
+ - Compatible with any HTTP client or MCP SDK
193
+
194
+ **Example HTTP client usage:**
195
+
196
+ ```javascript
197
+ // Initialize connection
198
+ const response = await fetch('http://localhost:3000/mcp', {
199
+ method: 'POST',
200
+ headers: { 'Content-Type': 'application/json' },
201
+ body: JSON.stringify({
202
+ jsonrpc: '2.0',
203
+ method: 'initialize',
204
+ params: {
205
+ protocolVersion: '2024-11-05',
206
+ capabilities: {},
207
+ clientInfo: { name: 'my-client', version: '1.0.0' }
208
+ },
209
+ id: 1
210
+ })
211
+ });
212
+
213
+ const sessionId = response.headers.get('mcp-session-id');
214
+
215
+ // Subsequent requests include session ID
216
+ const toolsResponse = await fetch('http://localhost:3000/mcp', {
217
+ method: 'POST',
218
+ headers: {
219
+ 'Content-Type': 'application/json',
220
+ 'mcp-session-id': sessionId
221
+ },
222
+ body: JSON.stringify({
223
+ jsonrpc: '2.0',
224
+ method: 'tools/list',
225
+ params: {},
226
+ id: 2
227
+ })
228
+ });
229
+ ```
230
+
231
+ ---
232
+
233
+ ## Features
234
+
235
+ ### Core Features
236
+
237
+ - Connect to local or remote Kibana instances
238
+ - **Dual transport modes**:
239
+ - **Stdio transport** (default) - For Claude Desktop and local MCP clients
240
+ - **Streamable HTTP transport** (NEW in v0.4.0) - For remote access, API integration, and web applications
241
+ - **Dual authentication support**:
242
+ - Cookie-based authentication (recommended for browser sessions)
243
+ - Basic authentication (username/password)
244
+ - SSL/TLS and custom CA certificate support
245
+ - Multi-space support for enterprise Kibana environments
246
+ - Exposes Kibana API endpoints as both tools and resources
247
+ - Search, view, and execute Kibana APIs from MCP clients
248
+ - Type-safe, extensible, and easy to integrate
249
+ - **Session management** with automatic UUID generation for HTTP mode
250
+ - **Health check endpoint** for monitoring and load balancing
251
+
252
+ ### Visualization Layer (VL) Features
253
+
254
+ - **Complete CRUD operations** for Kibana saved objects
255
+ - **Universal saved object management** - works with all object types
256
+ - **Intelligent parameter handling** - supports multiple input formats (arrays, JSON strings, comma-separated)
257
+ - **Optimized search** with pagination support and performance tips
258
+ - **Bulk operations** for efficient mass updates and deletions
259
+ - **Version control** with optimistic concurrency for safe updates
260
+ - **Reference management** for object relationships
261
+ - **Multi-format type support** - flexible input parsing for better UX
262
+
263
+ ---
264
+
265
+ ## Directory Structure
266
+
267
+ ```
268
+ ├── index.ts # Server entry point
269
+ ├── src/
270
+ │ ├── types.ts # Type definitions and schemas
271
+ │ ├── base-tools.ts # Tool registration and API logic
272
+ │ ├── prompts.ts # Prompt registration (expert & resource helper)
273
+ │ ├── resources.ts # Resource registration (API paths/URIs)
274
+ │ ├── vl_search_tools.ts # Visualization Layer - Search tools
275
+ │ ├── vl_get_tools.ts # Visualization Layer - Get tools
276
+ │ ├── vl_create_tools.ts # Visualization Layer - Create tools
277
+ │ ├── vl_update_tools.ts # Visualization Layer - Update tools
278
+ │ └── vl_delete_tools.ts # Visualization Layer - Delete tools
279
+ ├── kibana-openapi-source.yaml # Kibana API OpenAPI index
280
+ ├── README.md # English documentation
281
+ ├── README_zh.md # Chinese documentation
282
+ ```
283
+
284
+ ---
285
+
286
+ ## Resources
287
+
288
+ | Resource URI | Description |
289
+ |------------------------------------------------|----------------------------------------------------|
290
+ | `kibana-api://paths` | Returns all available Kibana API endpoints (can filter with `search` param) |
291
+ | `kibana-api://path/{method}/{encoded_path}` | Returns details for a specific API endpoint |
292
+
293
+ **Examples:**
294
+
295
+ - `kibana-api://paths?search=saved_objects`
296
+ - `kibana-api://path/GET/%2Fapi%2Fstatus`
297
+
298
+ ---
299
+
300
+ ## Tools
301
+
302
+ ### Base Tools
303
+
304
+ | Tool Name | Description | Input Parameters |
305
+ |-----------------------------|----------------------------------------------------|---------------------------------------------------------------------|
306
+ | `get_status` | Get the current status of the Kibana server | `space` (optional string) - Target Kibana space |
307
+ | `execute_kb_api` | Execute a custom Kibana API request | `method` (GET/POST/PUT/DELETE), `path` (string), `body` (optional), `params` (optional), `space` (optional string) |
308
+ | `get_available_spaces` | Get available Kibana spaces and current context | `include_details` (optional boolean) - Include full space details |
309
+ | `search_kibana_api_paths` | Search Kibana API endpoints by keyword | `search` (string) |
310
+ | `list_all_kibana_api_paths` | List all Kibana API endpoints | None |
311
+ | `get_kibana_api_detail` | Get details for a specific Kibana API endpoint | `method` (string), `path` (string) |
312
+
313
+ ### Visualization Layer (VL) Tools - Saved Objects Management
314
+
315
+ | Tool Name | Description | Input Parameters |
316
+ |--------------------------------|----------------------------------------------------|---------------------------------------------------------------------|
317
+ | `vl_search_saved_objects` | Search for Kibana saved objects (universal) | `types` (required array), `search` (optional), `fields` (optional), `perPage` (optional), `page` (optional), `space` (optional) |
318
+ | `vl_get_saved_object` | Get a single saved object by type and ID | `type` (required), `id` (required), `useResolve` (optional), `space` (optional) |
319
+ | `vl_create_saved_object` | Create a new saved object (universal) | `type` (required), `attributes` (required), `id` (optional), `overwrite` (optional), `references` (optional), `space` (optional) |
320
+ | `vl_update_saved_object` | Update a single saved object | `type` (required), `id` (required), `attributes` (required), `references` (optional), `version` (optional), `space` (optional) |
321
+ | `vl_bulk_update_saved_objects` | Update multiple saved objects in bulk | `objects` (required array), `space` (optional) |
322
+ | `vl_bulk_delete_saved_objects` | Delete multiple saved objects in bulk | `objects` (required array), `force` (optional), `space` (optional) |
323
+
324
+ **Supported Saved Object Types:** `dashboard`, `visualization`, `index-pattern`, `search`, `config`, `lens`, `map`, `tag`, `canvas-workpad`, `canvas-element`
325
+
326
+ ---
327
+
328
+ ## Prompts
329
+
330
+ | Prompt Name | Description |
331
+ |-------------------------|-----------------------------------------------------------------------------|
332
+ | `kibana-tool-expert` | Tool expert mode (highly recommended in Claude Desktop), supports intelligent analysis, search, execution, and explanation of Kibana APIs via tools. Recommended for most users. |
333
+ | `kibana-resource-helper`| Resource helper mode, guides how to access and use Kibana API info via resource URIs. Suitable for clients that only support resource access or need raw API metadata. |
334
+
335
+ ---
336
+
337
+ ## Configuration
338
+
339
+ Configure the server via environment variables:
340
+
341
+ ### Kibana Connection Settings
342
+
343
+ | Variable Name | Description | Required |
344
+ |----------------------------------|-----------------------------------------------------|----------|
345
+ | `KIBANA_URL` | Kibana server address (e.g. <http://localhost:5601>) | Yes |
346
+ | `KIBANA_API_KEY` | Kibana API Key (base64 encoded, for API key auth) | No* |
347
+ | `KIBANA_USERNAME` | Kibana username (for basic auth) | No* |
348
+ | `KIBANA_PASSWORD` | Kibana password (for basic auth) | No* |
349
+ | `KIBANA_COOKIES` | Kibana session cookies (for cookie auth) | No* |
350
+ | `KIBANA_DEFAULT_SPACE` | Default Kibana space (default: 'default') | No |
351
+ | `KIBANA_CA_CERT` | CA certificate path (optional, for SSL verification) | No |
352
+ | `KIBANA_TIMEOUT` | Request timeout in ms (default 30000) | No |
353
+ | `KIBANA_MAX_RETRIES` | Max request retries (default 3) | No |
354
+ | `NODE_TLS_REJECT_UNAUTHORIZED` | Set to `0` to disable SSL certificate validation (use with caution) | No |
355
+
356
+ *One of the following authentication methods must be provided: `KIBANA_API_KEY`, `KIBANA_COOKIES`, or both `KIBANA_USERNAME` and `KIBANA_PASSWORD`. Priority order: API Key > Basic Auth > Cookies.
357
+
358
+ ### Transport Mode Settings (NEW in v0.4.0)
359
+
360
+ | Variable Name | Description | Default | Values |
361
+ |-------------------|------------------------------------------------|-----------|-----------------|
362
+ | `MCP_TRANSPORT` | Transport mode selection | `stdio` | `stdio`, `http` |
363
+ | `MCP_HTTP_PORT` | HTTP server port (when using HTTP transport) | `3000` | 1-65535 |
364
+ | `MCP_HTTP_HOST` | HTTP server host (when using HTTP transport) | `localhost` | Any valid host |
365
+
366
+ **Transport Mode Details:**
367
+
368
+ - **Stdio mode** (default): For Claude Desktop and local MCP clients
369
+ - **HTTP mode**: Runs as a standalone HTTP server for remote access, API integration, and web applications
370
+
371
+ ---
372
+
373
+ ## 📦 Package Information
374
+
375
+ - **NPM Package**: [@tocharianou/mcp-server-kibana](https://www.npmjs.com/package/@tocharianou/mcp-server-kibana)
376
+ - **GitHub Repository**: [TocharianOU/mcp-server-kibana](https://github.com/TocharianOU/mcp-server-kibana)
377
+ - **Node.js**: >= 18.0.0
378
+ - **Package Size**: ~685KB (6.4MB unpacked)
379
+
380
+ ---
381
+
382
+ ## 🔧 Troubleshooting
383
+
384
+ ### Common Issues
385
+
386
+ #### "import: command not found" error
387
+
388
+ ```bash
389
+ # Make sure you're using the latest version
390
+ npm install -g @tocharianou/mcp-server-kibana@latest
391
+
392
+ # Or try using node directly
393
+ node $(which mcp-server-kibana)
394
+ ```
395
+
396
+ #### Connection issues
397
+
398
+ - Verify Kibana URL is accessible
399
+ - Check authentication credentials
400
+ - For SSL issues, try setting `NODE_TLS_REJECT_UNAUTHORIZED=0`
401
+
402
+ #### Claude Desktop not detecting the server
403
+
404
+ - Restart Claude Desktop after config changes
405
+ - Check config file syntax with a JSON validator
406
+ - Verify environment variables are set correctly
407
+
408
+ ---
409
+
410
+ ## Example Queries
411
+
412
+ ### Basic Queries
413
+
414
+ - "What is the status of my Kibana server?"
415
+ - "What is the status of my Kibana server in the 'marketing' space?"
416
+ - "List all available Kibana spaces I can access."
417
+ - "List all available Kibana API endpoints."
418
+ - "Show details for the POST /api/saved_objects/_find endpoint."
419
+ - "Execute a custom API request for /api/status."
420
+
421
+ ### Saved Objects Management
422
+
423
+ - "Search for all dashboards in Kibana"
424
+ - "Find visualizations containing 'nginx' in the title"
425
+ - "Get dashboard with ID 'my-dashboard-123'"
426
+ - "Create a new dashboard with title 'Sales Overview'"
427
+ - "Update the description of visualization 'viz-456'"
428
+ - "Delete multiple old dashboards by their IDs"
429
+ - "Search for lens visualizations in the 'analytics' space"
430
+ - "Find all canvas workpads created this month"
431
+ - "Get the first 10 index patterns with only title and description fields"
432
+ - "Bulk update multiple dashboard titles"
433
+ - "Search across multiple object types: dashboards and visualizations"
434
+ - "Create a new index pattern for 'logs-*' with timestamp field"
435
+
436
+ ---
437
+
438
+ ## Two Prompt Modes in Claude Desktop
439
+
440
+ When using this server with Claude Desktop, two different prompt interaction modes are supported:
441
+
442
+ ### 1. Tool-based Prompt Mode
443
+
444
+ - **How it works:** Claude Desktop can directly call server tools (including base tools like `get_status`, `execute_api`, and VL tools like `vl_search_saved_objects`, `vl_create_saved_object`) to answer your questions or perform actions.
445
+ - **Best for:** Users who want a conversational, guided experience. The server will automatically search, execute, and explain Kibana APIs and manage saved objects.
446
+ - **Example:** "Show all dashboards containing 'sales'" or "Create a new visualization for web analytics"
447
+ - **Testing tip:** Select the `kibana-tool-expert` prompt in Claude Desktop for integration testing, then start using it.
448
+
449
+ ### 2. Resource-based Prompt Mode
450
+
451
+ - **How it works:** Claude Desktop interacts with the server via resource URIs (such as `kibana-api://paths` or `kibana-api://path/GET/%2Fapi%2Fstatus`), and the server returns structured data for Claude to parse.
452
+ - **Best for:** Advanced users, MCP clients that only support resource access, or programming scenarios needing raw API metadata.
453
+ - **Example:** "Get resource kibana-api://paths?search=dashboard"
454
+
455
+ **Note:** The two endpoints in `resources` (`kibana-api://paths` and `kibana-api://path/{method}/{encoded_path}`) have corresponding base tools (`list_all_kibana_api_paths`, `get_kibana_api_detail`). This design ensures compatibility with MCP clients that cannot intelligently select multiple resources, making it easier for tools like Claude Desktop to interact with Kibana.
456
+
457
+ **Tip:** Most users are recommended to use tool mode for a more natural and powerful experience; resource mode offers maximum flexibility for advanced and compatibility use cases.
458
+
459
+ ---
460
+
461
+ ## Development
462
+
463
+ Install dependencies:
464
+
465
+ ```bash
466
+ npm install
467
+ ```
468
+
469
+ Build the server:
470
+
471
+ ```bash
472
+ npm run build
473
+ ```
474
+
475
+ Auto-rebuild in development mode:
476
+
477
+ ```bash
478
+ npm run watch
479
+ ```
480
+
481
+ Run in different modes:
482
+
483
+ ```bash
484
+ # Stdio mode (default)
485
+ npm start
486
+
487
+ # HTTP mode
488
+ npm run start:http
489
+
490
+ # Development with TypeScript
491
+ npm run start:ts
492
+
493
+ # HTTP mode with TypeScript
494
+ npm run start:http:ts
495
+ ```
496
+
497
+ ---
498
+
499
+ ## Debugging
500
+
501
+ Since the MCP server communicates via stdio, debugging can be inconvenient. It is recommended to use MCP Inspector:
502
+
503
+ ```bash
504
+ npm run inspector
505
+ ```
506
+
507
+ After starting, Inspector will provide a browser-accessible debugging tool URL.
508
+
509
+ ---
510
+
511
+ ## Community
512
+
513
+ This project is community-maintained. Contributions and feedback are welcome! Please be respectful and inclusive in all communications, and follow the [Elastic Community Code of Conduct](https://www.elastic.co/community/codeofconduct).
514
+
515
+ ---
516
+
517
+ ## License
518
+
519
+ This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.
520
+
521
+ ---
522
+
523
+ ## Troubleshooting
524
+
525
+ - Check if MCP configuration is correct
526
+ - Ensure the Kibana address is accessible
527
+ - Verify authentication credentials have sufficient permissions
528
+ - If using a custom CA, ensure the certificate path is correct and readable
529
+ - If using `NODE_TLS_REJECT_UNAUTHORIZED=0`, be aware of security risks
530
+ - Check error messages output in the terminal
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { ServerCreationOptions } from "./src/types.js";
4
+ export declare function createKibanaMcpServer(options: ServerCreationOptions): Promise<McpServer>;