@yugabytedb/meko-mcp 1.2.0 → 2.0.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 +28 -19
- package/assets/hooks-handlers/before-submit-prompt.sh +2 -2
- package/assets/hooks-handlers/lib/capture.js +209 -144
- package/assets/hooks-handlers/lib/checkpoint-timer.js +23 -11
- package/assets/hooks-handlers/session-start.sh +6 -2
- package/assets/scripts/meko-statusline.sh +119 -0
- package/assets/scripts/package-desktop-skill.sh +27 -24
- package/assets/skills/meko-mcp-tools/SKILL.md +42 -50
- package/assets/skills/meko-mcp-tools/references/_sections.md +1 -1
- package/assets/skills/meko-mcp-tools/references/tools-cookbook.md +75 -150
- package/assets/skills/meko-mcp-tools/references/tools-datapack-workflow.md +30 -36
- package/assets/skills/meko-mcp-tools/references/tools-known-limitations.md +6 -22
- package/assets/skills/meko-mcp-tools/references/tools-memory-vs-conversation.md +9 -8
- package/assets/skills/meko-mcp-tools/references/tools-overview.md +35 -42
- package/assets/skills/meko-mcp-tools/references/tools-rag-workflow.md +28 -92
- package/assets/skills/meko-mcp-tools/references/tools-scope-permissions.md +5 -9
- package/assets/skills/meko-mcp-tools/references/tools-troubleshooting.md +1 -81
- package/assets/skills/meko-mcp-tools-desktop/SKILL.md +100 -107
- package/assets/skills/meko-mcp-tools-desktop/desktop/README.md +41 -11
- package/assets/skills/meko-mcp-tools-desktop/references/_sections.md +1 -1
- package/assets/skills/meko-mcp-tools-desktop/references/tools-cookbook.md +71 -150
- package/assets/skills/meko-mcp-tools-desktop/references/tools-known-limitations.md +12 -18
- package/assets/skills/meko-mcp-tools-desktop/references/tools-memory-vs-conversation.md +12 -15
- package/assets/skills/meko-mcp-tools-desktop/references/tools-overview.md +35 -42
- package/assets/skills/meko-mcp-tools-desktop/references/tools-rag-workflow.md +28 -92
- package/assets/skills/meko-mcp-tools-desktop/references/tools-scope-permissions.md +5 -9
- package/assets/skills/meko-mcp-tools-desktop/references/tools-troubleshooting.md +1 -81
- package/assets/skills/meko-select-datapack-desktop/SKILL.md +198 -0
- package/assets/skills/meko-select-datapack-desktop/references/cookbook.md +121 -0
- package/assets/skills/meko-select-datapack-desktop/references/troubleshooting.md +66 -0
- package/bin/create-meko-setup.mjs +29 -0
- package/lib/clients/claude-code.mjs +133 -6
- package/lib/clients/claude-desktop.mjs +37 -12
- package/lib/clients/codex.mjs +306 -5
- package/lib/clients/common.mjs +41 -1
- package/lib/clients/cursor.mjs +75 -19
- package/lib/config.mjs +26 -0
- package/lib/installer.mjs +24 -0
- package/lib/mcp-transport.mjs +5 -0
- package/lib/validate.mjs +0 -1
- package/package.json +1 -1
- package/scripts/bundle-assets.mjs +8 -0
- package/assets/skills/meko-mcp-tools/references/tools-db-query-patterns.md +0 -38
- package/assets/skills/meko-mcp-tools/references/tools-write-guardrails.md +0 -30
|
@@ -3,97 +3,6 @@
|
|
|
3
3
|
Every tool example below shows the correct parameters, expected response, and common errors. Use `scope="read"` for reads and `scope="write"` for writes — never `"all"` or any other value.
|
|
4
4
|
|
|
5
5
|
> **Note on `agent_id` in the examples below.** Where you see `agent_id="agent"` in an example, substitute **your** session's `agent_id` — the value the SessionStart hook injected into `additionalContext`. For Claude Code that's `claude_code:<repo-basename>` (e.g. `claude_code:meko-mcp-server`); for Cursor, `cursor:<repo-basename>`; for Claude Desktop, the bare client name `claude_desktop`. For genuinely cross-project facts (user identity, global preferences) write/read with `agent_id="meko_agent"` — the common bucket the server stores empty/missing values into. See `tools-agent-id-conventions.md`.
|
|
6
|
-
>
|
|
7
|
-
> **Note on availability on Cloud.** The `db_*` tools and the three KB ingestion tools (`knowledgebase_trigger_index_creation`, `knowledgebase_add_source_to_index`, `knowledgebase_check_index_status`) return `{"error": "not_available"}` on Cloud Meko today. This cookbook keeps their examples for reference but you can't call them from a Cloud client.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Database Tools
|
|
12
|
-
|
|
13
|
-
### db_summarize_database
|
|
14
|
-
|
|
15
|
-
**When to use:** First thing in a session to understand what's in the database. Prefer this over writing your own `information_schema` query.
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
db_summarize_database(scope="read", schema="public")
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**Response:**
|
|
22
|
-
```json
|
|
23
|
-
[
|
|
24
|
-
{
|
|
25
|
-
"table_name": "customers",
|
|
26
|
-
"schema": [
|
|
27
|
-
{"column_name": "id", "data_type": "uuid"},
|
|
28
|
-
{"column_name": "name", "data_type": "text"}
|
|
29
|
-
],
|
|
30
|
-
"row_count": 1523
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**With datapack:**
|
|
36
|
-
```
|
|
37
|
-
db_summarize_database(scope="read", schema="public", datapack_id="dp-uuid-123")
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
**Common errors:**
|
|
41
|
-
- `Insufficient scope: 'all'` — Use `scope="read"`, not `"all"`
|
|
42
|
-
- Empty result — The schema may not exist, try `schema="public"`
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
### db_run_read_only_query
|
|
47
|
-
|
|
48
|
-
**When to use:** Any SELECT query. Always add `LIMIT` on exploratory queries.
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
db_run_read_only_query(scope="read", query="SELECT id, name FROM customers LIMIT 10")
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Response:** JSON array of row objects.
|
|
55
|
-
```json
|
|
56
|
-
[{"id": "abc-123", "name": "Alice"}, {"id": "def-456", "name": "Bob"}]
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Best practices:**
|
|
60
|
-
- Always use `LIMIT` on unfamiliar tables to avoid flooding context
|
|
61
|
-
- Select specific columns rather than `SELECT *` to keep responses small
|
|
62
|
-
- For non-public schemas: `SELECT * FROM analytics."monthly_revenue" LIMIT 5`
|
|
63
|
-
- Escape single quotes in values: `WHERE name = 'O''Brien'`
|
|
64
|
-
|
|
65
|
-
**Common errors:**
|
|
66
|
-
- `cannot execute INSERT in a read-only transaction` — Use `db_run_write_query` for writes
|
|
67
|
-
- `permission denied for table X` — MCP user lacks access to this table (server-side config issue, not fixable via MCP)
|
|
68
|
-
- `connection already closed` — Retry once. If persistent, the DB pool is unhealthy.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
### db_run_write_query
|
|
73
|
-
|
|
74
|
-
**When to use:** INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE INDEX.
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
db_run_write_query(scope="write", query="INSERT INTO customers (id, name) VALUES ('abc-123', 'Alice')")
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**Response:**
|
|
81
|
-
```json
|
|
82
|
-
{"rows_affected": 1}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**One statement per call.** This is wrong:
|
|
86
|
-
```
|
|
87
|
-
db_run_write_query(scope="write", query="CREATE TABLE a (id INT); CREATE TABLE b (id INT);")
|
|
88
|
-
```
|
|
89
|
-
Split into two separate calls.
|
|
90
|
-
|
|
91
|
-
**Bulk inserts:** Maximum 1000 rows per INSERT VALUES. For more, use `INSERT ... SELECT` or batch into multiple calls.
|
|
92
|
-
|
|
93
|
-
**Common errors:**
|
|
94
|
-
- `Multi-statement queries not allowed` — Send one statement per call
|
|
95
|
-
- `DROP SCHEMA is not allowed` — See `tools-write-guardrails.md` for blocked operations
|
|
96
|
-
- `'dict' object has no attribute 'guardrail_config'` — Known server bug in some deployments. Write operations may be unavailable.
|
|
97
6
|
|
|
98
7
|
---
|
|
99
8
|
|
|
@@ -103,11 +12,11 @@ Split into two separate calls.
|
|
|
103
12
|
|
|
104
13
|
### memory_add
|
|
105
14
|
|
|
106
|
-
**When to use:**
|
|
15
|
+
**When to use:** NOT for facts the user states in conversation — those are saved automatically by conversation capture + server-side extraction. Reserve `memory_add` for the three cases extraction can't reach: (1) the user explicitly says "remember this"; (2) a durable fact that lives only in your output or a tool result, never in a user turn; (3) overwriting a negated/corrected fact (pair with `memory_delete_by_id`, since extraction is additive).
|
|
107
16
|
|
|
108
17
|
```
|
|
109
|
-
memory_add(scope="write", agent_id="agent",
|
|
110
|
-
text="
|
|
18
|
+
memory_add(scope="write", agent_id="<your-agent-id>",
|
|
19
|
+
text="Remember: deploy scripts must be run from the repo root, never a subdir.")
|
|
111
20
|
```
|
|
112
21
|
|
|
113
22
|
**Response:**
|
|
@@ -122,9 +31,8 @@ memory_add(scope="write", agent_id="agent", user_id="amiram",
|
|
|
122
31
|
```
|
|
123
32
|
|
|
124
33
|
**What NOT to store via memory_add:**
|
|
125
|
-
- CSV rows or tabular data (use `db_run_write_query` instead)
|
|
126
34
|
- Full conversations (use `conversation_create` + `conversation_add_message`)
|
|
127
|
-
- Large documents (use
|
|
35
|
+
- Large documents (use the UI's Datapack → Actions → Add Knowledge upload flow)
|
|
128
36
|
|
|
129
37
|
**Common errors:**
|
|
130
38
|
- `syntax error at or near "-"` — legacy error from the pre-multi-tenancy schema when `agent_id` became part of a PostgreSQL identifier. No longer applies on Cloud (agent_id is a TEXT column value, any string is accepted). If you hit it on a deployment that still uses the old schema, use underscores instead of hyphens.
|
|
@@ -225,11 +133,14 @@ conversation_create(scope="write", agent_id="agent", user_id="amiram",
|
|
|
225
133
|
|
|
226
134
|
**When to use:** Add a user/assistant exchange to an existing conversation. **All fields must be verbatim** — never summarize or rephrase.
|
|
227
135
|
|
|
136
|
+
Pass `index_for_search=True` on substantive turns so this conversation is embedded into the shared conversation-history cache (searchable later via `conversation_search` / `contextual_prominence_search`). This isn't limited to WorkbenchLM — pass it for agent-harness conversations too.
|
|
137
|
+
|
|
228
138
|
```
|
|
229
139
|
conversation_add_message(scope="write", conversation_id="conv-uuid-123", agent_id="agent",
|
|
230
140
|
input="Why is the auth middleware returning 401?",
|
|
231
141
|
output="The token validation is checking the wrong issuer claim...",
|
|
232
|
-
reasoning="Checked the middleware source, found issuer mismatch between config and JWT..."
|
|
142
|
+
reasoning="Checked the middleware source, found issuer mismatch between config and JWT...",
|
|
143
|
+
index_for_search=True)
|
|
233
144
|
```
|
|
234
145
|
|
|
235
146
|
**With dedup seed (use when client hooks also write to Langfuse):**
|
|
@@ -237,7 +148,8 @@ conversation_add_message(scope="write", conversation_id="conv-uuid-123", agent_i
|
|
|
237
148
|
conversation_add_message(scope="write", conversation_id="conv-uuid-123", agent_id="agent",
|
|
238
149
|
input="Why is the auth middleware returning 401?",
|
|
239
150
|
output="The token validation is checking the wrong issuer claim...",
|
|
240
|
-
seed="conv-uuid-123:agent:Why is the auth middleware returning 401?"
|
|
151
|
+
seed="conv-uuid-123:agent:Why is the auth middleware returning 401?",
|
|
152
|
+
index_for_search=True)
|
|
241
153
|
```
|
|
242
154
|
|
|
243
155
|
---
|
|
@@ -278,11 +190,11 @@ conversation_delete(scope="admin", conversation_id="conv-uuid-123", agent_id="ag
|
|
|
278
190
|
|
|
279
191
|
---
|
|
280
192
|
|
|
281
|
-
##
|
|
193
|
+
## Knowledge Base Tools
|
|
282
194
|
|
|
283
|
-
**
|
|
195
|
+
**KB ingestion is a UI-only activity.** Users upload files via the datapack's Actions → **Add Knowledge** dialog (PDF/TXT/MD/JSON/MP4, 5MB each, 10/batch). `knowledgebase_search` is the one KB tool exposed via MCP.
|
|
284
196
|
|
|
285
|
-
See `tools-rag-workflow.md` for the decision table
|
|
197
|
+
See `tools-rag-workflow.md` for the decision table.
|
|
286
198
|
|
|
287
199
|
### knowledgebase_search
|
|
288
200
|
|
|
@@ -309,73 +221,86 @@ Populated KBs return results with chunk content and similarity scores. An empty/
|
|
|
309
221
|
|
|
310
222
|
---
|
|
311
223
|
|
|
312
|
-
|
|
224
|
+
## Artifact Tools
|
|
225
|
+
|
|
226
|
+
### artifact_put
|
|
313
227
|
|
|
314
|
-
**When to use:**
|
|
228
|
+
**When to use:** An agent has generated a file (report, CSV, PDF, code output, image) and wants to persist it in Meko for later retrieval or cross-agent sharing. Files < 1 MB are stored inline in the DB; files ≥ 1 MB go to the datapack's S3 bucket. Idempotent — uploading the same bytes twice returns the same `content_hash`.
|
|
315
229
|
|
|
316
230
|
```
|
|
317
|
-
|
|
231
|
+
artifact_put(
|
|
318
232
|
scope="write",
|
|
233
|
+
filename="analysis_report.csv",
|
|
234
|
+
content_type="text/csv",
|
|
235
|
+
content_base64="<base64-encoded bytes>",
|
|
319
236
|
conversation_id="<uuid from conversation_create>",
|
|
320
|
-
|
|
321
|
-
|
|
237
|
+
agent_id="agent"
|
|
238
|
+
)
|
|
322
239
|
```
|
|
323
240
|
|
|
324
|
-
**
|
|
325
|
-
- `ai_provider="OPENAI"` (default)
|
|
326
|
-
- `embedding_model="text-embedding-3-large"` (default)
|
|
327
|
-
- `embedding_dimensions=1536` (default)
|
|
328
|
-
- `chunk_size=1024` (default)
|
|
329
|
-
- `chunk_overlap=256` (default)
|
|
330
|
-
- `datapack_id=None`
|
|
331
|
-
|
|
332
|
-
**Success response:**
|
|
241
|
+
**Response:**
|
|
333
242
|
```json
|
|
334
|
-
{
|
|
335
|
-
|
|
243
|
+
{
|
|
244
|
+
"artifact_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
245
|
+
"content_hash": "a665a45920422f9d417e4867efdc4fb8a5f1f89ea5b8440b1ad4c4c6b8a7e4d3",
|
|
246
|
+
"filename": "analysis_report.csv",
|
|
247
|
+
"content_type": "text/csv",
|
|
248
|
+
"size_bytes": 4096,
|
|
249
|
+
"stored_in": "db"
|
|
250
|
+
}
|
|
336
251
|
```
|
|
337
252
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
253
|
+
Save the `content_hash` — it's the retrieval key for `artifact_get`.
|
|
254
|
+
|
|
255
|
+
**Common errors:**
|
|
256
|
+
- `invalid_base64` — `content_base64` is not valid base64; decode the file before passing it.
|
|
257
|
+
- `artifact_too_large` — file exceeds 5 MiB (default). Set `MEKO_MAX_ARTIFACT_UPLOAD_BYTES` to raise the limit.
|
|
343
258
|
|
|
344
259
|
---
|
|
345
260
|
|
|
346
|
-
###
|
|
261
|
+
### artifact_get
|
|
347
262
|
|
|
348
|
-
**When to use:**
|
|
263
|
+
**When to use:** Retrieve a file previously uploaded with `artifact_put`.
|
|
349
264
|
|
|
265
|
+
**Small files (< 1 MB) — content returned inline:**
|
|
350
266
|
```
|
|
351
|
-
|
|
267
|
+
artifact_get(
|
|
352
268
|
scope="read",
|
|
269
|
+
content_hash="a665a45920422f9d417e4867efdc4fb8a5f1f89ea5b8440b1ad4c4c6b8a7e4d3",
|
|
353
270
|
conversation_id="<uuid from conversation_create>",
|
|
354
|
-
|
|
355
|
-
|
|
271
|
+
agent_id="agent"
|
|
272
|
+
)
|
|
356
273
|
```
|
|
357
274
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
scope="write",
|
|
369
|
-
conversation_id="<uuid from conversation_create>",
|
|
370
|
-
index_name="company_docs",
|
|
371
|
-
source_uri="s3://my-bucket/new-docs/")
|
|
275
|
+
**Response (inline):**
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"content_hash": "a665a45920422f9d417e4867efdc4fb8...",
|
|
279
|
+
"filename": "analysis_report.csv",
|
|
280
|
+
"content_type": "text/csv",
|
|
281
|
+
"size_bytes": 4096,
|
|
282
|
+
"stored_in": "db",
|
|
283
|
+
"content_base64": "<base64-encoded bytes>"
|
|
284
|
+
}
|
|
372
285
|
```
|
|
373
286
|
|
|
374
|
-
|
|
287
|
+
**Large files (≥ 1 MB) — written to local disk:**
|
|
288
|
+
```json
|
|
289
|
+
{
|
|
290
|
+
"content_hash": "a665a45920422f9d417e4867efdc4fb8...",
|
|
291
|
+
"filename": "dataset.parquet",
|
|
292
|
+
"content_type": "application/octet-stream",
|
|
293
|
+
"size_bytes": 2097152,
|
|
294
|
+
"stored_in": "s3",
|
|
295
|
+
"local_path": "/Users/you/.meko/artifacts/a665a4.../dataset.parquet"
|
|
296
|
+
}
|
|
297
|
+
```
|
|
375
298
|
|
|
376
|
-
|
|
299
|
+
For large files use the `local_path` value to read the file with normal file tools. S3 URLs are never exposed.
|
|
377
300
|
|
|
378
|
-
|
|
301
|
+
**Common errors:**
|
|
302
|
+
- `ARTIFACT_NOT_FOUND` — no artifact with that hash in this datapack.
|
|
303
|
+
- `ARTIFACT_EXPIRED` — artifact exists but its free-tier TTL has elapsed (30 days of no access). Pro-tier artifacts never expire.
|
|
379
304
|
|
|
380
305
|
---
|
|
381
306
|
|
|
@@ -385,22 +310,22 @@ Same S3-only / worker-credentials caveats as `trigger_index_creation` apply.
|
|
|
385
310
|
|
|
386
311
|
```
|
|
387
312
|
datapack_create(scope="write", name="analytics_prod")
|
|
388
|
-
datapack_list(scope="read")
|
|
389
|
-
datapack_describe(scope="read",
|
|
313
|
+
datapack_list(scope="read") # returns datapack_id for each datapack
|
|
314
|
+
datapack_describe(scope="read", datapack_id="<uuid>", include_status=True)
|
|
390
315
|
```
|
|
391
316
|
|
|
392
317
|
### datapack_update / datapack_delete
|
|
393
318
|
|
|
394
319
|
```
|
|
395
|
-
datapack_update(scope="write",
|
|
396
|
-
datapack_delete(scope="admin",
|
|
320
|
+
datapack_update(scope="write", datapack_id="<uuid>", connection_string="postgresql://...")
|
|
321
|
+
datapack_delete(scope="admin", datapack_id="<uuid>") # Irreversible!
|
|
397
322
|
```
|
|
398
323
|
|
|
399
324
|
### Agent and knowledge-base management (NOT MCP — control-plane only)
|
|
400
325
|
|
|
401
326
|
Agent and KB lifecycle does not ship as MCP tools. If the user asks to create/list/delete agents or KB sources, don't invent a tool call — point them at the control plane:
|
|
402
327
|
|
|
403
|
-
- REST: `POST/GET/DELETE /datapacks/:
|
|
328
|
+
- REST: `POST/GET/DELETE /datapacks/:datapack_id/agents` (agents), `POST/GET/DELETE /datapacks/:datapack_id/knowledge-bases` (KB sources).
|
|
404
329
|
- Or the Meko UI at `app.mekodev.com` → Datapacks → agents / knowledge-bases.
|
|
405
330
|
|
|
406
|
-
|
|
331
|
+
KB ingestion specifically lives in the UI today: Datapack → Actions → **Add Knowledge** (PDF/TXT/MD/JSON/MP4, 5 MB each, 10/batch). Agents querying a populated index use `knowledgebase_search` — see `tools-rag-workflow.md`.
|
|
@@ -1,52 +1,46 @@
|
|
|
1
1
|
# Datapack Lifecycle and datapack_id Routing
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Always pass datapack_id for datapack-scoped operations
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
datapack_create(scope="write", name="analytics_prod")
|
|
9
|
-
-- Returns: {"id": "dp-uuid-123", ...}
|
|
10
|
-
|
|
11
|
-
db_summarize_database(scope="read", schema="public", datapack_id="dp-uuid-123")
|
|
12
|
-
db_run_read_only_query(scope="read", query="SELECT * FROM customers LIMIT 10", datapack_id="dp-uuid-123")
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## How datapack_id routing works
|
|
16
|
-
|
|
17
|
-
1. When `datapack_id` is **omitted**: uses the default pool from `YUGABYTEDB_URL`
|
|
18
|
-
2. When `datapack_id` is **provided**: resolves connection string via Meko API, creates/reuses a cached pool for that datapack
|
|
3
|
+
Datapacks are isolated workspaces — each has its own memory store and knowledge-base index. Many MCP tools accept an optional `datapack_id` to target a specific workspace; omit it to use the default.
|
|
19
4
|
|
|
20
5
|
## Which tools accept datapack_id?
|
|
21
6
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
**
|
|
25
|
-
**
|
|
7
|
+
| Tool group | Accepts `datapack_id`? |
|
|
8
|
+
|---|---|
|
|
9
|
+
| **Memory** (`memory_*`) | Yes — optional, defaults to the caller's default datapack |
|
|
10
|
+
| **Knowledge Base** (`knowledgebase_search`) | Yes — **required** (no default) |
|
|
11
|
+
| **Conversation** (`conversation_*`) | Yes — optional; routes the call's Langfuse trace to that datapack's project (data is Langfuse-stored, not in the datapack DB itself) |
|
|
12
|
+
| **Datapack management** (`datapack_*`) | Yes — `datapack_describe`/`datapack_update`/`datapack_delete` address the datapack by its `datapack_id` (the Meko API routes are `/datapacks/{datapack_id}`); it also routes the call's Langfuse trace to that datapack's project |
|
|
26
13
|
|
|
27
14
|
## How to obtain a datapack_id
|
|
28
15
|
|
|
29
|
-
- From `datapack_create` response (`"
|
|
30
|
-
- From `datapack_list` (each entry has `"
|
|
31
|
-
- From `datapack_describe` response
|
|
16
|
+
- From `datapack_create` response (`"datapack_id"` field; `"datapack_name"` is also returned)
|
|
17
|
+
- From `datapack_list` (each entry has `"datapack_id"` and `"datapack_name"`)
|
|
18
|
+
- From `datapack_describe` response (same field names)
|
|
32
19
|
|
|
33
20
|
## Datapack lifecycle
|
|
34
21
|
|
|
35
|
-
### Creation
|
|
22
|
+
### Creation
|
|
36
23
|
|
|
37
24
|
```
|
|
38
|
-
datapack_create(scope="write",
|
|
39
|
-
|
|
25
|
+
datapack_create(scope="write", agent_id="<your agent_id>",
|
|
26
|
+
conversation_id="<uuid>", name="sales_analytics")
|
|
27
|
+
-- Returns: {"datapack_id": "dp-uuid-123", "datapack_name": "sales_analytics", ...}
|
|
40
28
|
```
|
|
41
29
|
|
|
42
|
-
Provisioning agents and knowledge-base sources on
|
|
43
|
-
|
|
30
|
+
Provisioning agents and knowledge-base sources on a new datapack is **not** MCP-exposed. Use the Meko control plane:
|
|
31
|
+
|
|
32
|
+
- **UI**: `app.mekodata.ai` → Datapacks → select datapack → Agents / Knowledge Bases
|
|
33
|
+
- **REST**: `POST /datapacks/:datapack_id/agents`, `POST /datapacks/:datapack_id/knowledge-bases` (and the Add Knowledge UI for file uploads)
|
|
34
|
+
|
|
35
|
+
If the user asks to set those up mid-session, point them at the control plane rather than inventing an MCP call that will fail.
|
|
44
36
|
|
|
45
|
-
|
|
37
|
+
### Targeting a specific datapack on subsequent calls
|
|
46
38
|
|
|
47
39
|
```
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
memory_search(scope="read", agent_id="<your-agent-id>",
|
|
41
|
+
conversation_id="<uuid>", query="...", datapack_id="dp-uuid-123")
|
|
42
|
+
knowledgebase_search(scope="read", agent_id="<your-agent-id>",
|
|
43
|
+
conversation_id="<uuid>", datapack_id="dp-uuid-123", query="...")
|
|
50
44
|
```
|
|
51
45
|
|
|
52
46
|
### Teardown (requires admin scope)
|
|
@@ -54,11 +48,11 @@ knowledgebase_check_index_status(scope="read", index_name="leads_docs", datapack
|
|
|
54
48
|
Delete child resources first (agents and KB sources via the control plane), then the datapack:
|
|
55
49
|
|
|
56
50
|
```
|
|
57
|
-
# Control-plane (REST or UI): DELETE /datapacks/
|
|
58
|
-
# Control-plane (REST or UI): DELETE /datapacks/
|
|
59
|
-
datapack_delete(scope="admin",
|
|
51
|
+
# Control-plane (REST or UI): DELETE /datapacks/:datapack_id/knowledge-bases
|
|
52
|
+
# Control-plane (REST or UI): DELETE /datapacks/:datapack_id/agents/sales_agent
|
|
53
|
+
datapack_delete(scope="admin", datapack_id="dp-uuid-123") # MCP-exposed, destructive, irreversible
|
|
60
54
|
```
|
|
61
55
|
|
|
62
|
-
## Common mistake:
|
|
56
|
+
## Common mistake: forgetting datapack_id on memory tools
|
|
63
57
|
|
|
64
|
-
|
|
58
|
+
Memory writes without `datapack_id` land in the default datapack, not the one you just created. If you `datapack_create` and then `memory_add` without passing the new datapack's id, you'll be searching the wrong store later.
|
|
@@ -10,15 +10,15 @@ There are no MCP tools to:
|
|
|
10
10
|
- Clear stuck work queue entries
|
|
11
11
|
- Reset a failed pipeline
|
|
12
12
|
|
|
13
|
-
KB-source deletion happens via the Meko control plane (REST: `DELETE /datapacks/:
|
|
13
|
+
KB-source deletion happens via the Meko control plane (REST: `DELETE /datapacks/:datapack_id/knowledge-bases`, or the UI), which removes the registration from the Meko API — but does **not** touch the actual `dist_rag` index, source records, or vector data in the datapack's database.
|
|
14
14
|
|
|
15
15
|
**Workaround:** For stuck or failed indexes, create a new index with a different name. Stale indexes remain in the database until manually cleaned up by an admin.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## RAG ingestion is UI-only
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
KB ingestion (creating an index, adding sources, polling build status) is not exposed via MCP. Documents go in through the Cloud UI's **Add Knowledge** flow (Datapack → Actions → Add Knowledge) — PDF/TXT/MD/JSON/MP4 up to 5 MB each, 10 per batch.
|
|
20
20
|
|
|
21
|
-
To
|
|
21
|
+
To **query** a built index, use `knowledgebase_search` — it returns both uploaded documents and memories the user promoted from the Learnings tab.
|
|
22
22
|
|
|
23
23
|
## Memory tools unreliable for structured/tabular data
|
|
24
24
|
|
|
@@ -32,7 +32,7 @@ It works **poorly** for:
|
|
|
32
32
|
- Data dictionaries — only partial information extracted
|
|
33
33
|
- Structured schemas — relationships between fields lost
|
|
34
34
|
|
|
35
|
-
**
|
|
35
|
+
**Structured data is not natively supported via MCP.** The options are:
|
|
36
36
|
|
|
37
37
|
1. **Write a single narrative summary** as a memory — one call, not row-by-row:
|
|
38
38
|
```
|
|
@@ -42,26 +42,10 @@ It works **poorly** for:
|
|
|
42
42
|
text="Customer Complaints dataset has fields: Complaint ID (int PK), Date Submitted (date), Product (text, e.g. Mortgage/Credit Card), Sub-product (text), Issue (text), Company Response (text), State (text, 2-letter code), ZIP Code (text)")
|
|
43
43
|
```
|
|
44
44
|
2. **Upload the schema doc** through the Cloud UI's **Add Knowledge** flow (Datapack → Actions → Add Knowledge). Accepts PDF/TXT/MD/JSON — convert CSV to MD or JSON first. That makes it queryable via `knowledgebase_search`.
|
|
45
|
-
3. **Tell the user** that structured-data storage via MCP isn't
|
|
45
|
+
3. **Tell the user** that structured-data storage via MCP isn't supported and let them decide how to proceed.
|
|
46
46
|
|
|
47
47
|
Never ingest CSV row-by-row into memory — each row becomes a fragmented fact with lost context.
|
|
48
48
|
|
|
49
|
-
## MCP user permission gaps
|
|
50
|
-
|
|
51
|
-
The MCP database user may not have read access to all tables within a datapack, particularly:
|
|
52
|
-
- Data tables created by the provisioning system
|
|
53
|
-
- Tables in non-public schemas
|
|
54
|
-
|
|
55
|
-
If `db_run_read_only_query` returns "permission denied", this is a server-side configuration issue. Use `db_summarize_database` to see which tables are accessible.
|
|
56
|
-
|
|
57
|
-
## Currently broken tools
|
|
58
|
-
|
|
59
|
-
**`db_run_write_query`** — May fail with `'dict' object has no attribute 'guardrail_config'` in some deployments. When this happens, all write operations are blocked for the session.
|
|
60
|
-
|
|
61
|
-
**Knowledge-base ingestion tools on cloud Meko** (`knowledgebase_trigger_index_creation`, `knowledgebase_add_source_to_index`, `knowledgebase_check_index_status`) return `{"error": "not_available"}` on Free Tier. Even when ungated, the async worker only reads `s3://` URIs and uses its own boto3 credential chain — it cannot read buckets the user provides credentials for. Tracked: [yugabyte/meko-mcp-server#89](https://github.com/yugabyte/meko-mcp-server/issues/89) / MEKO-96. Use the Meko UI's **Add Knowledge** file-upload dialog for ingestion on cloud. `knowledgebase_search` works on cloud today.
|
|
62
|
-
|
|
63
|
-
(Historical note: `knowledgebase_add_source_to_index` used to have a `r_index_name` vs `r_index_id` SQL-signature bug. That specific bug was fixed on main in commit `3ae724a` — the tool now resolves `index_name → index_id` internally.)
|
|
64
|
-
|
|
65
49
|
## No conversation search
|
|
66
50
|
|
|
67
51
|
`conversation_list` returns conversations by agent, but there is no semantic search across conversation content. To find a specific past exchange, you need to list conversations and inspect them individually with `conversation_get`.
|
|
@@ -111,26 +111,27 @@ For a true fan-out across other specific buckets (e.g. also see what was written
|
|
|
111
111
|
|
|
112
112
|
**WRONG:** Using `memory_add` to ingest CSV rows, data dictionaries, or tabular schemas — Mem0 extracts individual facts and may drop columns, rows, or structural relationships.
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
There is no MCP-side "just put it in a database table" option — raw SQL access isn't part of the MCP surface. Workarounds:
|
|
115
115
|
|
|
116
116
|
1. **Write a single narrative summary** as a memory: `"The Customer Complaints dataset has fields: Complaint ID (int), Date Submitted (date), Product (text), Sub-product (text), Issue (text)..."` — one call, not row-by-row.
|
|
117
117
|
2. **Suggest the user upload the file** via the Cloud UI's Add Knowledge flow if it's a document (CSV files aren't in the supported list — PDF/TXT/MD/JSON/MP4 are; for CSV, convert to MD or JSON first).
|
|
118
118
|
3. **Never ingest CSV row-by-row** into memory — each row becomes a fragmented fact with lost context.
|
|
119
119
|
|
|
120
|
-
##
|
|
120
|
+
## Memory Storage: automatic, not proactive
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
On Claude Code, do **not** proactively `memory_add` facts the user states. Conversation capture is automatic (see below) and the server extracts durable memories from the captured turns on its own — personal info, team conventions, domain knowledge the user states, and corrections are all saved without a tool call. Re-storing them with `memory_add` just duplicates what extraction already holds.
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- **
|
|
127
|
-
- **
|
|
124
|
+
Explicit `memory_add` is reserved for the three cases automatic extraction cannot reach:
|
|
125
|
+
|
|
126
|
+
- **Explicit request** → the user says "remember this" / "save this."
|
|
127
|
+
- **Output-only / tool-derived fact** → a durable fact that lives only in your output or a tool result, never in a user turn. Extraction reads only the user turn, so it never sees these.
|
|
128
|
+
- **Overwriting correction** → a prior fact was negated and the stale memory must not survive. Extraction is additive (it adds the new fact but leaves the old one live), so `memory_search` for the stale memory and `memory_update` / `memory_delete_by_id` it.
|
|
128
129
|
|
|
129
130
|
Use `memory_search` at the start of sessions to recall what you already know before asking the user to repeat themselves.
|
|
130
131
|
|
|
131
132
|
## Using Both Together
|
|
132
133
|
|
|
133
|
-
|
|
134
|
+
Capture stores the full conversation (preserves structure) and extraction derives searchable memories from it — both happen automatically. Add an explicit `memory_add` only for the three cases above.
|
|
134
135
|
|
|
135
136
|
## Key Retrieval Difference
|
|
136
137
|
|