mcp-kb-sqlite
Simple, fast persistent memory for your coding agent — cross-session, cross-project. One knowledge
base shared across every repo you work in, so what you learn in one project is there the next time
you open another. Entries can be linked to each other (relate), so related facts stay connected
instead of scattered.
Start a conversation with /kb-use to load relevant context before you begin. When you learn
something worth keeping — an architecture decision, a gotcha, a debugging finding — save it with
/kb-update.
Under the hood: a plain SQLite database with an FTS5 full-text index, and a small tool surface for agents to search, save, and link entries. No server to run, no external service, no schema to manage by hand.
Install — MCP server
The database lives at ~/.ai-memory/kb.db unless you override it with DB_PATH (shown below,
optional). The schema is created and migrated automatically on first connection.
Claude Code
claude mcp add kb -- uv run --directory /path/to/mcp-kb-sqlite mcp-kb-sqlite
# with a custom DB_PATH:
claude mcp add kb --env DB_PATH=/path/to/kb.db -- uv run --directory /path/to/mcp-kb-sqlite mcp-kb-sqlite
Or add it directly to .mcp.json (project-local) or ~/.claude.json (user-scoped, under the
top-level mcpServers key):
{
"mcpServers": {
"kb": {
"type": "stdio",
"command": "uv",
"args": ["run", "--directory", "/path/to/mcp-kb-sqlite", "mcp-kb-sqlite"],
"env": { "DB_PATH": "/path/to/kb.db" }
}
}
}
env is optional — drop it to use the default ~/.ai-memory/kb.db.
OpenCode
Add to opencode.json (global at ~/.config/opencode/opencode.json, or project-local):
{
"mcp": {
"kb": {
"type": "local",
"command": [
"uv",
"run",
"--directory",
"/path/to/mcp-kb-sqlite",
"mcp-kb-sqlite"
],
"enabled": true,
"environment": { "DB_PATH": "/path/to/kb.db" }
}
}
}
environment is optional — drop it to use the default ~/.ai-memory/kb.db.
Install — skills
The /kb-use and /kb-update workflows ship as skills for both Claude Code and OpenCode. The two
flavors are hand-kept in sync — there's no generator, so edit both when instructions change.
Claude Code
Copy or symlink skills/claude/commands/*.md into ~/.claude/commands/.
OpenCode
Copy or symlink each skills/opencode/<name>/ directory into ~/.config/opencode/skills/<name>/
(or a project-local .opencode/skills/). OpenCode skills are auto-invoked by description match via
the agent's skill tool, but can also be triggered directly as /<name> in chat — this prepends
the SKILL.md text and appends whatever you typed after the command.
Tools
| Tool | Purpose |
|---|---|
save(id?, ns?, key?, title?, description?, tags?, data?) |
Create or update an entry — see below |
get(id, include_data=False) |
Fetch one entry; include_data=True returns the payload |
search(query, ns?, limit=10, offset=0) |
FTS5/BM25 over title + description + tags |
list(ns?, limit=20, offset=0) |
Entries by recency, metadata only |
list_namespaces() |
Namespaces with entry counts and last-updated date |
relate(from_id, to_id, rel?) |
Link two entries; omit rel to remove all links between them |
get_relations(id) |
Links in both directions |
delete(id) |
Remove an entry (cascades to its relations) |
Entries are addressed by ns (namespace, e.g. project/subsystem) plus key (a slug unique within the
namespace). ns filters are prefix matches, so ns="project" covers every subsystem under it.
Only title, description, and tags are FTS-indexed. data is the payload — put schemas, code, configs
and traces there, and make sure anything you need to find also appears in one of the indexed fields.
save: create vs. update
Every parameter is optional; the presence of id picks the mode.
Update — pass id plus only the fields you want to change:
save(id=42, description="new search hints") # title, tags, data untouched
Omitted fields keep their current value. Pass "" (or [] for tags) to clear description, tags, or
data. ns, key, and title can be changed — that's how you rename or move an entry — but not cleared.
Create — omit id; ns, key, and title are all required:
save(ns="project/db", key="schema", title="Schema layout", tags=["db","schema"], data="…")
There is no upsert. Creating over an existing (ns, key) is an error that reports the existing id, so an
accidental full overwrite isn't possible:
Error: project/db/schema already exists (id=42) — pass id=42 to update it
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_kb_sqlite-0.1.0.tar.gz.
File metadata
- Download URL: mcp_kb_sqlite-0.1.0.tar.gz
- Upload date:
- Size: 85.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27fe5923410d1df990d30c3d205b2624a4ef996db1439875ea1f529c67d27700
|
|
| MD5 |
a28c52f3858616b48eb0f441b7b7e665
|
|
| BLAKE2b-256 |
68cca5b9bd1935b349bcca976ee6d350cd7ed7eef7506ae0f09e8807e3b73a06
|
Provenance
The following attestation bundles were made for mcp_kb_sqlite-0.1.0.tar.gz:
Publisher:
publish.yml on eukos/mcp-kb-sqlite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_kb_sqlite-0.1.0.tar.gz -
Subject digest:
27fe5923410d1df990d30c3d205b2624a4ef996db1439875ea1f529c67d27700 - Sigstore transparency entry: 2621501456
- Sigstore integration time:
-
Permalink:
eukos/mcp-kb-sqlite@e7e8ac54da31921fe5d94dfa3f193ffea1bfec08 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/eukos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e7e8ac54da31921fe5d94dfa3f193ffea1bfec08 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_kb_sqlite-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_kb_sqlite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8bb9c816ee58a0d7910e5f96d62060d5a589dc7c5a9aba45bdd84dfc1efa12e
|
|
| MD5 |
a98d7f13918e6aa8fc97aaed48828dca
|
|
| BLAKE2b-256 |
c824b487875c25e18c076406ecb86c531b7248459ee86716dff03b02ef55a749
|
Provenance
The following attestation bundles were made for mcp_kb_sqlite-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on eukos/mcp-kb-sqlite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_kb_sqlite-0.1.0-py3-none-any.whl -
Subject digest:
b8bb9c816ee58a0d7910e5f96d62060d5a589dc7c5a9aba45bdd84dfc1efa12e - Sigstore transparency entry: 2621501458
- Sigstore integration time:
-
Permalink:
eukos/mcp-kb-sqlite@e7e8ac54da31921fe5d94dfa3f193ffea1bfec08 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/eukos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e7e8ac54da31921fe5d94dfa3f193ffea1bfec08 -
Trigger Event:
push
-
Statement type: