@havesomecode/kibana-mcp-server 1.3.0 → 1.3.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.
@@ -1,54 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { pathToFileURL } from "node:url";
3
- import { Command, CommanderError } from "commander";
4
- import registerServeCommand from "../commands/serve.js";
5
- import registerSetupCommands from "../commands/setup.js";
6
- import { startMcpServer } from "../mcp_runtime.js";
7
- import { createCliIo } from "../utils/cli_io.js";
8
- import { createCliUi } from "../utils/cli_ui.js";
9
- export async function runCli(argv = process.argv.slice(2), overrides = {}, dependencies = {}) {
10
- const io = createCliIo(overrides);
11
- let exitCode = 0;
12
- const context = {
13
- argv,
14
- io,
15
- ui: createCliUi(io),
16
- dependencies,
17
- setExitCode: (code) => {
18
- exitCode = code;
19
- },
20
- };
21
- const program = new Command()
22
- .name("kibana-mcp-server")
23
- .description("Kibana Log Investigation")
24
- .showHelpAfterError()
25
- .exitOverride()
26
- .configureOutput({
27
- writeOut: (message) => io.stdout(message.trimEnd()),
28
- writeErr: (message) => io.stderr(message.trimEnd()),
29
- })
30
- .action(async () => {
31
- try {
32
- await (dependencies.startMcpServerFn ?? startMcpServer)(io.env);
33
- }
34
- catch (error) {
35
- context.ui.error(error instanceof Error ? error.message : String(error));
36
- exitCode = 1;
37
- }
38
- });
39
- registerSetupCommands(program, context);
40
- registerServeCommand(program, context);
41
- try {
42
- await program.parseAsync(["node", "kibana-mcp-server", ...argv], { from: "node" });
43
- }
44
- catch (error) {
45
- if (error instanceof CommanderError)
46
- return error.exitCode;
47
- io.stderr(error instanceof Error ? error.message : String(error));
48
- return 1;
49
- }
50
- return exitCode;
51
- }
52
- if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
53
- process.exitCode = await runCli();
54
- }
2
+ import { runCli } from "./run_cli.js";
3
+ process.exitCode = await runCli(process.argv);
@@ -0,0 +1,49 @@
1
+ import { Command, CommanderError } from "commander";
2
+ import registerServeCommand from "../commands/serve.js";
3
+ import registerSetupCommands from "../commands/setup.js";
4
+ import { startMcpServer } from "../mcp_runtime.js";
5
+ import { createCliIo } from "../utils/cli_io.js";
6
+ import { createCliUi } from "../utils/cli_ui.js";
7
+ export async function runCli(argv, overrides = {}, dependencies = {}) {
8
+ const io = createCliIo(overrides);
9
+ let exitCode = 0;
10
+ const context = {
11
+ argv,
12
+ io,
13
+ ui: createCliUi(io),
14
+ dependencies,
15
+ setExitCode: (code) => {
16
+ exitCode = code;
17
+ },
18
+ };
19
+ const program = new Command()
20
+ .name("kibana-mcp-server")
21
+ .description("Kibana Log Investigation")
22
+ .showHelpAfterError()
23
+ .exitOverride()
24
+ .configureOutput({
25
+ writeOut: (message) => io.stdout(message.trimEnd()),
26
+ writeErr: (message) => io.stderr(message.trimEnd()),
27
+ })
28
+ .action(async () => {
29
+ try {
30
+ await (dependencies.startMcpServerFn ?? startMcpServer)(io.env);
31
+ }
32
+ catch (error) {
33
+ context.ui.error(error instanceof Error ? error.message : String(error));
34
+ exitCode = 1;
35
+ }
36
+ });
37
+ registerSetupCommands(program, context);
38
+ registerServeCommand(program, context);
39
+ try {
40
+ await program.parseAsync(argv);
41
+ }
42
+ catch (error) {
43
+ if (error instanceof CommanderError)
44
+ return error.exitCode;
45
+ io.stderr(error instanceof Error ? error.message : String(error));
46
+ return 1;
47
+ }
48
+ return exitCode;
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@havesomecode/kibana-mcp-server",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "license": "MIT",
5
5
  "description": "Read-only MCP server for Kibana-backed log investigation and schema-aware querying",
6
6
  "homepage": "https://havesomecode.github.io/kibana-mcp-server/",