@havesomecode/kibana-mcp-server 1.3.1 → 1.4.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.
- package/README.md +58 -487
- package/dist/src/bin/kibana-mcp-server.d.ts +2 -0
- package/dist/src/bin/run_cli.d.ts +4 -0
- package/dist/src/bin/run_cli.js +1 -1
- package/dist/src/commands/context.d.ts +18 -0
- package/dist/src/commands/serve.d.ts +4 -0
- package/dist/src/commands/serve.js +30 -6
- package/dist/src/commands/setup.d.ts +3 -0
- package/dist/src/commands/setup.js +2 -2
- package/dist/src/config/config_file.d.ts +59 -0
- package/dist/src/config/config_file.js +76 -0
- package/dist/src/config/environment.d.ts +100 -0
- package/dist/src/{config.js → config/environment.js} +26 -24
- package/dist/src/config/startup.d.ts +31 -0
- package/dist/src/config/startup.js +86 -0
- package/dist/src/kibana/client.d.ts +28 -0
- package/dist/src/kibana/schema_catalog.d.ts +11 -0
- package/dist/src/{schema_catalog.js → kibana/schema_catalog.js} +33 -11
- package/dist/src/kibana/source_catalog.d.ts +10 -0
- package/dist/src/mcp_entry.d.ts +2 -0
- package/dist/src/mcp_entry.js +2 -5
- package/dist/src/profiles/context.d.ts +4 -0
- package/dist/src/profiles/context.js +15 -0
- package/dist/src/profiles/names.d.ts +10 -0
- package/dist/src/profiles/names.js +35 -0
- package/dist/src/profiles/paths.d.ts +9 -0
- package/dist/src/profiles/runtime.d.ts +43 -0
- package/dist/src/profiles/runtime.js +150 -0
- package/dist/src/profiles/secret_store.d.ts +20 -0
- package/dist/src/profiles/state_lock.d.ts +13 -0
- package/dist/src/{state_lock.js → profiles/state_lock.js} +14 -5
- package/dist/src/profiles/store.d.ts +34 -0
- package/dist/src/{profile_store.js → profiles/store.js} +7 -5
- package/dist/src/query/compiler.d.ts +9 -0
- package/dist/src/query/cursor.d.ts +8 -0
- package/dist/src/query/normalize.d.ts +2 -0
- package/dist/src/server.d.ts +29 -0
- package/dist/src/server.js +40 -50
- package/dist/src/setup/bootstrap.d.ts +50 -0
- package/dist/src/{bootstrap.js → setup/bootstrap.js} +10 -36
- package/dist/src/setup/client_registration.d.ts +38 -0
- package/dist/src/setup/setup_flow.d.ts +26 -0
- package/dist/src/{setup_flow.js → setup/setup_flow.js} +6 -6
- package/dist/src/stores/catalog_store.d.ts +38 -0
- package/dist/src/stores/catalog_store.js +22 -0
- package/dist/src/stores/file.d.ts +5 -0
- package/dist/src/stores/file.js +48 -0
- package/dist/src/stores/ioredis.d.ts +21 -0
- package/dist/src/stores/ioredis.js +33 -0
- package/dist/src/stores/mongodb.d.ts +42 -0
- package/dist/src/stores/mongodb.js +57 -0
- package/dist/src/stores/postgres.d.ts +24 -0
- package/dist/src/stores/postgres.js +65 -0
- package/dist/src/stores/redis.d.ts +24 -0
- package/dist/src/stores/redis.js +31 -0
- package/dist/src/stores/shared.d.ts +25 -0
- package/dist/src/stores/shared.js +88 -0
- package/dist/src/stores/sqlite.d.ts +26 -0
- package/dist/src/stores/sqlite.js +63 -0
- package/dist/src/tools/configure.d.ts +59 -0
- package/dist/src/tools/configure.js +1 -1
- package/dist/src/tools/configure_index.d.ts +35 -0
- package/dist/src/tools/configure_index.js +75 -66
- package/dist/src/tools/describe_fields.d.ts +29 -0
- package/dist/src/tools/discover.d.ts +27 -0
- package/dist/src/tools/filter.d.ts +180 -0
- package/dist/src/tools/query.d.ts +181 -0
- package/dist/src/transports/http.d.ts +15 -0
- package/dist/src/transports/http.js +291 -0
- package/dist/src/transports/stdio.d.ts +1 -0
- package/dist/src/transports/stdio.js +46 -0
- package/dist/src/types.d.ts +254 -0
- package/dist/src/utils/cli_io.d.ts +11 -0
- package/dist/src/utils/cli_prompts.d.ts +9 -0
- package/dist/src/utils/cli_ui.d.ts +6 -0
- package/dist/src/utils/fs.d.ts +3 -0
- package/dist/src/utils/fs.js +30 -0
- package/package.json +63 -2
- package/plugins/kibana-log-investigation/.mcp.json +3 -2
- package/plugins/kibana-log-investigation/dist/LICENSE +21 -0
- package/plugins/kibana-log-investigation/dist/THIRD_PARTY_NOTICES.md +617 -0
- package/plugins/kibana-log-investigation/dist/mcp_entry.mjs +32046 -0
- package/plugins/kibana-log-investigation/dist/mcp_entry.mjs.LEGAL.txt +8 -0
- package/plugins/kibana-log-investigation/mcp-launcher.mjs +26 -0
- package/plugins/kibana-log-investigation/skills/ensure-node-runtime/SKILL.md +118 -0
- package/plugins/kibana-log-investigation/skills/install-and-configure/SKILL.md +55 -0
- package/skills/kibana-log-investigation/SKILL.md +48 -5
- package/dist/src/mcp_runtime.js +0 -23
- /package/dist/src/{kibana_client.js → kibana/client.js} +0 -0
- /package/dist/src/{source_catalog.js → kibana/source_catalog.js} +0 -0
- /package/dist/src/{profile_paths.js → profiles/paths.js} +0 -0
- /package/dist/src/{secret_store.js → profiles/secret_store.js} +0 -0
- /package/dist/src/{client_registration.js → setup/client_registration.js} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
|
|
5
|
+
const bundle = new URL("./dist/mcp_entry.mjs", import.meta.url);
|
|
6
|
+
|
|
7
|
+
if (Number(process.versions.node.split(".")[0]) < 22) {
|
|
8
|
+
console.error("Kibana MCP requires Node.js 22 or newer. Update Node.js before restarting Codex.");
|
|
9
|
+
process.exitCode = 1;
|
|
10
|
+
} else if (!existsSync(bundle)) {
|
|
11
|
+
console.error(
|
|
12
|
+
"Kibana MCP plugin runtime is missing. Run npm ci and npm run build in the source checkout, " +
|
|
13
|
+
"then reinstall the built plugin into Codex. Opening another discussion cannot repair this installation.",
|
|
14
|
+
);
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
} else {
|
|
17
|
+
try {
|
|
18
|
+
await import(bundle.href);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
const code = typeof error?.code === "string" ? error.code : "STARTUP_ERROR";
|
|
21
|
+
console.error(
|
|
22
|
+
`Kibana MCP plugin could not load (${code}). Rebuild and reinstall the plugin; inspect sanitized startup stderr if the failure persists. Do not share credentials.`,
|
|
23
|
+
);
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ensure-node-runtime
|
|
3
|
+
description: Ensure Node.js 22+ is available for this repo using a user-level install path on Windows, macOS, or Linux.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ensure Node Runtime
|
|
7
|
+
|
|
8
|
+
Use this skill when the repository has been cloned locally and Codex needs to make sure Node.js is available before building or running the Kibana MCP server.
|
|
9
|
+
|
|
10
|
+
This skill prefers user-level installation paths and avoids system-wide package installs.
|
|
11
|
+
|
|
12
|
+
## Goals
|
|
13
|
+
|
|
14
|
+
- detect whether `node` and `npm` are already usable
|
|
15
|
+
- install Node.js 22+ at user scope when missing
|
|
16
|
+
- choose commands based on the current operating system and shell
|
|
17
|
+
- verify the runtime before continuing with repo setup
|
|
18
|
+
|
|
19
|
+
## Detection
|
|
20
|
+
|
|
21
|
+
1. Check whether `node` and `npm` are already present:
|
|
22
|
+
- `node --version`
|
|
23
|
+
- `npm --version`
|
|
24
|
+
2. If `node` is present and major version is `22` or newer, stop here.
|
|
25
|
+
3. Otherwise install a user-level Node version manager, then install Node.js `22`.
|
|
26
|
+
|
|
27
|
+
## Preferred cross-platform strategy
|
|
28
|
+
|
|
29
|
+
Use `fnm` as the default version manager because it works on Windows, macOS, and Linux and supports shell auto-configuration.
|
|
30
|
+
|
|
31
|
+
The repo pins the desired major in `.node-version`, so after `fnm` is installed you can use either:
|
|
32
|
+
|
|
33
|
+
- `fnm install 22 && fnm default 22`
|
|
34
|
+
- or `fnm use --install-if-missing`
|
|
35
|
+
|
|
36
|
+
## Windows
|
|
37
|
+
|
|
38
|
+
Prefer a PowerShell-first install path.
|
|
39
|
+
|
|
40
|
+
Use `winget` when it is available. If it is blocked or unavailable, fall back to the official `fnm` release binary extracted into the user's home directory.
|
|
41
|
+
|
|
42
|
+
Reference basis:
|
|
43
|
+
|
|
44
|
+
- `fnm` officially documents Windows installation via `winget`
|
|
45
|
+
- `fnm` also supports installation from a release binary on Windows
|
|
46
|
+
- PowerShell profile setup is the standard way to enable `fnm` in Windows shells
|
|
47
|
+
|
|
48
|
+
### Recommended flow
|
|
49
|
+
|
|
50
|
+
1. If `fnm` already exists, skip to Node installation.
|
|
51
|
+
2. If `winget` is available:
|
|
52
|
+
- `winget install Schniz.fnm`
|
|
53
|
+
3. If `winget` is not available or is blocked:
|
|
54
|
+
- download the latest Windows `fnm` release binary from the official GitHub releases page
|
|
55
|
+
- extract it into a user-level directory such as `%USERPROFILE%\\.local\\bin\\fnm` or `%USERPROFILE%\\.fnm\\bin`
|
|
56
|
+
- add that directory to the user PATH in PowerShell
|
|
57
|
+
4. Configure the current PowerShell session:
|
|
58
|
+
- `fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression`
|
|
59
|
+
5. Persist shell integration for future PowerShell sessions:
|
|
60
|
+
- create `$PROFILE` if needed
|
|
61
|
+
- append `fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression` to `$PROFILE` if it is not already present
|
|
62
|
+
6. Install and select Node.js 22:
|
|
63
|
+
- `fnm install 22`
|
|
64
|
+
- `fnm default 22`
|
|
65
|
+
|
|
66
|
+
## macOS
|
|
67
|
+
|
|
68
|
+
Prefer a user-level `fnm` install using the official install script.
|
|
69
|
+
|
|
70
|
+
### Recommended flow
|
|
71
|
+
|
|
72
|
+
1. If `fnm` is missing:
|
|
73
|
+
- `curl -fsSL https://fnm.vercel.app/install | bash`
|
|
74
|
+
2. Configure the current shell:
|
|
75
|
+
- bash/zsh: `eval "$(fnm env --use-on-cd)"`
|
|
76
|
+
- fish: `fnm env --use-on-cd | source`
|
|
77
|
+
3. Persist shell integration:
|
|
78
|
+
- bash: add `eval "$(fnm env --use-on-cd)"` to `~/.bashrc`
|
|
79
|
+
- zsh: add `eval "$(fnm env --use-on-cd)"` to `~/.zshrc`
|
|
80
|
+
- fish: add `fnm env --use-on-cd | source` to `~/.config/fish/config.fish`
|
|
81
|
+
4. Install and select Node.js 22:
|
|
82
|
+
- `fnm install 22`
|
|
83
|
+
- `fnm default 22`
|
|
84
|
+
|
|
85
|
+
## Linux
|
|
86
|
+
|
|
87
|
+
Use the same user-level `fnm` flow as macOS.
|
|
88
|
+
|
|
89
|
+
### Recommended flow
|
|
90
|
+
|
|
91
|
+
1. If `fnm` is missing:
|
|
92
|
+
- `curl -fsSL https://fnm.vercel.app/install | bash`
|
|
93
|
+
2. Configure and persist shell integration for the active shell:
|
|
94
|
+
- bash: `eval "$(fnm env --use-on-cd)"` plus `~/.bashrc`
|
|
95
|
+
- zsh: `eval "$(fnm env --use-on-cd)"` plus `~/.zshrc`
|
|
96
|
+
- fish: `fnm env --use-on-cd | source` plus `~/.config/fish/config.fish`
|
|
97
|
+
3. Install and select Node.js 22:
|
|
98
|
+
- `fnm install 22`
|
|
99
|
+
- `fnm default 22`
|
|
100
|
+
|
|
101
|
+
## Verification
|
|
102
|
+
|
|
103
|
+
After installation, verify all of:
|
|
104
|
+
|
|
105
|
+
- `fnm --version`
|
|
106
|
+
- `node --version`
|
|
107
|
+
- `npm --version`
|
|
108
|
+
|
|
109
|
+
The resulting `node --version` must report major `22` or higher.
|
|
110
|
+
|
|
111
|
+
## Notes
|
|
112
|
+
|
|
113
|
+
- Prefer user-level installs over admin installs.
|
|
114
|
+
- On Windows, prefer PowerShell-native flows and avoid assuming Scoop is available.
|
|
115
|
+
- If the current shell cannot pick up the new PATH cleanly, restart the terminal or restart Codex after installation.
|
|
116
|
+
- Once Node is available, continue with:
|
|
117
|
+
- `npm install`
|
|
118
|
+
- `npm run build`
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: install-and-configure
|
|
3
|
+
description: Install the repo plugin with connection-only bootstrap.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Install and Configure
|
|
7
|
+
|
|
8
|
+
Use this skill only when the repository has been cloned locally and Codex needs the repo-scoped plugin. For public installs, use the canonical `skills/kibana-log-investigation` skill and the published npm package instead.
|
|
9
|
+
|
|
10
|
+
## Version-matched README handoff
|
|
11
|
+
|
|
12
|
+
Resolve the selected branch or tag to the full installation commit SHA before following installation instructions. Read the README at this immutable URL:
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
https://raw.githubusercontent.com/Havesomecode/kibana-mcp-server/<resolved-commit>/README.md
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Branch and tag names are resolution inputs, not final handoff URLs. Use `INSTALL.md` and skills from the same resolved installation commit. Do not infer a Git tag from an npm version or silently fall back to master. Detached installs use `git rev-parse HEAD`'s full commit SHA.
|
|
19
|
+
|
|
20
|
+
From a maintained repository root containing the helper, run `node scripts/readme-handoff.mjs <resolved-installation-ref>`. Include its verified `url` and `commit` in agent handoffs. The helper resolves local refs and verifies the downloaded README against the selected Git object. Unknown refs, missing READMEs, or retrieval/content verification failures must be reported instead of presenting another version's instructions. The helper is repository-only; historical installations without it require explicit ref resolution and README retrieval verification.
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
1. Ensure Node.js 22+ is available. Use `ensure-node-runtime` when needed.
|
|
25
|
+
2. From the repository root:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install
|
|
29
|
+
npm run build
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
3. Confirm the build produced `plugins/kibana-log-investigation/dist/mcp_entry.mjs`. Install `Kibana Log Investigation` from the repo-local Codex marketplace only after building. The built plugin includes runtime dependencies and launches from its installed directory, not the checkout.
|
|
33
|
+
4. Restart Codex if the plugin directory does not refresh automatically.
|
|
34
|
+
5. Resolve the Kibana connection through `KIBANA_BASE_URL`, `KIBANA_USERNAME`, and `KIBANA_PASSWORD`, or safe CLI alternatives.
|
|
35
|
+
6. Bootstrap only the connection, without registering a duplicate global MCP:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
node dist/src/bin/kibana-mcp-server.js bootstrap --client none
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
7. Confirm bootstrap reports an empty source catalog. It must not inspect or configure indexes.
|
|
42
|
+
8. In a fresh Codex session, call `discover`. When it reports no sources, ask the operator which exact index or index pattern to configure.
|
|
43
|
+
9. Only after the operator answers, call `configure_index` with exactly that value. Then run `discover` again.
|
|
44
|
+
|
|
45
|
+
## Rules
|
|
46
|
+
|
|
47
|
+
- Do not edit client configuration files.
|
|
48
|
+
- Separate saved configuration, process startup, tools in the current discussion, and real backend access. If startup fails, inspect sanitized stderr and repair/reinstall the plugin before requesting another discussion. Run `npm run verify:entrypoint` for the isolated packaged-plugin handshake; it is not a native Codex or real-backend check.
|
|
49
|
+
- Do not use the bundled example catalog unless the operator explicitly requests example data.
|
|
50
|
+
- Do not put passwords in command arguments or summaries.
|
|
51
|
+
- Do not guess, enumerate, scan, or auto-select Kibana indexes.
|
|
52
|
+
- Do not call `configure_index` until the operator explicitly names the index or pattern.
|
|
53
|
+
- Use `--profile NAME` for additional environments.
|
|
54
|
+
- Use `serve --profile NAME` when invoking a non-default profile outside the repo plugin.
|
|
55
|
+
- `KIBANA_BASE_URL` is a base prefix. Do not append `/internal/search/es`.
|
|
@@ -7,34 +7,75 @@ description: Bootstrap and use the Kibana log investigation MCP safely.
|
|
|
7
7
|
|
|
8
8
|
Use this skill when an operator wants to install, configure, or use the read-only Kibana MCP server from `@havesomecode/kibana-mcp-server`.
|
|
9
9
|
|
|
10
|
+
## Version-matched installation instructions
|
|
11
|
+
|
|
12
|
+
Before installing or generating a handoff, resolve the selected branch, tag, or package metadata to the full installation commit SHA. Read `README.md` at this immutable URL:
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
https://raw.githubusercontent.com/Havesomecode/kibana-mcp-server/<resolved-commit>/README.md
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Branch and tag names are resolution inputs, not final handoff URLs. Read `INSTALL.md` and skills from the same resolved installation commit. Do not infer a Git tag from an npm version. Resolve the exact npm package's `gitHead` instead, or report missing metadata; pin the package installation to the same exact version. Never silently fall back to master if the ref or README is missing or retrieval fails.
|
|
19
|
+
|
|
20
|
+
In a maintained clone with the repository-only helper, run `node scripts/readme-handoff.mjs <resolved-installation-ref>` and use its verified `url` and `commit` in the handoff. The helper checks the retrieved README against that Git commit before output. It is not an npm command and need not exist in historical tags. If unavailable, resolve the selected ref and validate its raw README explicitly; do not invent successful retrieval. See `INSTALL.md`'s version-matched handoff section.
|
|
21
|
+
|
|
10
22
|
## Connection-only installation
|
|
11
23
|
|
|
12
|
-
Do not edit Codex or MCP configuration files by hand. Bootstrap establishes only the Kibana connection and an empty managed source catalog. It must not list, scan, infer, or configure indexes.
|
|
24
|
+
Do not edit Codex, Claude Code, or other MCP configuration files by hand. Bootstrap establishes only the Kibana connection and an empty managed source catalog. It must not list, scan, infer, or configure indexes.
|
|
13
25
|
|
|
14
26
|
1. Verify Node.js 22 or newer is available.
|
|
15
27
|
2. Resolve connection values from `KIBANA_BASE_URL`, `KIBANA_USERNAME`, and `KIBANA_PASSWORD`, unless the operator supplied safe alternatives.
|
|
16
|
-
3.
|
|
28
|
+
3. Choose the client mode for the agent you are running in (see below).
|
|
29
|
+
4. Run the prompt-free bootstrap with that mode.
|
|
30
|
+
|
|
31
|
+
### Choosing the client mode
|
|
32
|
+
|
|
33
|
+
Bootstrap can register the MCP server itself only in Codex. Everywhere else the server is registered by a plugin or by the operator, and bootstrap must only save the connection.
|
|
34
|
+
|
|
35
|
+
| You are running in | The MCP server is registered by | Client mode |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| Codex | bootstrap | `--client codex` |
|
|
38
|
+
| Claude Code | the `kibana-log-investigation` plugin | `--client none` |
|
|
39
|
+
| Any other agent | the operator's MCP configuration | `--client none` |
|
|
40
|
+
|
|
41
|
+
Codex:
|
|
17
42
|
|
|
18
43
|
```bash
|
|
19
44
|
npx -y @havesomecode/kibana-mcp-server bootstrap \
|
|
20
45
|
--client codex
|
|
21
46
|
```
|
|
22
47
|
|
|
48
|
+
Claude Code and other agents:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx -y @havesomecode/kibana-mcp-server bootstrap \
|
|
52
|
+
--client none
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If you are not running in Codex and the tools of this server (`discover`, `configure_index`) are not available in the session, the server is not registered. Do not write MCP configuration yourself. Ask the operator to register it:
|
|
56
|
+
|
|
57
|
+
- in Claude Code, by installing the plugin: `/plugin marketplace add Havesomecode/kibana-mcp-server`, then `/plugin install kibana-log-investigation@kibana-mcp-server`;
|
|
58
|
+
- in any other agent, by declaring the stdio command `npx -y @havesomecode/kibana-mcp-server serve` in its MCP configuration.
|
|
59
|
+
|
|
60
|
+
With `--client none`, a server that was already running when bootstrap completed still has no connection. Ask the operator to reconnect the MCP server or start a new session before calling its tools.
|
|
61
|
+
|
|
62
|
+
### What bootstrap does
|
|
63
|
+
|
|
23
64
|
Bootstrap must:
|
|
24
65
|
|
|
25
66
|
- validate the Kibana base URL and verify the connection through Kibana status only
|
|
26
67
|
- write an empty managed catalog on first install
|
|
27
68
|
- preserve previously and explicitly configured generated sources on idempotent reruns
|
|
28
69
|
- save credentials in the operating-system credential store
|
|
29
|
-
- register the exact, version-pinned stdio command under a transport-hashed Codex name
|
|
30
|
-
-
|
|
70
|
+
- with `--client codex`, register the exact, version-pinned stdio command under a transport-hashed Codex name, read the registration back, and reject conflicting entries
|
|
71
|
+
- with `--client none`, leave every MCP client configuration untouched
|
|
31
72
|
- restore prior profile state if registration fails
|
|
32
73
|
|
|
33
74
|
A successful command verifies installation, not an index. Do not claim an index is usable until the explicit configuration flow below succeeds.
|
|
34
75
|
|
|
35
76
|
## Supplying secrets safely
|
|
36
77
|
|
|
37
|
-
Never put a password directly in a command argument. Prefer a pre-provisioned `KIBANA_PASSWORD` environment variable. When a secret is available on stdin, use:
|
|
78
|
+
Never put a password directly in a command argument. Prefer a pre-provisioned `KIBANA_PASSWORD` environment variable. The examples below use `--client codex`; substitute the client mode chosen above. When a secret is available on stdin, use:
|
|
38
79
|
|
|
39
80
|
```bash
|
|
40
81
|
printf '%s\n' "$SECRET_VALUE" | npx -y @havesomecode/kibana-mcp-server bootstrap \
|
|
@@ -86,6 +127,8 @@ npx -y @havesomecode/kibana-mcp-server serve --profile prod
|
|
|
86
127
|
- Never call `configure_index` until the user explicitly names the index or pattern.
|
|
87
128
|
- Never add `--replace` merely to make a failed install pass. It intentionally replaces an existing catalog with an empty managed catalog.
|
|
88
129
|
- Never overwrite a conflicting MCP client registration.
|
|
130
|
+
- Never write or edit an MCP client configuration file to register the server; only bootstrap in Codex, a plugin, or the operator does that.
|
|
131
|
+
- Never use the legacy `configure` tool to supply credentials. If it is the only setup tool offered, the server has no saved connection: run bootstrap, then have the server reconnected.
|
|
89
132
|
- Never expose a password in logs, summaries, shell history, generated catalogs, or MCP client configuration.
|
|
90
133
|
- If URL, username, or password is unavailable, report the exact missing prerequisite rather than inventing it.
|
|
91
134
|
|
package/dist/src/mcp_runtime.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
2
|
-
import { NoSavedProfileError, PROFILE_NAME_ENV, loadConfigFromEnvironment } from "./config.js";
|
|
3
|
-
import { createApplication } from "./server.js";
|
|
4
|
-
function hasBootstrapConfig(env) {
|
|
5
|
-
return Boolean(env.KIBANA_BASE_URL && env.KIBANA_USERNAME && env.KIBANA_PASSWORD);
|
|
6
|
-
}
|
|
7
|
-
export async function startMcpServer(envInput = process.env) {
|
|
8
|
-
let config = undefined;
|
|
9
|
-
try {
|
|
10
|
-
config = await loadConfigFromEnvironment(envInput);
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
if (hasBootstrapConfig(envInput) || envInput[PROFILE_NAME_ENV]?.trim()) {
|
|
14
|
-
throw error;
|
|
15
|
-
}
|
|
16
|
-
if (!(error instanceof NoSavedProfileError)) {
|
|
17
|
-
throw error;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const { server } = createApplication(config);
|
|
21
|
-
const transport = new StdioServerTransport();
|
|
22
|
-
await server.connect(transport);
|
|
23
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|