Add MCP server, note mutation endpoint, and updated_at tracking (v3.0.0)

New MCP server (mcp/) exposes kb operations as native MCP tools over
Streamable HTTP with Bearer token auth. Supports collections via tag
conventions, chunked file uploads, and agent-side search patterns.

Engine gains PATCH /api/v1/notes/{id} for in-place note updates with
transactional re-chunk/re-embed, and updated_at column on documents.

Go client adds updatenote command and Patch HTTP method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 21:34:55 +01:00
parent adeba21712
commit e7136a4a20
32 changed files with 1679 additions and 8 deletions
+24
View File
@@ -158,6 +158,30 @@ Use filters when the question implies a specific domain:
- From a specific topic → `--tags <topic>`
- Check available tags first: `kb tags --format json`
## Updating notes
```bash
kb updatenote 42 "revised note content" # update note by ID
```
Updates the text of an existing note in place, preserving its ID, creation timestamp, and tags. Re-chunks and re-embeds the new text.
## MCP server (agent integration)
For agent-to-agent integration, kb provides an MCP server alongside the CLI. The MCP server
exposes the same operations as native MCP tools over Streamable HTTP transport, which agents
can connect to directly without subprocess overhead.
**MCP tools:** `kb_search`, `kb_addnote`, `kb_update_note`, `kb_get`, `kb_status`, `kb_jobs`,
`kb_upload_start`, `kb_upload_chunk`, `kb_upload_finish`.
The MCP server supports **collections** — scoped document namespaces (e.g. `memory`, `documents`,
`workspace`) implemented via tag conventions. This is the recommended way for agents to separate
their memory from user documents.
If the kb engine is already running via Docker Compose, add the MCP server by deploying the
`kb-mcp` service from the same compose file. Agents connect to it on port 3000 (default).
## Important notes
- Always use `--format json` for machine parsing