@debian777/kairos-mcp 4.8.0-pre.1 → 4.8.0-rc.0

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 (63) hide show
  1. package/README.md +45 -5
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/bootstrap.d.ts +8 -0
  4. package/dist/bootstrap.d.ts.map +1 -1
  5. package/dist/bootstrap.js +1 -1
  6. package/dist/bootstrap.js.map +1 -1
  7. package/dist/cli/commands/serve.d.ts +14 -2
  8. package/dist/cli/commands/serve.d.ts.map +1 -1
  9. package/dist/cli/commands/serve.js +148 -29
  10. package/dist/cli/commands/serve.js.map +1 -1
  11. package/dist/cli/config-file.d.ts +1 -1
  12. package/dist/cli/config-file.js +1 -1
  13. package/dist/cli/index.js +2 -2
  14. package/dist/cli/index.js.map +1 -1
  15. package/dist/config.d.ts +11 -7
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/config.js +15 -10
  18. package/dist/config.js.map +1 -1
  19. package/dist/embed-docs/mem/adapter-migration.md +1 -1
  20. package/dist/embed-docs/mem/bulk-insert-adapters-via-cli.md +1 -1
  21. package/dist/embed-docs/mem/challenge-type-guide.md +1 -1
  22. package/dist/embed-docs/mem/create-new-protocol.md +1 -1
  23. package/dist/embed-docs/mem/phase-critic-guide.md +1 -1
  24. package/dist/embed-docs/mem/phase-critic.md +1 -1
  25. package/dist/embed-docs/mem/protocol-linking-guide.md +1 -1
  26. package/dist/embed-docs/mem/refine-search.md +1 -1
  27. package/dist/embed-docs/mem/skill-format-guide.md +74 -56
  28. package/dist/http/http-server-config.js +6 -6
  29. package/dist/http/http-server-config.js.map +1 -1
  30. package/dist/http/http-server.d.ts +1 -1
  31. package/dist/http/http-server.d.ts.map +1 -1
  32. package/dist/http/http-server.js +4 -4
  33. package/dist/http/http-server.js.map +1 -1
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +52 -9
  37. package/dist/index.js.map +1 -1
  38. package/dist/resources/embedded-mcp-resources.js +9 -9
  39. package/dist/resources/embedded-mcp-resources.js.map +1 -1
  40. package/dist/services/embedding/providers.d.ts +19 -0
  41. package/dist/services/embedding/providers.d.ts.map +1 -1
  42. package/dist/services/embedding/providers.js +167 -93
  43. package/dist/services/embedding/providers.js.map +1 -1
  44. package/dist/stdio/stdio-server.d.ts +3 -0
  45. package/dist/stdio/stdio-server.d.ts.map +1 -0
  46. package/dist/stdio/stdio-server.js +12 -0
  47. package/dist/stdio/stdio-server.js.map +1 -0
  48. package/dist/tools/activate.d.ts.map +1 -1
  49. package/dist/tools/activate.js +4 -0
  50. package/dist/tools/activate.js.map +1 -1
  51. package/dist/tools/mcp-runtime-error.d.ts +19 -0
  52. package/dist/tools/mcp-runtime-error.d.ts.map +1 -0
  53. package/dist/tools/mcp-runtime-error.js +34 -0
  54. package/dist/tools/mcp-runtime-error.js.map +1 -0
  55. package/dist/tools/next-pow-helpers.d.ts.map +1 -1
  56. package/dist/tools/next-pow-helpers.js +7 -2
  57. package/dist/tools/next-pow-helpers.js.map +1 -1
  58. package/dist/tools/train.js +4 -0
  59. package/dist/tools/train.js.map +1 -1
  60. package/dist/ui/assets/{AccountPage-BakqsDwR.js → AccountPage-CgUHmQi_.js} +1 -1
  61. package/dist/ui/assets/{index-QHhNEmWe.js → index-Bp_jAFfN.js} +2 -2
  62. package/dist/ui/index.html +1 -1
  63. package/package.json +24 -10
package/README.md CHANGED
@@ -96,12 +96,30 @@ For a longer narrative, see
96
96
  The current codebase includes:
97
97
 
98
98
  - **HTTP application server** — Express app for MCP, REST, auth routes, and UI
99
+ - **stdio MCP transport** — direct local-host launch path for desktop/IDE MCP clients
99
100
  - **Qdrant-backed adapter store** — required for runtime
100
101
  - **Optional Redis cache / proof-of-work state store** — enabled when `REDIS_URL` is set
101
102
  - **Optional Keycloak auth integration** — browser session + Bearer JWT validation
102
103
  - **React UI** — served from the same origin at `/ui`
103
104
  - **CLI** — talks to the HTTP API
