@debian777/kairos-mcp 3.3.3 → 3.4.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.
- package/README.md +179 -105
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/commands/mint.d.ts.map +1 -1
- package/dist/cli/commands/mint.js +9 -1
- package/dist/cli/commands/mint.js.map +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002001.md +124 -162
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002002.md +36 -34
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002003.md +195 -0
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002004.md +240 -0
- package/dist/embed-docs/mem/README.md +24 -0
- package/dist/resources/docs-resources.d.ts.map +1 -1
- package/dist/resources/docs-resources.js +9 -1
- package/dist/resources/docs-resources.js.map +1 -1
- package/dist/resources/embedded-mcp-resources.d.ts +14 -0
- package/dist/resources/embedded-mcp-resources.d.ts.map +1 -1
- package/dist/resources/embedded-mcp-resources.js +33 -9
- package/dist/resources/embedded-mcp-resources.js.map +1 -1
- package/dist/resources/mem-resources-boot.d.ts.map +1 -1
- package/dist/resources/mem-resources-boot.js +11 -3
- package/dist/resources/mem-resources-boot.js.map +1 -1
- package/dist/services/chain-step-count.d.ts +23 -0
- package/dist/services/chain-step-count.d.ts.map +1 -0
- package/dist/services/chain-step-count.js +23 -0
- package/dist/services/chain-step-count.js.map +1 -0
- package/dist/services/chain-utils.d.ts.map +1 -1
- package/dist/services/chain-utils.js +14 -9
- package/dist/services/chain-utils.js.map +1 -1
- package/dist/services/memory/store-methods.d.ts.map +1 -1
- package/dist/services/memory/store-methods.js +20 -12
- package/dist/services/memory/store-methods.js.map +1 -1
- package/dist/services/qdrant/memory-retrieval.d.ts +6 -1
- package/dist/services/qdrant/memory-retrieval.d.ts.map +1 -1
- package/dist/services/qdrant/memory-retrieval.js +21 -3
- package/dist/services/qdrant/memory-retrieval.js.map +1 -1
- package/dist/services/qdrant/service.d.ts +1 -1
- package/dist/services/qdrant/service.d.ts.map +1 -1
- package/dist/services/qdrant/service.js +2 -2
- package/dist/services/qdrant/service.js.map +1 -1
- package/dist/tools/kairos-challenge-display.d.ts.map +1 -1
- package/dist/tools/kairos-challenge-display.js +32 -2
- package/dist/tools/kairos-challenge-display.js.map +1 -1
- package/dist/tools/kairos_begin.d.ts +5 -0
- package/dist/tools/kairos_begin.d.ts.map +1 -1
- package/dist/tools/kairos_begin.js +8 -8
- package/dist/tools/kairos_begin.js.map +1 -1
- package/dist/tools/kairos_begin_schema.d.ts +5 -0
- package/dist/tools/kairos_begin_schema.d.ts.map +1 -1
- package/dist/tools/kairos_begin_schema.js +6 -1
- package/dist/tools/kairos_begin_schema.js.map +1 -1
- package/dist/tools/kairos_dump.js +1 -1
- package/dist/tools/kairos_dump.js.map +1 -1
- package/dist/tools/kairos_next-previous-step.d.ts.map +1 -1
- package/dist/tools/kairos_next-previous-step.js +11 -3
- package/dist/tools/kairos_next-previous-step.js.map +1 -1
- package/dist/tools/kairos_next_schema.d.ts +5 -0
- package/dist/tools/kairos_next_schema.d.ts.map +1 -1
- package/dist/tools/kairos_next_schema.js +7 -1
- package/dist/tools/kairos_next_schema.js.map +1 -1
- package/dist/tools/shell-challenge-invocation.d.ts +32 -0
- package/dist/tools/shell-challenge-invocation.d.ts.map +1 -0
- package/dist/tools/shell-challenge-invocation.js +113 -0
- package/dist/tools/shell-challenge-invocation.js.map +1 -0
- package/dist/types/memory.d.ts +10 -0
- package/dist/types/memory.d.ts.map +1 -1
- package/dist/ui/assets/{AccountPage-kxmPtqQP.js → AccountPage-BL4GHk9f.js} +1 -1
- package/dist/ui/assets/{ErrorAlert-ME7tEJ6X.js → ErrorAlert-KEgeKl22.js} +1 -1
- package/dist/ui/assets/{HomePage-DxiAsvs-.js → HomePage-DWAvtfBC.js} +1 -1
- package/dist/ui/assets/KairosPage-DZpZ35yd.js +1 -0
- package/dist/ui/assets/NotFoundPage-BrPNDuhe.js +1 -0
- package/dist/ui/assets/{ProtocolDetailPage-DKaSVepL.js → ProtocolDetailPage-R0XlRsIa.js} +1 -1
- package/dist/ui/assets/ProtocolEditPage-CzAnruE6.js +5 -0
- package/dist/ui/assets/{RenderedMarkdown-DjbuQlBl.js → RenderedMarkdown-CMavJdAJ.js} +1 -1
- package/dist/ui/assets/RunGuidedPage-Cm68aCC7.js +1 -0
- package/dist/ui/assets/{RunsPage-ctnsEF2U.js → RunsPage-DcDoMCq1.js} +1 -1
- package/dist/ui/assets/{SkillBundlePage-CaWW5oGq.js → SkillBundlePage-LuYOnVDQ.js} +1 -1
- package/dist/ui/assets/index-0G3wloMr.css +2 -0
- package/dist/ui/assets/index-S4_XWO39.js +8 -0
- package/dist/ui/assets/{tiptap-kMFBDujG.js → tiptap-CzV8H9Mb.js} +22 -22
- package/dist/ui/assets/useProtocol-C3ClZHlN.js +4 -0
- package/dist/ui/assets/{useSpaces-BV6eUjY3.js → useSpaces-DQEfGh8E.js} +1 -1
- package/dist/ui/assets/{vendor-GiUVcjs7.js → vendor-CVpIjmrD.js} +1 -1
- package/dist/ui/index.html +4 -4
- package/dist/utils/space-filter.d.ts +8 -0
- package/dist/utils/space-filter.d.ts.map +1 -1
- package/dist/utils/space-filter.js +18 -0
- package/dist/utils/space-filter.js.map +1 -1
- package/package.json +2 -1
- package/dist/ui/assets/KairosPage-BkqYs3-_.js +0 -1
- package/dist/ui/assets/NotFoundPage-DyfbQ-6G.js +0 -1
- package/dist/ui/assets/ProtocolEditPage-D-aTavvx.js +0 -1
- package/dist/ui/assets/RunGuidedPage-BUD0MaGh.js +0 -1
- package/dist/ui/assets/index-Duu55PkQ.css +0 -2
- package/dist/ui/assets/index-bQSxsGMU.js +0 -8
- package/dist/ui/assets/useProtocol-BruWpIzq.js +0 -4
package/README.md
CHANGED
|
@@ -5,171 +5,245 @@
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
|
|
8
|
-
KAIROS MCP
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
drives `next_action` at every step
|
|
21
|
-
- **Agent-facing design** — tool descriptions and error messages built for
|
|
22
|
-
programmatic consumption and recovery
|
|
23
|
-
|
|
24
|
-
Protocol execution runs in a fixed order: search for a match, begin the run,
|
|
25
|
-
solve each step’s challenge, then attest completion.
|
|
26
|
-
|
|
27
|
-
```mermaid
|
|
28
|
-
flowchart LR
|
|
29
|
-
A([search]) --> B([begin]) --> C([next]) --> D([attest])
|
|
30
|
-
C -.-> C
|
|
31
|
-
style A fill:#4a6fa5,stroke:#2d4a7a,color:#fff
|
|
32
|
-
style B fill:#4a6fa5,stroke:#2d4a7a,color:#fff
|
|
33
|
-
style C fill:#ffb74d,stroke:#f57c00,color:#333
|
|
34
|
-
style D fill:#81c784,stroke:#388e3c,color:#333
|
|
8
|
+
KAIROS MCP is a TypeScript service for storing and executing reusable protocol
|
|
9
|
+
chains for AI agents. It exposes:
|
|
10
|
+
|
|
11
|
+
- an MCP endpoint at `POST /mcp`
|
|
12
|
+
- REST endpoints under `/api/*`
|
|
13
|
+
- a browser UI under `/ui`
|
|
14
|
+
- a CLI named `kairos`
|
|
15
|
+
|
|
16
|
+
Protocol execution is deterministic:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
kairos_search -> kairos_begin -> kairos_next (loop) -> kairos_attest
|
|
35
20
|
```
|
|
36
21
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
The server generates challenge data (`nonce`, `proof_hash`, URIs); agents echo
|
|
23
|
+
those values back exactly.
|
|
24
|
+
|
|
25
|
+
## What runs in this repository
|
|
26
|
+
|
|
27
|
+
The current codebase includes:
|
|
28
|
+
|
|
29
|
+
- **HTTP application server** — Express app for MCP, REST, auth routes, and UI
|
|
30
|
+
- **Qdrant-backed protocol store** — required for runtime
|
|
31
|
+
- **Optional Redis cache / proof-of-work state store** — enabled when `REDIS_URL` is set
|
|
32
|
+
- **Optional Keycloak auth integration** — browser session + Bearer JWT validation
|
|
33
|
+
- **React UI** — served from the same origin at `/ui`
|
|
34
|
+
- **CLI** — talks to the HTTP API
|
|
40
35
|
|
|
41
36
|
## Quick start
|
|
42
37
|
|
|
43
|
-
|
|
38
|
+
### Minimal Docker stack (default)
|
|
39
|
+
|
|
40
|
+
The default Compose profile starts **Qdrant + app only**. This is the smallest
|
|
41
|
+
working server deployment.
|
|
42
|
+
|
|
43
|
+
1. Copy the minimal env example:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
cp docs/install/env.example.minimal.txt .env
|
|
47
|
+
```
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
2. Edit `.env` and set at least:
|
|
50
|
+
- `QDRANT_API_KEY`
|
|
51
|
+
- one embedding provider:
|
|
52
|
+
- `OPENAI_API_KEY`, or
|
|
53
|
+
- `OPENAI_API_URL` + `OPENAI_EMBEDDING_MODEL` + `OPENAI_API_KEY=ollama`, or
|
|
54
|
+
- `TEI_BASE_URL` (+ optional `TEI_MODEL`)
|
|
46
55
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
curl -LO https://raw.githubusercontent.com/debian777/kairos-mcp/main/docs/install/env.example.minimal.txt
|
|
51
|
-
cp env.example.minimal.txt .env
|
|
52
|
-
```
|
|
53
|
-
2. Set your embedding provider in `.env`: `OPENAI_API_KEY=sk-proj-...` (OpenAI), or [Ollama](docs/install/README.md#optional--ollama-local-embeddings) (local), or TEI. Also set `QDRANT_API_KEY`. The minimal example already pins `AUTH_ENABLED=false` so it remains a no-auth setup.
|
|
54
|
-
3. Start the stack (from the directory that has `compose.yaml` and `.env`):
|
|
55
|
-
```bash
|
|
56
|
+
3. Start the stack:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
56
59
|
docker compose -p kairos-mcp up -d
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
4.
|
|
60
|
-
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
4. Verify the server:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
61
65
|
curl http://localhost:3000/health
|
|
62
|
-
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
5. Open the UI or MCP endpoint:
|
|
69
|
+
- UI: `http://localhost:3000/ui`
|
|
70
|
+
- MCP: `http://localhost:3000/mcp`
|
|
71
|
+
- Metrics: `http://localhost:9090/metrics`
|
|
63
72
|
|
|
64
|
-
|
|
73
|
+
### Full stack (Redis + Postgres + Keycloak)
|
|
74
|
+
|
|
75
|
+
For local auth-enabled development, copy the fullstack env example and start
|
|
76
|
+
the `fullstack` profile:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
cp docs/install/env.example.fullstack.txt .env
|
|
80
|
+
docker compose -p kairos-mcp --profile fullstack up -d
|
|
81
|
+
```
|
|
65
82
|
|
|
66
|
-
|
|
83
|
+
If you want the repo’s full local development flow, use the documented scripts:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm ci
|
|
87
|
+
npm run infra:up
|
|
88
|
+
npm run dev:deploy
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
See [docs/install/README.md](docs/install/README.md) and
|
|
92
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) for the exact env variables and dev workflow.
|
|
93
|
+
|
|
94
|
+
## Installation options
|
|
95
|
+
|
|
96
|
+
### Run the server with Docker Compose
|
|
97
|
+
|
|
98
|
+
Use the Compose quick start above. This repository ships `compose.yaml`,
|
|
99
|
+
minimal and fullstack env examples, and the scripts used for local development
|
|
100
|
+
and CI.
|
|
101
|
+
|
|
102
|
+
### Install the CLI
|
|
67
103
|
|
|
68
|
-
- **Docker Compose (recommended)** — minimal (Qdrant + app) by default, or
|
|
69
|
-
full stack with Redis and Keycloak; see the quick start above.
|
|
70
|
-
- **npm (CLI only)** — run the `kairos` CLI without installing, or install globally.
|
|
71
104
|
Node.js 25 or later is required.
|
|
72
|
-
```bash
|
|
73
|
-
npx @debian777/kairos-mcp
|
|
74
|
-
```
|
|
75
|
-
Or install globally: `npm install -g @debian777/kairos-mcp` then run `kairos`.
|
|
76
|
-
Pre-release: `npm install -g @debian777/kairos-mcp@3.2.0-pre.2` (or latest `*-pre.*` on [npm](https://www.npmjs.com/package/@debian777/kairos-mcp?activeTab=versions)). Use `--install-links` to install link dependencies as real packages.
|
|
77
|
-
See [KAIROS CLI](docs/CLI.md) for usage.
|
|
78
|
-
- **Update your agent instructions (recommended):** Add the KAIROS intro to your project’s **AGENTS.md** (or your IDE’s rules) so agents follow the protocol. Example to copy or adapt:
|
|
79
105
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
106
|
+
Run once without installing globally:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npx @debian777/kairos-mcp --help
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Or install globally:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm install -g @debian777/kairos-mcp
|
|
116
|
+
kairos --help
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The CLI talks to a running KAIROS server over HTTP. See [docs/CLI.md](docs/CLI.md).
|
|
87
120
|
|
|
121
|
+
### Add KAIROS to your agent instructions
|
|
88
122
|
|
|
123
|
+
If you want agents to use KAIROS consistently, add a short repo rule or
|
|
124
|
+
instruction such as:
|
|
89
125
|
|
|
90
|
-
|
|
91
|
-
|
|
126
|
+
> KAIROS MCP is a Model Context Protocol server for persistent memory and
|
|
127
|
+
> deterministic protocol-chain execution. Execute protocols in this order:
|
|
128
|
+
> `kairos_search` -> `kairos_begin` -> `kairos_next` until told to call
|
|
129
|
+
> `kairos_attest`. Echo all server-generated hashes, nonces, and URIs exactly.
|
|
92
130
|
|
|
93
|
-
|
|
131
|
+
## Agent skills shipped in this repo
|
|
94
132
|
|
|
95
|
-
This
|
|
133
|
+
This repository currently ships three installable skills:
|
|
96
134
|
|
|
97
|
-
|
|
135
|
+
| Skill | Purpose |
|
|
136
|
+
|-------|---------|
|
|
137
|
+
| `kairos` | Run KAIROS protocols |
|
|
138
|
+
| `kairos-bundle` | Export and import protocol bundles |
|
|
139
|
+
| `kairos-install` | First-time local setup guidance |
|
|
140
|
+
|
|
141
|
+
Install all shipped skills:
|
|
98
142
|
|
|
99
143
|
```bash
|
|
100
144
|
npx skills add debian777/kairos-mcp
|
|
101
145
|
```
|
|
102
146
|
|
|
103
|
-
|
|
147
|
+
Install one specific skill:
|
|
104
148
|
|
|
105
149
|
```bash
|
|
106
150
|
npx skills add debian777/kairos-mcp --skill kairos
|
|
107
151
|
```
|
|
108
152
|
|
|
109
|
-
List
|
|
153
|
+
List available skills:
|
|
110
154
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
155
|
+
```bash
|
|
156
|
+
npx skills add debian777/kairos-mcp --list
|
|
157
|
+
```
|
|
114
158
|
|
|
115
|
-
|
|
159
|
+
Popular global installs:
|
|
116
160
|
|
|
117
161
|
| Agents | Command |
|
|
118
162
|
|--------|---------|
|
|
119
163
|
| Cursor | `npx skills add debian777/kairos-mcp -y -g -a cursor` |
|
|
120
164
|
| Claude Code | `npx skills add debian777/kairos-mcp -y -g -a claude-code` |
|
|
121
165
|
| Cursor + Claude Code | `npx skills add debian777/kairos-mcp -y -g -a cursor -a claude-code` |
|
|
122
|
-
| All detected agents | `npx skills add debian777/kairos-mcp -y -g`
|
|
166
|
+
| All detected agents | `npx skills add debian777/kairos-mcp -y -g` |
|
|
123
167
|
|
|
124
|
-
|
|
168
|
+
More detail: [skills/README.md](skills/README.md)
|
|
125
169
|
|
|
126
|
-
|
|
170
|
+
## Documentation map
|
|
171
|
+
|
|
172
|
+
- [Documentation index](docs/README.md)
|
|
173
|
+
- [Install and environment](docs/install/README.md)
|
|
174
|
+
- [Install KAIROS MCP in Cursor](docs/INSTALL-MCP.md)
|
|
175
|
+
- [CLI reference](docs/CLI.md)
|
|
176
|
+
- [Architecture](docs/architecture/README.md)
|
|
177
|
+
- [Protocol examples](docs/examples/README.md)
|
|
178
|
+
- [Contributing](CONTRIBUTING.md)
|
|
179
|
+
|
|
180
|
+
## Troubleshooting
|
|
181
|
+
|
|
182
|
+
### The server does not start
|
|
183
|
+
|
|
184
|
+
Check container logs:
|
|
127
185
|
|
|
128
186
|
```bash
|
|
129
|
-
|
|
187
|
+
docker compose -p kairos-mcp logs app-prod
|
|
130
188
|
```
|
|
131
189
|
|
|
132
|
-
|
|
190
|
+
Also verify that required ports are free:
|
|
133
191
|
|
|
134
|
-
|
|
192
|
+
- minimal stack: `3000`, `6333`, `9090`
|
|
193
|
+
- full stack adds: `6379`, `5432`, `8080`, `9000`
|
|
135
194
|
|
|
136
|
-
|
|
137
|
-
- [KAIROS CLI reference](docs/CLI.md)
|
|
138
|
-
- [Architecture and protocol workflows](docs/architecture/README.md) — tool workflows, infrastructure, [auth overview](docs/architecture/auth-overview.md), [logging](docs/architecture/logging.md)
|
|
139
|
-
- [Protocol examples and challenge types](docs/examples/README.md)
|
|
140
|
-
- [All documentation](docs/README.md)
|
|
195
|
+
### Health check returns `503`
|
|
141
196
|
|
|
142
|
-
|
|
197
|
+
KAIROS only reports healthy when Qdrant is ready. Wait for Qdrant to finish
|
|
198
|
+
starting, then retry:
|
|
143
199
|
|
|
144
|
-
|
|
200
|
+
```bash
|
|
201
|
+
curl http://localhost:3000/health
|
|
202
|
+
```
|
|
145
203
|
|
|
146
|
-
|
|
204
|
+
### Embeddings fail on startup
|
|
147
205
|
|
|
148
|
-
|
|
206
|
+
Set one working embedding backend in `.env`:
|
|
149
207
|
|
|
150
|
-
|
|
208
|
+
- OpenAI: `OPENAI_API_KEY`
|
|
209
|
+
- Ollama/OpenAI-compatible: `OPENAI_API_URL`, `OPENAI_EMBEDDING_MODEL`, `OPENAI_API_KEY=ollama`
|
|
210
|
+
- TEI: `TEI_BASE_URL` (+ optional `TEI_MODEL`)
|
|
151
211
|
|
|
152
|
-
|
|
212
|
+
### Auth-enabled development is failing
|
|
153
213
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
214
|
+
Use the fullstack env example, start the `fullstack` profile, and configure
|
|
215
|
+
realms:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
npm run infra:up
|
|
219
|
+
```
|
|
157
220
|
|
|
158
|
-
|
|
221
|
+
### The CLI keeps asking for login
|
|
159
222
|
|
|
160
|
-
|
|
161
|
-
guidelines, and agent-facing design principles.
|
|
223
|
+
The CLI stores tokens per API URL. Confirm that:
|
|
162
224
|
|
|
163
|
-
|
|
225
|
+
- you are using the expected `--url` / `KAIROS_API_URL`
|
|
226
|
+
- the token is still valid
|
|
227
|
+
- Keycloak and the KAIROS server agree on issuer and audience
|
|
228
|
+
|
|
229
|
+
Use:
|
|
164
230
|
|
|
165
|
-
|
|
231
|
+
```bash
|
|
232
|
+
kairos token --validate
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Support
|
|
166
236
|
|
|
167
|
-
|
|
168
|
-
|
|
237
|
+
- [Documentation](docs/README.md)
|
|
238
|
+
- [Issues](https://github.com/debian777/kairos-mcp/issues)
|
|
239
|
+
- [Discussions](https://github.com/debian777/kairos-mcp/discussions)
|
|
240
|
+
|
|
241
|
+
## Trademark
|
|
169
242
|
|
|
170
|
-
|
|
243
|
+
KAIROS MCP™ and the KAIROS MCP logo are trademarks of the project owner.
|
|
244
|
+
They are not covered by the MIT license. Forks must remove the name and logo.
|
|
171
245
|
|
|
172
|
-
See [TRADEMARK.md](TRADEMARK.md)
|
|
246
|
+
See [TRADEMARK.md](TRADEMARK.md).
|
|
173
247
|
|
|
174
248
|
## License
|
|
175
249
|
|