# chainmemory [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/chaelynet/chainmemory-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 517  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/chainmemory

## Description
Permanent blockchain memory for AI agents.

## Tools
Capabilities this server exposes over MCP:

- **chainmemory_remember** — Write a permanent memory. FEE: 0.001 AIC. Auto-tags by content; importance 1-10. Use it for decisions, learnings and milestones worth keeping, not for small talk. Pass sealed:true to encrypt it in this client before sending (needs CHAINMEMORY_SEED_PHRASE): the server then stores a blob it cannot read, and the search vector is computed on this machine so the memory can still be found. NOTE ON EVIDENCE: the event_hash of a plain memory is computed when it syncs to the chain (~30 s), not at write time, so a memory written just now CANNOT yet be cited in update_project_state — that call would be rejected with 422. Sealed memories carry their hash from the client and are citable immediately.
- **chainmemory_new_seed** — Generate a fresh 12-word BIP-39 phrase for the blind vault. Created locally, never sent anywhere and never stored by this server: write it down on paper. Losing it means losing every memory sealed with it, for you and for everyone. Free, no fee.
- **chainmemory_open_sealed** — Read a sealed memory: fetches the encrypted blob and decrypts it locally with CHAINMEMORY_SEED_PHRASE. Only works for memories sealed with that same phrase. Free, read-only.
- **chainmemory_recall** — Recall the user's most recent memories, newest first. Use at conversation start for continuity. IMPORTANT: this returns an 80-character PREVIEW of each memory, not the full text — to read one in full use get_memory(#N), and to find something by meaning use search_memories.
- **search_memories** — SEMANTIC search over the user's memories (cosine similarity over cached embeddings, blended with recency and importance). Returns the FULL text of each match — unlike chainmemory_recall and list_memories_filtered, which return 80-character previews. Use this whenever you need to FIND something rather than list the latest. With the blind vault configured, the query is turned into a vector on this machine and only the vector is sent, and sealed matches are decrypted here.
- **get_memory** — Read ONE memory in full, decrypted from chain, with an integrity check: the server recomputes the event_hash from the plaintext and compares it against the hash anchored on-chain. Use it when a preview is not enough, or to prove a specific memory has not been altered. Requires the memory to be anchored already (freshly written memories anchor in ~30s).
- **get_memory_proof** — Get the shareable anchoring proof of one of your memories: event_hash plus its on-chain coordinates. A third party can verify that hash in the contract WITHOUT your API key, and the content is never exposed. This is the primitive behind 'verifiable without trusting the operator'. Free.
- **verify_project_state** — PUBLIC verification of a Project Brain: returns every anchored version with its state_hash and on-chain coordinates (anchor id, tx, block), plus the instructions to check them independently in the ProjectStateAnchor contract. Exposes no content — only hashes that are already public on-chain. Free, and the answer does not depend on trusting this server: call it, then verify on-chain yourself.
- **audit_memory** — Full forensic audit of ONE memory: recomputes its event_hash from the stored plaintext, compares it against the hash anchored on-chain, and reports its anchoring coordinates and seal state. COSTS 0.1 AIC unless dry_run is true. ALWAYS call it with dry_run first — the dry run returns the identical result without charging, so paying only makes sense when you need the paid receipt on record.
- **audit_state** — Full audit of a Project Brain: recomputes the state_hash of the current version with the deterministic engine, compares it against the stored one, and returns the on-chain anchor plus the version history. COSTS 5 AIC unless dry_run is true — the most expensive operation in the system. Do NOT call it without dry_run unless the user explicitly asked for the paid audit.
- **quote_inject** — Price an inject BEFORE paying for it: which memory ids exist, which do not, total characters, estimated tokens, the exact AIC cost with its burn/treasury split, and whether the wallet balance covers it. Free. Call it before inject_memories whenever the ids are not certain — inject charges 0.1 AIC even if you picked the wrong ones.
- **list_memories_filtered** — List memories filtered by project tag and archived status, newest first. Returns metadata plus an 80-character PREVIEW of each memory — not the full text. Use get_memory(#N) to read one in full, or search_memories to find by meaning.
- **update_memory_tags** — Replace the tags of an existing memory. Free. Tags are what keeps a memory findable by project, and the ONLY way to find a sealed one, since its content cannot be indexed. The project of a memory is stored as its first tag.
- **archive_memory** — Archive a memory: it stops appearing in recall, listings and inject, but stays on-chain and keeps its proof. Free and reversible with unarchive_memory. This is what to use instead of deleting — nothing is ever removed from the chain.
- **unarchive_memory** — Restore an archived memory so it shows up again in recall, listings and inject. Free. Nothing was ever deleted: archiving only hides it.
- **chainmemory_stats** — Public network statistics: chain id, current block, registered AIs, total and episodic memories, AIC supply. Free and needs NO API key. Use it to check the network is alive — not to count your own memories, which is what chainmemory_profile is for.
- **chainmemory_register** — Register an AI identity on-chain. Free, once per identity. Most users never need it: an identity is created automatically the first time an API key writes. Use it only if you want to register explicitly before the first write.
- **chainmemory_profile** — Get this AI's identity and memory counters: name, model, owner wallet, reputation, active status, and four counts that mean different things — chain_memories (anchored on-chain), local_memories (written), synced_memories and pending_sync. Free, read-only. Use it to check that writes are reaching the chain: pending_sync above zero means memories exist locally but are not anchored yet.
- **chainmemory_seal** — Seal a memory permanently with a direct contract call. FEE: 0.001 AIC, and it is the ONLY tool that needs a wallet private key in AICHAIN_KEY. Irreversible. Most memories never need this: chainmemory_remember already anchors them through the API. Use it only when you want to seal one yourself, without trusting the server to do it.
- **list_projects** — List the user's projects with their numeric id, slug, keywords and colour. Free, read-only. Call it before create_project to avoid duplicates, and before delete_project, which needs the NUMERIC id from here and rejects the slug.
- **create_project** — Create a project to group memories. Free. The project name becomes the FIRST TAG of every memory written under it, which is how list_memories_filtered finds them later — and the only way to find a sealed memory, whose content is not searchable. Call list_projects first to avoid duplicates.
- **delete_project** — Delete a project. Free. Takes the NUMERIC id from list_projects — passing the slug returns 400 'invalid id'. Memories keep their tag and stay findable; only the project metadata disappears, so nothing is lost.
- **list_project_templates** — List the built-in project templates with their ids. Free. Call it before add_project_from_template: that tool needs one of these ids and they are not guessable.
- **add_project_from_template** — Create a project from a built-in template, with its auto-tagging keywords already set. Free. Call list_project_templates first: the template id is required and cannot be guessed.
- **get_my_context** — Retrieve the user's portable conversation history ACROSS PROVIDERS: a condensed summary plus recent memories from ChatGPT, Claude, Gemini, Perplexity and others, with their verification status. Free, read-only. Use it ONCE when starting with a model that has no history of its own, to carry context between providers. For the latest memories of a specific project, or to keep working inside a session already under way, use chainmemory_recall instead — this one is broader and slower.
- **get_project_state** — Get the consolidated, verifiable STATE of a project from Project Brain: a structured object (phase, current_focus, vocabulary, constraints, decisions with confidence and cited memory IDs, open_risks, next_priorities, and `environment` — where and how the owner works: hosts, services, repositories and operating rules) distilled from your atomic memories. Use it at the START of work on a known project to load its current state instead of re-deriving context. Owner-scoped (returns only your own state). Includes state_hash (SHA3-256) for integrity.
- **get_project_brief** — Get a project's Brain as a ready-to-read BRIEF: plain text ordered by relevance and cut to a character budget — what changed since the last version you read, open risks (high first, with the priorities that mitigate them and a list of high risks nobody mitigates), active priorities with their full completion criterion, the owner's work rules, recent decisions with their scope, recent milestones, open questions, each constraint as a one-line rule, and items that have not been edited for a long time, headed by the state's on-chain anchor and how much of it cites evidence. Free, read-only, owner-scoped. The text is safe to paste into any chat: addresses, ports, server paths and security rules are replaced by [withheld] and counted. Use it at the START of a session to get oriented in a few thousand characters. Pass task (a priority id such as pri_0015) to get instead everything needed to work on that one priority: the priority in full, its completion criterion, the risks it mitigates, what else in the Brain mentions it, and every work rule and constraint. Use get_project_state instead when you need the full structured JSON (ids, evidence, metrics, environment, role contracts), and always before update_project_state. This local server remembers, per project and only on this machine, the last version it gave you, so the next call shows what changed since then; pass since to compare against a specific version. FULL LEVEL: level "full" adds the addresses, ports, server paths and security rules that the public level withholds. It works only with the owner's key, only if the owner set CHAINMEMORY_ALLOW_FULL=1 in this server's configuration, and every request is logged by ChainMemory. Request it only when the user asked for it in this conversation, and never paste its text anywhere else.
- **update_project_state** — Apply operations to a project's consolidated state (Project Brain). FEE: 0.05 AIC plus 0.005 per applied op. Ops come from the 30-op grammar (add_decision, add_milestone, add_risk, set_focus, add_env_host...); the server validates invariants, applies them with a deterministic builder and computes the new state_hash. Use after get_project_state + list_memories_filtered to see what actually changed. EVIDENCE IS WHAT MAKES THE STATE WORTH ANYTHING: cite the memories backing each op with evidence_memory_ids. An op with no evidence is stored with evidence_root 0x000...0 — state with no provenance, indistinguishable from your own opinion, and the chain seals it just the same because it verifies hashes, not correctness. If any cited memory cannot be resolved the WHOLE call is rejected with 422 and nothing is written or charged; the usual cause is citing a memory before it anchors. CLOSED VALUE SETS, a wrong one costs a rejected op: severity is low, med or high (NOT medium, NOT critical); risk status open, mitigated or closed; milestone status planned, in_progress or done; decision status proposed, confirmed, rejected or superseded; priority status active, done or dropped. LINK PRIORITIES TO RISKS: add_priority accepts mitigates (an array of risk ids such as ["risk_0044"]), and set_priority_risks {id, mitigates} replaces the risks an active priority mitigates ([] removes the link); a risk that does not exist or is closed is rejected. get_project_brief then shows which priority covers each risk and lists the high risks nobody mitigates.
- **list_role_contracts** — List the roles defined for a project, with their status and version. Call this BEFORE get_role_contract or assume_role when you do not already know the role_id — role ids are not guessable and a wrong guess costs a failed call. Only roles with status 'active' (signed by the owner) can be assumed.
- **get_role_contract** — Get a project's Verifiable Role Contract (VRC): purpose, rules with checks and severity, working protocol. Read it BEFORE working under a role. Human-authored and owner-signed; models read it, never write it.
- **list_role_sessions** — Audit trail of a project's Role Sessions: who assumed which role, on which platform, when, how it closed (manual or auto) and the closing summary. This is the record the VRC exists to produce. Free, read-only.
- **get_role_session** — Read one Role Session in full, including the contract version and hash it was pinned to, the Brain version and state_hash at the moment it opened, and its event_hash. Use it to verify exactly what a given session was bound to. Free, read-only.
- **assume_role** — Assume a project role under its Verifiable Role Contract, opening an audited Role Session (fee 0.001 AIC). Pins contract version+hash and Brain state_hash. Only 'active' (signed) contracts are assumable; one open session per role. Call at session start; close with release_role.
- **release_role** — Release an open Role Session with a closing summary (what was done, what is pending, next step). Sessions auto-release after 60 minutes.
- **get_inject_balance** — Check the user's AIC balance. Selective inject costs 0.1 AIC per call (Fee Schedule v1.0; split 50/50: half burned, half to treasury).
- **inject_memories** — Inject selected memories into the current conversation context. Costs 0.1 AIC per call (Fee Schedule v1.0; regardless of memory count, up to 50). Returns plaintexts ready to be used as context. The AIC charge is deflationary: 50% burned forever, 50% to ecosystem treasury. Optimistic mode: returns immediately, transactions confirm in background.
- **get_inject_history** — History of selective injects: timestamps, how many memories, cost in AIC and transaction hashes. Free, read-only. Use it to audit what was injected and what it cost; for the current balance use get_inject_balance, and to price an injection before paying use quote_inject.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "chainmemory": {
    "command": "npx",
    "args": ["-y","chainmemory-mcp"],
    "env": {
      "CHAINMEMORY_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `CHAINMEMORY_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What chainmemory does

chainmemory exposes the ChainMemory protocol through MCP, giving agents a persistent memory store whose records can be anchored on-chain and independently verified. It supports ordinary memories, sealed memories, project grouping, cross-provider context, and structured project state.

Memories can capture decisions, learnings, milestones, and other information worth retaining. The server can recall recent entries, search by meaning, retrieve a single entry in full, and provide proofs based on the memory's event hash and on-chain coordinates. Archiving hides a memory from normal listings and injection without removing it from the chain.

Project Brain tools consolidate atomic memories into structured state covering areas such as current focus, decisions, risks, priorities, constraints, environment, and milestones. State versions receive a SHA3-256 state hash and can include cited memory IDs as evidence.

## How it works

A normal write costs 0.001 AIC and is synchronized to the chain asynchronously; newly written plain memories may take about 30 seconds to become anchored. Sealed memories are encrypted locally with AES-256-GCM before transmission. Their search vectors are also computed locally, allowing semantic search without exposing the plaintext to the server. The blind vault uses a locally generated 12-word BIP-39 seed phrase. Losing that phrase prevents access to memories sealed with it.

Semantic search combines cosine similarity over cached embeddings with recency and importance. Recent-memory recall and filtered listings return 80-character previews, while semantic search and individual retrieval can return full text. Full retrieval performs an integrity check by comparing a recomputed event hash with the anchored hash.

Project state updates validate operations and evidence references before writing. A cited memory that is not yet resolvable causes the entire update to be rejected. Public verification exposes hashes and chain coordinates rather than memory content, so a verifier can check the result against the relevant contract independently.

## Setup and configuration

Configure the MCP server with `CHAINMEMORY_API_KEY`. `CHAINMEMORY_SEED_PHRASE` enables local decryption and encrypted writes for the blind vault. The server can generate a fresh phrase locally with `chainmemory_new_seed`; it is never stored by the server, so it must be recorded securely.

`CHAINMEMORY_ALLOW_FULL=1` enables the full project-brief level for the owner's key. Without it, briefs withhold addresses, ports, server paths, and security rules. Full-level requests are logged by ChainMemory. `AICHAIN_KEY` is only needed for the direct `chainmemory_seal` contract call, which is irreversible. The local embedding model is stored under `~/.chainmemory/models` by default and can be redirected with `CHAINMEMORY_MODELS_DIR`.

## Tools and capabilities

- Write, recall, search, decrypt, retrieve, archive, and restore memories.
- Update tags and filter memories by project and archived status.
- Generate memory proofs and run memory or Project Brain audits.
- Create projects directly or from built-in templates.
- Load portable context from other AI providers.
- Read and update structured project state with evidence citations.
- Inspect project roles and read owner-signed role contracts.
- Check identity counters, network statistics, and synchronization status.
- Quote injection costs before using paid memory injection operations.

Paid operations include memory writes, direct sealing, state updates, memory audits, state audits, and injection. Audit tools support a dry-run mode; the state audit is the most expensive operation and should not be run for payment without explicit approval.

## Limitations and notes

Sealed memories cannot be found by content alone; their tags are the way to locate them through filtered listings. Plain-memory hashes become citable only after chain synchronization, whereas sealed memories carry a client-generated hash immediately. `get_project_brief` is intended for orientation and can redact sensitive infrastructure details; use `get_project_state` when the complete structured JSON is required before a state update.

Project deletion removes project metadata but leaves memories and their tags intact. Archiving is reversible and does not delete on-chain data. The direct sealing tool requires a wallet private key and permanently seals the memory, so it should not be used as a routine alternative to normal writes.

_Full upstream README: https://allmcps.com/mcp/chainmemory/readme_