104
105
 
106
+ ## Transport modes
107
+
108
+ Use one transport mode per process:
109
+
110
+ **`kairos serve` / `kairos-mcp serve`** (run the MCP server from the npm package):
111
+
112
+ - **`--transport stdio|http`** overrides **`TRANSPORT_TYPE`** for that process only.
113
+ - If neither is set, **`serve` defaults to stdio** (good for local MCP hosts).
114
+ - Other **`kairos`** commands (login, train, …) do not use `--transport`; they only see
115
+ **`TRANSPORT_TYPE`** if you set it in the environment (normally leave it unset for CLI-only use).
116
+
117
+ - **`TRANSPORT_TYPE=http`**: serves `/mcp`, `/api/*`, `/ui`, and `/health`; this is
118
+ the default for Docker Compose deployments.
119
+ - **`TRANSPORT_TYPE=stdio`**: runs MCP over stdin/stdout for local hosts such as
120
+ Claude Desktop, Cursor, or Claude Code. In this mode, stdout is reserved for
121
+ MCP protocol frames and logs go to stderr.
122
+
105
123
  ## Quick start
106
124
 
107
125
  If your agent supports installable skills, start with the guided setup below.
@@ -184,7 +202,7 @@ npm run dev:deploy
184
202
 
185
203
  The dev scripts default the app to port **3300** (see `scripts/env/.env.template` and
186
204
  `scripts/deploy-run-env.sh`). The Docker minimal stack above defaults **3000** unless you
187
- set `PORT` in `.env`. Use the same host and port in health checks, the UI, and MCP
205
+ set **`SERVER_PORT`** in `.env`. Use the same host and port in health checks, the UI, and MCP
188
206
  URLs.
189
207
 
190
208
  See [docs/install/README.md](docs/install/README.md) and
@@ -193,9 +211,9 @@ See [docs/install/README.md](docs/install/README.md) and
193
211
  ### Cursor MCP (`KAIROS-DEVELOPMENT`)
194
212
 
195
213
  This repository ships [`.cursor/mcp.json`](.cursor/mcp.json) with a **streamable
196
- HTTP** entry keyed **`KAIROS-DEVELOPMENT`**, aimed at local MCP on
197
- `http://localhost:3300/mcp` (match **`npm run dev:deploy`** when `PORT=3300`).
198
- If you run the minimal Compose stack without overriding `PORT`, point MCP at
214
+ HTTP** entry keyed **`DEVELOPMENT_KAIROS`**, aimed at local MCP on
215
+ `http://localhost:3300/mcp` (match **`npm run dev:deploy`** when `SERVER_PORT=3300`).
216
+ If you run the minimal Compose stack without overriding **`SERVER_PORT`**, point MCP at
199
217
  `http://localhost:3000/mcp` instead. Cursor may show a longer **agent-visible**
200
218
  server id (for example one ending in `-KAIROS-DEVELOPMENT`); see
201
219
  [AGENTS.md](AGENTS.md) and [docs/install/README.md#cursor-and-mcp](docs/install/README.md#cursor-and-mcp).
@@ -204,6 +222,28 @@ When executing over MCP, follow **[Protocol execution](#protocol-execution)**
204
222
  above and each tool result’s `next_action`. The connected server’s tool
205
223
  descriptions are the runtime authority if they differ from this file.
206
224
 
225
+ ### Local stdio launch for desktop/IDE hosts
226
+
227
+ Use this when your host launches the server as a local process instead of
228
+ connecting over HTTP.
229
+
230
+ 1. Build the project:
231
+
232
+ ```bash
233
+ npm run build
234
+ ```
235
+
236
+ 2. Run the stdio server profile:
237
+
238
+ ```bash
239
+ npm run dev:stdio
240
+ ```
241
+
242
+ 3. Point your host at the local command:
243
+ - command: `node`
244
+ - args: `["/absolute/path/to/kairos-mcp/dist/bootstrap.js"]`
245
+ - env override: `TRANSPORT_TYPE=stdio`
246
+
207
247
  ## Installation options
208
248
 
209
249
  ### Run the server with Docker Compose
@@ -355,7 +395,7 @@ docker compose -p kairos-mcp logs app-prod
355
395
 
356
396
  Also verify that required ports are free:
357
397
 
358
- - minimal stack: app `3000` (or your `PORT`), Qdrant `6333`, metrics `9090` (or
398
+ - minimal stack: app `3000` (or your **`SERVER_PORT`**), Qdrant `6333`, metrics `9090` (or
359
399
  your `METRICS_PORT`)
360
400
  - repo dev scripts: app often `3300`, metrics often `9390` (see `.env`)
361
401
  - full stack adds: `6379`, `5432`, `8080`, `9000`