Server data from the Official MCP Registry
Reviewed, git-backed engineering knowledge base for coding agents, served over MCP.
About
Reviewed, git-backed engineering knowledge base for coding agents, served over MCP.
Security Report
CardLoom is a git-backed knowledge card server for coding agents with reasonable safeguards: agents can only create drafts, human approval gates verification, path traversal checks exist on card IDs, and secret patterns are scanned on save. No exfiltration, shell execution, or hardcoded credentials were observed in the visible code, though the review was truncated and some files (mutation pipeline, secret scanner, web viewer, launcher-env) were not visible, so the assessment is partial. Supply chain analysis found 6 known vulnerabilities in dependencies (0 critical, 3 high severity). Package verification found 1 issue.
6 files analyzed · 14 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
What You'll Need
Set these up before or after installing:
Environment variable: KNOWLEDGE_STORE_PATH
Environment variable: INDEX_DB_PATH
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"cardloom-mcp": {
"command": "npx",
"args": [
"-y",
"cardloom-mcp@1.1.2"
],
"env": {
"INDEX_DB_PATH": "your-index-db-path-here",
"KNOWLEDGE_STORE_PATH": "your-knowledge-store-path-here"
}
}
}
}Some servers take additional arguments. See the repository for details.
Documentation
View on GitHubFrom the project's GitHub README.
cardloom-mcp
Save engineering decisions and fixes your coding agent can look up later. Give your agent instructions to search before answering and to save new lessons as draft cards. Search returns verified cards by default, and you decide what gets verified. Cards are plain markdown in a git repository, and search is a local SQLite index with no LLM on the read path. It works with any MCP client, such as Claude Code, Cursor or Codex.
How it works
- Cards. One markdown file per lesson: a
decision,gotcha(with the error message inerror_signature),pattern,playbookorsnippet, tagged with the stack, versions and project it applies to. - Lifecycle.
draft → verified → deprecated. An agent can only create drafts; a human approves (verified) or retires (deprecated) them. Deprecated is final and the file is kept for history. Merge promotion can optionally verify drafts whose source commit was merged. Search returns verified cards by default; drafts and deprecated cards only on request, always labelled. - Git is the source of truth.
cards/*.mdandevents/*.jsonlare committed locally. The SQLite index is derived and can be rebuilt at any time. Syncing between machines is an ordinary git push/pull that you run; the server never touches a remote. - Search. Full-text search (SQLite FTS5) with matching on stack, version and project. Every result says how it matched, so an agent can tell a real hit from a loose one, and carries a trust score from usage feedback and age.
- Checks on save and read. Draft and deprecated content is labelled
untrusted/deprecatedin every response, secret patterns are rejected on save, and a card that conflicts with an existing one is refused instead of silently overwriting it.
The agent searches before it works, reports whether a card helped, and saves what it learned as a draft. You decide what a draft becomes:
Tools
| Tool | What it does |
|---|---|
search_knowledge | Find cards by keywords or a pasted error message; returns compact results with a match label. |
get_card | Read one card in full (also available as the resource knowledge://card/{id}, which always returns the full body). Optional compact: true returns only the first 600 characters of the body (cut on a character boundary, then …; truncated: true is set only when something was cut); everything else is unchanged, and the default is the full body. Carries source (repo, 7-character commit, approved_at date; each null when unknown) so you can tell where it came from. Reports replacement.pending (a draft proposes to replace it; it is still the current answer) and replacement.superseded_by (read that card instead). |
save_learning_draft | Save a new card as a draft. |
update_card_status | Verify, deprecate or reconfirm a card; agents should call it only when you tell them to. |
report_card_usage | Report whether a card helped: confirmed, refuted or neutral. |
There is also one prompt, distill_project_knowledge, which guides an agent through turning an existing
project's docs and history into draft cards.
Quickstart
Five steps from an empty knowledge store to your first trusted card:
-
Register the server and the usage instructions with every agent CLI found on your machine (Claude Code, Codex, Gemini CLI). The first command only prints what it would do:
npx -y cardloom-mcp install npx -y cardloom-mcp install --yesinstall --yesregisters the server for all your projects and adds the instruction block betweenandin~/.claude/CLAUDE.md,~/.codex/AGENTS.md(or$CODEX_HOME/AGENTS.md) and~/.gemini/GEMINI.md. It never touches acardloomentry that runs another command, and running it again finishes whatever failed without duplicating the block (see Set it up once for all projects). To register by hand for one project instead:claude mcp add cardloom -- npx -y cardloom-mcp -
Run
npx cardloom-mcp doctorto see the store path and card counts by status. If there are no verified cards, it points you back to this quickstart. The check is read-only. -
Ask your agent to save one gotcha it just hit, for example: "Save what we learned about this error as a gotcha card, and put the exact error message in
error_signature." The agent callssave_learning_draft; the card lands asdraft. -
Approve it in chat: "Verify that card." The agent calls
update_card_statuswith actionverify. Until you do this, the draft stays out of default search (see Approving knowledge in chat). -
Search for it: ask the agent to call
search_knowledgewith the exacterror_signaturetext you saved. With default settings the card comes back withmatch: "exact_signature".
To label results for the repo you are working in, add a .knowledge-map.yaml at that repo's root
(details in .knowledge-map.yaml):
project: acme/billing-api
stack:
- node
domain: backend
To have your agent use the tools without being asked each time, see Enforcing usage.
Setup
The server exposes the same five tools with each setup option.
Options 2 and 3 run from a clone: git clone https://github.com/bangca85/cardloom-mcp.git && cd cardloom-mcp.
Option 1: npx (no clone, no Docker)
Needs Node 22 or newer (CI runs 22 and 24). The launcher keeps your cards in
~/.cardloom/knowledge-store and the SQLite index in ~/.cardloom/index.db; set
KNOWLEDGE_STORE_PATH / INDEX_DB_PATH to put them elsewhere.
claude mcp add cardloom -- npx -y cardloom-mcp
npx cardloom-mcp doctor # read-only health check: store path, card counts by status
claude mcp add registers the server for the current project only; add --scope user to use it
everywhere (see Set it up once for all projects).
Other clients use the same command. Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"cardloom": { "command": "npx", "args": ["-y", "cardloom-mcp"] }
}
}
Codex (~/.codex/config.toml):
[mcp_servers.cardloom]
command = "npx"
args = ["-y", "cardloom-mcp"]
The SQLite driver (better-sqlite3) ships prebuilt binaries for common platforms; elsewhere npm
compiles it, which needs a C++ toolchain.
Option 2: Docker
-
Build the server:
npm install npm run build -
Build the container image:
docker compose build -
Register the server with your MCP client using the wrapper script at
bin/cardloom-mcp.sh— use an absolute path, since MCP clients spawn the command with an arbitrary working directory and the wrapper needs to finddocker-compose.ymlregardless.Claude Code:
claude mcp add cardloom -- /absolute/path/to/cardloom-mcp/bin/cardloom-mcp.shCursor (
~/.cursor/mcp.json):{ "mcpServers": { "cardloom": { "command": "/absolute/path/to/cardloom-mcp/bin/cardloom-mcp.sh" } } }Codex CLI / Codex extension (VS Code) (
~/.codex/config.toml):[mcp_servers.cardloom] command = "/absolute/path/to/cardloom-mcp/bin/cardloom-mcp.sh" args = []Or via the Codex Settings UI → MCP servers → Connect to a custom MCP (writes to the same
config.toml): Namecardloom, TypeSTDIO, Command to launch =/absolute/path/to/cardloom-mcp/bin/cardloom-mcp.sh, leave Arguments/Environment variables/Working directory empty, Save. -
Verify: ask your client to list MCP tools. You should see exactly 5 —
search_knowledge,get_card,save_learning_draft,update_card_status,report_card_usage— plus one resource template,knowledge://card/{id}, and one Prompt,distill_project_knowledge(see Ingesting an existing project).
Each MCP session starts a fresh container (docker compose run --rm -i) that exits when the client
disconnects. Cards live in ./knowledge-store (a bind mount: human-editable and git-tracked). The SQLite
index lives in a separate named Docker volume, because a SQLite file on a macOS bind mount is unreliable;
never touch it by hand, it is fully disposable and rebuilds from knowledge-store/ (see
npm run rebuild-index).
Option 3: Native from a clone (no Docker)
Docker on macOS runs a Linux VM (Virtualization.framework) underneath, which reserves several GB
of RAM regardless of how small the container's own workload is. The server itself is light —
measured at ~100MB RSS for the MCP process and ~71MB for the web viewer, both idle at 0% CPU — so
running directly on the host with plain node skips the VM overhead entirely.
npm install
npm run build
Register the server with your MCP client using node directly instead of the Docker wrapper:
{
"mcpServers": {
"cardloom": {
"command": "node",
"args": ["/absolute/path/to/cardloom-mcp/dist/index.js"],
"env": {
"KNOWLEDGE_STORE_PATH": "/absolute/path/to/cardloom-mcp/knowledge-store",
"INDEX_DB_PATH": "/absolute/path/to/cardloom-mcp/.metadata/index.db"
}
}
}
}
Trade-off: you lose container isolation, and git commits use your host's git config. The SQLite
index and its write lock live on your local filesystem, so there is no bind-mount quirk to worry about.
Configuration
Every setting is an environment variable and every one is optional.
| Variable | Default | Meaning |
|---|---|---|
KNOWLEDGE_STORE_PATH | ~/.cardloom/knowledge-store with npx, ./knowledge-store otherwise | Where cards (cards/), usage events (events/) and your benchmark live. It is its own git repository. |
INDEX_DB_PATH | ~/.cardloom/index.db with npx, <store>/.metadata/index.db otherwise | The SQLite index. Derived data, safe to delete. |
SEARCH_FALLBACK | tiered | tiered: when exact-word search finds fewer than limit cards, add partial matches labelled related. off: exact-word search only. |
SEARCH_RANKING | baseline | Result order: baseline or the opt-in x / y. See How search works. |
STALE_THRESHOLD_DAYS | 180 | A verified card older than this is flagged stale. |
REVIEW_FAILURE_THRESHOLD | 2 | A card with this many refuted reports is flagged needs_review. |
REVIEWER_NAME | human-reviewer | Recorded as verified_by when a card is approved. |
KNOWLEDGE_MACHINE_ID | the host name | Names this machine's usage log (events/<id>.jsonl) so two machines never write the same file. |
CARDLOOM_TELEMETRY | off | local records how each search ended in telemetry.jsonl beside the index, for gaps. Anything else is off. See Knowledge gaps. |
CARDLOOM_TELEMETRY_PATH | beside the index | Absolute path of the telemetry file. Refused if it is inside the knowledge store. |
CARDLOOM_TELEMETRY_SAMPLES | off | 1 or true also records the text of searches that found no direct answer. A separate opt-in; read the warning under Knowledge gaps. |
PROMOTION_MODE and the other PROMOTION_* | see Merge promotion | Control npm run promote-merged. |
PORT | 3334 | Web viewer port. |
GRAPH_GENERIC_STACK_TAGS, MAX_SHARED_STACK_GROUP_SIZE, MAX_SHARED_STACK_EDGES | empty, 50, 5000 | Web viewer graph tuning. |
How search works
search_knowledge(query, context) takes keywords or a pasted error message. context carries the
calling repo's stack, versions, project and aliases (see
.knowledge-map.yaml).
Each result says how it matched:
match | Meaning |
|---|---|
exact_signature | The card's error_signature appears in your query. It is checked on the stored text, so ERR-42 does not match ERR_42. |
exact_identifier | Your query contains an identifier from the card's error_signature, such as ITMS-90683 or AccessDeniedException. |
exact_title | Your query is the card's whole title. |
all_terms | Every word of your query is in the card. |
related | Only some of the words match. |
When all returned cards are partial matches, the response includes no_direct_match: true. Use those
cards as leads for a follow-up search, not as an answer. Set SEARCH_FALLBACK=off to get only cards that
match all words.
search_knowledge returns at most 5 cards by default (it was 10 in earlier versions). Pass limit for more,
for example limit: 10. With the tiered fallback, partial matches are added only when fewer than limit cards
match every word.
Search results stay compact and do not carry source: adding repo, commit and approval date to every result
raised the estimated response size by about 17% at limit 5. get_card returns it for the one card you read:
source: { repo, commit, approved_at }. repo is the card's source_repo, else the first applies_to entry when that looks like owner/name (a guess; component
names such as api give null);
commit is the sha found in source_commit, shortened to 7 characters; approved_at is the date part of
last_verified (null for a draft). Each field is null when it is unknown.
By default only verified, non-restricted cards are returned. include_drafts, include_deprecated and
include_restricted opt in, and those cards are always labelled. Each result also carries a trust score
and flags: drift (the card's version range does not match the caller's), stale and needs_review.
With a project in the context, results also say whether a card belongs to this project, is shared, or
applies to another project; cards for other projects are never hidden.
Ranking. The default (SEARCH_RANKING=baseline) orders results by stack and version match, then text
relevance, then trust. The x and y modes also rank by project. They are opt-in because, in our
benchmark, putting the project ahead of the text score pushed exact matches from shared cards below weaker
matches from the caller's own project. Run npm run benchmark -- --matrix against your own store before
enabling them.
What is tested
tests/integration/trust-guarantees.test.ts checks the JSON
that search_knowledge and get_card return, not internal objects, for these behaviours:
- Filtered by default. A default search does not return draft, deprecated or restricted cards, and does not return a card that has been superseded.
- Labelled when requested. With
include_drafts, a draft is returned withuntrusted: true; withinclude_deprecated, a deprecated card is returned withdeprecated: true; withinclude_restricted, a restricted card is returned withrestricted: true.get_cardlabels the same three cards the same way (and returns thedeprecation_reason). - Flagged when old. A card last verified more than
STALE_THRESHOLD_DAYSago carriesflags.stale: truein search results (the test uses a card verified 400 days before a fixed date). - Replacement reported.
get_cardon a superseded card names the card that replaced it inreplacement.superseded_by.
The test shows what the server returns and how it labels it. Whether an agent acts on those labels is not covered by this test.
.knowledge-map.yaml — giving the agent context per repo
Add a .knowledge-map.yaml to the root of each project you work on. Your agent reads it and passes the
project and stack details to search_knowledge, so results are matched against your stack and versions:
# .knowledge-map.yaml — lives in the root of each project repo you work in
project: acme/billing-api
aliases: # optional: other names this project has had in existing cards
- billing-api
stack:
- nextjs@15
- postgres@16
- node
domain: backend
project: is the key the agent passes as context.project (and aliases: as context.aliases)
so results are labelled by scope (this project, shared, other project); they are ranked by project
only when SEARCH_RANKING is set to x or y. Cards for other projects are never hidden.
Older maps that use repo: instead of project: are still accepted by clients.
Workflow for a brand-new repo:
- Ask the agent to inspect the repo (package.json, lockfiles, etc.) and generate a draft
.knowledge-map.yaml. - Review and edit it yourself — fix wrong stack detection, add domain hints.
- Commit it into the project repo (not
cardloom-mcp). - Point your agent/client at it so
search_knowledgecalls includecontext: {stack, versions, project, aliases}read from that file.
Session context
npx cardloom-mcp context prints a short list of the verified cards that matter for the project you are
standing in, so an agent starts a session already knowing them. It is meant for a Claude Code SessionStart
hook, whose output is added to the session. It is opt-in: nothing registers it unless you do.
What it prints (nothing else, and nothing at all when the list would be empty):
# Cardloom: verified cards for acme/billing-api
- Retry payments at most twice (pattern-payment-retry): Retry a payment request at most twice, then surface the error.
- Lock before writing (gotcha-write-lock): Take the write lock before touching the index.
Use search_knowledge/get_card for details.
- Which cards:
verifiedandsensitivity: normalonly, and only cards of this project (theproject:key of.knowledge-map.yamlin the current directory, or one of itsaliases:), global cards, and stack-scoped cards whose stack intersects the map'sstack:. Drafts, deprecated, restricted, stale and needs-review cards are never printed. Without a.knowledge-map.yaml(and without--project <key>, which replaces the map) it prints nothing. - Order and size: highest trust first, then most used, then id. At most 5 cards (
--max-cards) and an estimated 800 tokens in total (--max-estimated-tokens; the figure is an estimate, characters divided by 4, not a tokenizer count). Each summary is the first sentence of the card, at most 160 characters. Cards are dropped from the end until the output fits; if not even one fits, nothing is printed. - Read-only: it opens the existing index (
INDEX_DB_PATH,~/.cardloom/index.dbby default) for reading and never builds, migrates or creates anything, not even the-walfiles of a WAL index. If the index is missing, unreadable or from an older version, or the store is empty, it prints nothing and exits 0, so a session never breaks. Start the server once to have an index (thenpxserver builds~/.cardloom/index.db).npm run rebuild-indexfrom a clone builds the clone's own index (<store>/.metadata/index.dbunlessINDEX_DB_PATHis set), which is not the file the hook reads unless both point at the sameINDEX_DB_PATH.
Register it with one command (it prints the plan; add --yes to apply):
npx cardloom-mcp install --hooks # plan: shows the change to ~/.claude/settings.json
npx cardloom-mcp install --hooks --yes # applies it
--hooks alone changes only ~/.claude/settings.json (Claude Code; codex and gemini have no hook here). The file
is parsed strictly and an invalid one is refused and left untouched; everything else in it, and its indentation, are
kept, and running it again does not add a second entry. To use it together with the normal setup, add --agent
(for example install --agent claude --hooks --yes). To do it by hand, add this to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [
{ "hooks": [{ "type": "command", "command": "npx -y cardloom-mcp context", "timeout": 15 }] }
]
}
}
Things to know before relying on it:
- Docker users get no session context. The hook runs on the host and reads the index at
~/.cardloom/index.db(orINDEX_DB_PATH), not the index in the Docker named volume, so with a Docker-only setup it prints nothing. npx -y cardloom-mcp contextmay contact the npm registry on every session start, which can slow the start of a session. For a faster hook, install the package globally (npm install -g cardloom-mcp) and register the commandcardloom-mcp contextinstead.install --hooksregisters thenpx -yform, so edit thecommandin~/.claude/settings.jsonto switch. The entryinstall --hookswrites has"timeout": 15(seconds), so a slow or offline registry cannot hold up a session start for long; an entry you wrote without a timeout is still recognised and left as it is.- A custom
INDEX_DB_PATHmust reach the hook too. The hook is a separate process from the MCP server, so anINDEX_DB_PATHset only in your MCP configenvis not seen by it: it reads the default~/.cardloom/index.dbinstead, or prints nothing when that file is missing. Hook commands run in a shell, so put the variable in the command itself, for example"command": "INDEX_DB_PATH=/absolute/path/index.db npx -y cardloom-mcp context". npm run contextfrom a clone reads the clone's own.knowledge-map.yaml(the current directory) and needsINDEX_DB_PATHset to the index to read; without it, it prints nothing.
Enforcing usage (CLAUDE.md / AGENTS.md / GEMINI.md)
Nothing forces the agent to call these tools — MCP tools only fire when the model decides to. To have your agent search before answering, report whether a card helped, and save new lessons as drafts, give it the instructions below, in either of two places:
- Globally, once for every project: put the block in your client's global instructions file. See Set it up once for all projects.
- Per project: put it in the repo's own
CLAUDE.md(Claude Code),AGENTS.md(Codex) orGEMINI.md(Gemini CLI). Codex does not readCLAUDE.md, and Gemini CLI readsAGENTS.mdonly if you list it incontext.fileName. If several clients work in the repo, add the block to each client's file.
Use one place or the other: the same block in both only costs tokens.
## Knowledge Hub (MCP `cardloom`) — required
**Before answering/implementing a task touching a known domain** (auth, rate-limiting,
third-party API contracts, infra gotchas, etc.): call `search_knowledge(query, context)` first,
with `context` read from `.knowledge-map.yaml` at this repo's root (`stack`, `versions`, and
`project` / `aliases` so results are labelled for this repo). A result with `match: related`,
or a response with `no_direct_match: true`, is a partial match: use it as a lead for another search, not as an answer.
**If that file doesn't exist yet**, generate a draft yourself before proceeding — inspect this
repo's manifest (package.json / pubspec.yaml / go.mod / requirements.txt, lockfiles) for the
real stack + versions, write it in this shape, then ask the human to review before you rely on it:
```yaml
# .knowledge-map.yaml — repo root, human-reviewed after you draft it
project: <owner/repo-name>
aliases: [] # optional: other names this project has had in existing cards
stack:
- <tech>@<version>
- <tech>@<version>
domain: <frontend|backend|infra|product|...>
```
Don't re-derive something a `verified` card already answers. When a returned card from another project helps, say which project and commit it came from (`get_card` shows its "source").
**After using a returned card — you MUST call `report_card_usage(id, outcome)`**
(`confirmed`/`refuted`/`neutral`). This is not optional — every search/get_card response carries
a `write_back_reminder`; skipping it lets trust scores and `needs_review` flags drift stale.
**Learned something new** (a decision, pattern, or gotcha with no existing card, or a refinement
of an existing one) → call `save_learning_draft`. It always lands as `draft` — never verify it
yourself. Put a bare commit sha in `source_commit` and the repo's GitHub `owner/name` in
`source_repo` whenever the learning comes from a commit: that is what lets merge promotion find
it. Free text there ("working tree", "local changes") means the card can only ever be approved by hand.
**Found a major mismatch between a `verified` card and current reality** (the card says A, the
code/logs/API actually do B — a real contradiction, not a nuance): **stop, don't silently trust
either side.** Lay out:
- which card, what it currently claims (`id` + summary)
- what you actually observed (specific file/log/response)
- the two possible resolutions: the card is stale/wrong → deprecate it + save a new card with
`supersedes`, or the code is the regression → fix the code and leave the card as-is
then ask for confirmation on which direction before calling `update_card_status` or
`save_learning_draft(supersedes=...)`. Don't decide alone when the mismatch affects an
architecture or security call.
Set it up once for all projects
npx -y cardloom-mcp install --yes does everything in this section for the agent CLIs it finds on PATH
(--agent claude|codex|gemini limits it, and it can be repeated). Without --yes it prints the plan and changes
nothing.
- It skips registering when a server named exactly
cardloomalready runscardloom-mcp(for Claude Code only a user-scope entry counts: a local or project-scope one is not global, socardloomis registered again at user scope), and writes the instructions anyway. Ifcardloomexists with another command (a dev checkout, say), it leaves that entry alone, says so, and writes no instructions for that agent. A server namedcardloom-devis not touched. - The instruction block goes between
and; text outside the markers is never changed and a second run replaces the block instead of adding another. If a marker is unmatched or repeated, that agent fails and its file is left as it was. A file that already has the## Knowledge Hub (MCP `cardloom`)section pasted without markers is left alone too, with a note saying to wrap it in the markers or delete it so a later run can keep it current. - Any agent that fails makes the command exit 1 with a summary; run it again to finish the rest.
- Even without
--yesit runsclaude mcp get cardloomandgemini mcp list(andcodex mcp list --json) to see what is registered, and the first two may start the MCP servers you have configured. They run from an empty temporary directory, so only user-level entries are seen.
To do it by hand, register the server for every project and put the instruction block above in the client's global file:
| Client | Register the server for all projects | Global instructions file |
|---|---|---|
| Claude Code | claude mcp add --scope user cardloom -- npx -y cardloom-mcp | ~/.claude/CLAUDE.md |
| Codex (OpenAI's coding agent) | codex mcp add cardloom -- npx -y cardloom-mcp | ~/.codex/AGENTS.md |
| Gemini CLI | gemini mcp add --scope user cardloom npx -y cardloom-mcp | ~/.gemini/GEMINI.md |
-
Scope matters.
claude mcp addandgemini mcp addregister the server for the current project only unless you pass--scope user, so the Quickstart command is project-scoped.codex mcp addwrites~/.codex/config.toml, which is already global. -
Codex. Use
~/.codex/AGENTS.override.mdfor a temporary global override without touching the base file. If you setCODEX_HOME, both files live there instead of~/.codex. -
Gemini CLI. You can also add the server by hand to
~/.gemini/settings.json(merge it with what is already there):{ "mcpServers": { "cardloom": { "command": "npx", "args": ["-y", "cardloom-mcp"] } } }To make Gemini CLI read an
AGENTS.mdas well, set"context": { "fileName": ["AGENTS.md", "GEMINI.md"] }in the same file. -
ChatGPT. The ChatGPT chat apps do not read these files; Codex is the OpenAI client covered here.
-
Check it worked. Run
claude mcp list,codex mcp listorgemini mcp listand look forcardloom, then ask the agent to list its MCP tools. In Gemini CLI,/memory showprints the instructions it loaded.
Approving knowledge in chat
Every card an agent saves via save_learning_draft starts in status: draft and stays out of default search
until it is verified. To promote or retire one:
- Approve: tell the agent to approve a card; it calls
update_card_status(id, "verify"). Status flips toverified, and if the card declaredsupersedes: <old-id>, the old card is deprecated in the same operation (one commit). If that old card was already replaced by another card, the approval is refused withinvalid_transition(<old-id> is already superseded by <other-id>) and nothing changes; the draft stays a draft and can still be deprecated. - Reject / retire: tell the agent to deprecate a card with a reason; it calls
update_card_status(id, "deprecate", reason). The file is kept (a retired card is never deleted) and disappears from default search, but stays readable viaget_card. - Reject a draft: when the learning is wrong, a duplicate or not worth keeping, start the reason
with
rejected:(for examplerejected: duplicate of pattern-foo). The web viewer's "Reject" button on a draft does this for you.distill_project_knowledgereads that prefix and tells the agent not to save the same learning again unless the new draft says what is different.
Re-confirming old cards
A verified card last verified more than STALE_THRESHOLD_DAYS ago is flagged stale. If you check it and it is
still right, re-confirm it instead of verifying a new card: update_card_status(id, "reconfirm") keeps the card
verified, sets last_verified to now and writes verification_method: reconfirmed:<previous method> (one
prefix, however many times). Nothing else changes: not the status, not verified_by, not the usage counters.
It is refused for a card that needs review (refuted REVIEW_FAILURE_THRESHOLD times or more): supersede it with
a corrected card instead. From the shell:
npx cardloom-mcp reconfirm --stale # list stale cards, oldest first, with id, title, age and a hash (--json for scripts)
npx cardloom-mcp reconfirm --confirm pattern-a@<hash>,gotcha-b@<hash> --by alice
--confirm re-confirms each id@hash it is given and refuses an entry whose card file changed since it was listed
(the hash is checked under the write lock), has an unknown id, or needs review; the other entries are still applied,
each refusal is printed on stderr and the exit code is 1. --by defaults to REVIEWER_NAME and is recorded in
the git commit message (knowledge: reconfirm <id> (by <name>)), not in the card file; the name is trimmed to one line of at most 80 characters.
Through update_card_status, by is optional and defaults the same way. From a clone: npm run reconfirm -- --stale.
npm run doctor shows how review is going: drafts waiting (and the age of the oldest), cards approved by
a human, by merge promotion, rejected, and retired before review, and the human approval rate (of drafts a
human approved or rejected; merge promotion and retired drafts are listed beside it, not in it). A card counts
as merge promotion only when its verification_method is exactly what promote-merged writes in auto mode
(merged:<repo>@<sha> (<via> <date>)); the same evidence with +chat-approval after it, which is what you get
when you approve a candidate in chat, counts as a human approval. reconfirm does not change who first approved a card, so a re-confirmed auto-promoted card still counts as merge promotion. A draft's
age is counted from the commit that added the card when the store is a git repository, otherwise from the
card file's modification time.
deprecated is terminal — there's no un-deprecate. To bring a retired idea back, save a new card
with supersedes pointing at the old one and approve it.
Triaging drafts
npx cardloom-mcp triage (or npm run triage-drafts from a clone) lists every draft with the cards you may
want to look at before deciding: same type and a similar title (Jaccard overlap of the title words, 0.5 or
more) or overlapping facets, plus the card the draft supersedes (shown as this draft replaces it). Each line shows the card's status, title
similarity, whether the facets overlap and whether it is the same project. It also says when that card was
already replaced (superseded by <id>) or rejected. Drafts with nothing to compare are listed under "No
related card". The report is evidence only: it gives no verdict and changes nothing, and facet overlap does
not predict what verify will do (verify does not run the conflict check). --limit <n> examines only the
oldest n drafts; --json prints the report as JSON. It reads the card files, not index.db, so it works
without the server running.
Reading the report
npx cardloom-mcp report shows what the store did in the last 7 days (--days <n> for another window, up to 36500, --json for
scripts): how many times cards were reported confirmed, refuted and neutral, the five cards confirmed most
often, cards that now need a look, verified cards that go stale within 30 days, and how many drafts are waiting.
$ npx cardloom-mcp report
Last 7 days: 3 confirmed · 1 refuted · 1 neutral
Cards that helped most
pattern-retry-payments · Retry payment requests with backoff (3)
Cards that need a look
gotcha-old-config
Cards going stale within 30 days
gotcha-old-config
Drafts waiting: 1 (oldest 0 days)
"Cards that need a look" lists cards whose total refutes reached REVIEW_FAILURE_THRESHOLD (default 2) and that
were refuted at least once inside the window. "Going stale" means the card's last verification is between
STALE_THRESHOLD_DAYS minus 30 days (exclusive) and STALE_THRESHOLD_DAYS (default 180, inclusive) old. With no
usage at all in the window it prints No activity in the last N days. instead of the counts. The numbers come from
the usage events in events/*.jsonl (the same ones that feed the trust counters); the report is read-only, never
creates the store and works without the server running.
Checking an upgrade
Before bumping a dependency, ask which verified cards it affects. Run this in a repo that has a
.knowledge-map.yaml whose stack lists the tech with a
version (nextjs@14.2.0), and pass the version you are moving to:
$ npx cardloom-mcp upgrade-check --to nextjs@15.0.0
nextjs 14.2.0 -> 15.0.0
Stop applying (1)
pattern-old · Old routing rule
Start applying (1)
pattern-new · New caching default
Apply to both (1)
pattern-both · Image config applies to both
Cards are matched on the card's version_range with the same rule search uses for its drift flag. Only verified,
non-restricted cards that name the tech in their stack and have a version_range other than * are listed, sorted
by id, at most 20 per list (a list that reached 20 says so). --to can be repeated for several techs; a tech that
is not in the map, or that has no version there, is an error naming it. --json prints the result as an array of
{ tech, from, to, stopApplying, startApplying, stillApplying } with card ids. It reads the card files, changes
nothing, and works without the server running.
Knowledge gaps
gaps answers "what do agents ask that the store cannot answer?". It is built on opt-in local telemetry, which is
off by default: with CARDLOOM_TELEMETRY unset the server never creates or writes the file.
$ CARDLOOM_TELEMETRY=local CARDLOOM_TELEMETRY_SAMPLES=1 npx cardloom-mcp # in your agent's MCP config env
$ npx cardloom-mcp gaps
5 searches since 2026-11-20T09:12:00.000Z
answered: 2
related only: 1
empty: 2
Questions with no direct answer
how to rotate the signing key (2)
retry budget for webhooks (1)
What is recorded, one JSON line per search_knowledge call: the time (UTC), the tool name, how many results came
back, the outcome (answered: at least one direct match; related_only: only partial matches; empty: nothing),
and the search time in milliseconds. That is all.
What is never recorded: card ids, results or their text, the context you pass, repo names. The search text is
recorded only when CARDLOOM_TELEMETRY_SAMPLES is 1 or true, only for searches that were not answered, cut to
200 characters, and left out when the secret scan flags it. The scan catches common credential formats only, and its
patterns are case-sensitive: a lower-case password: hunter2hunter2 line or a Slack-style xoxb-... token is not
caught. It does not remove customer names or internal terms either, which is why the text is a second opt-in.
Turn it on only if you are comfortable with questions typed by an agent being written to your disk.
Where the file lives: telemetry.jsonl next to the index (INDEX_DB_PATH's folder: ~/.cardloom with npx, the
cardloom-metadata volume in Docker), or exactly where CARDLOOM_TELEMETRY_PATH points (an absolute file path; a
relative value is ignored with a note on stderr). It is created with mode 0600 (owner read and write only). The
server refuses to write it inside the knowledge store, which is a git repository you might git add -A: if the
resolved path is the store or below it (symlinks are followed), nothing is created, one [telemetry] line goes to
stderr per process, and searches are unaffected. That is what happens when INDEX_DB_PATH is unset (the index then
sits in <store>/.metadata, as with npm start and npm run dev) and with the example .env, whose INDEX_DB_PATH
is under the store; set INDEX_DB_PATH or CARDLOOM_TELEMETRY_PATH outside the store to record. Nothing in trust, flags or ranking reads the file. Lines older than 90 days are
dropped, at most once per UTC day per server process. A failed write never changes a search response; it prints one
[telemetry] line on stderr per process at most. benchmark never records, even with the switch on.
npx cardloom-mcp gaps (or npm run gaps) reads the file. With Docker the file is in the named volume, which the
host cannot see, so npx cardloom-mcp gaps on the host says No telemetry yet; run
docker compose run --rm cardloom-mcp npm run gaps instead.
--json prints the report as JSON. It needs no index or
store and creates nothing. When the resolved path is inside the knowledge store it says Telemetry is not recorded while the index is inside the knowledge store. Set INDEX_DB_PATH or CARDLOOM_TELEMETRY_PATH outside it. Without the file it says No telemetry yet. Set CARDLOOM_TELEMETRY=local to start recording.
"Questions with no direct answer" lists the unanswered texts (lower-cased, whitespace collapsed, same text grouped)
by count, at most 10; when no line carries text it says search text is not recorded and how to turn it on.
Ingesting an existing project
Documentation truncated — see the full README on GitHub.
Reviews
No reviews yet
Be the first to review this server!
More Developer Tools MCP Servers
Rea
Freeby Morluto · Developer Tools
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Paperclip
Freeby Paperclipai · Developer Tools
Trending hip-hop artist momentum scores across four cultural dimensions.
Scrapling
Freeby D4Vinci · Developer Tools
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
Server Time
Freeby Modelcontextprotocol · Developer Tools
Current time lookup and conversion between IANA timezones
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
