# mentedb-mcp - Doramagic AI Context Pack

> Positioning: a pre-install experience and judgment asset. It helps the host AI get off to a good start, but it does not mean the project has already been installed, run, or validated.

## Sufficiency Principle

- **Sufficiency over compression**: The AI Context Pack should be sufficient for the host AI to understand the project's value, capability boundaries, entrypoints, risks, and evidence sources before starting work; it may be layered, but it does not aim for the shortest possible summary.
- **Compression policy**: Compress only noise and duplication, never context that affects judgment or the quality of the work.

## How the Host AI Should Use This

You are reading the AI Context Pack that Doramagic compiled for mentedb-mcp. Treat it as pre-work context: help the user understand who it fits, what it can do, how to start, what must be verified after install, and where the risks are. Do not claim that you have already installed, run, or executed the target project.

## Claim Consumption Rules

- **Fact source**: Repo Evidence + Claim/Evidence Graph; the Human Wiki only supplies salience, terminology, and narrative structure.
- **Minimum status for a fact**: `supported`
- `supported`: May be used as a project fact, but the answer must cite the claim_id and evidence path.
- `weak`: Usable only as a low-confidence lead; the user must be asked to keep verifying.
- `inferred`: Usable only for risk notes or open questions; must not be packaged as a project fact.
- `unverified`: Must not be used as fact; state clearly that evidence is insufficient.
- `contradicted`: Must show the conflicting sources and must not force a single version on the user's behalf.

## Who It Fits Best

- **Developers already using host AIs such as Claude/Codex/Cursor/Gemini**: The README or plugin config mentions multiple host AIs. Evidence: `README.md` Claim: `clm_0002` supported 0.86

## What It Can Do

- **Command-Line Startup or Install Flow** (Verify after install): The project documentation contains runnable commands; real use requires running them in a local or host environment. Evidence: `README.md` Claim: `clm_0001` supported 0.86

## How to Start

- `npx mentedb-mcp@latest setup copilot` Evidence: `README.md` Claim: `clm_0003` supported 0.86
- `npx mentedb-mcp@latest login` Evidence: `README.md` Claim: `clm_0004` supported 0.86
- `npx mentedb-mcp@latest setup claude-code` Evidence: `README.md` Claim: `clm_0005` supported 0.86
- `npx mentedb-mcp@latest status` Evidence: `README.md` Claim: `clm_0006` supported 0.86
- `npx mentedb-mcp@latest logout` Evidence: `README.md` Claim: `clm_0007` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Needs admin / security approval
- **Why**: Continuing may involve secrets, accounts, external services, or sensitive context; get admin or security approval first.

### 30-Second Read

- **What to do now**: Needs admin / security approval
- **Minimum safe next step**: Run Prompt Preview first; if credentials or an enterprise environment are involved, get approval before trialing
- **Do not trust yet**: Tool permission boundaries cannot be trusted before install.
- **Continuing will touch**: Command execution, Host AI configuration, Local environment or project files

### What You Can Trust Now

- **Target-audience signal: Developers already using host AIs such as Claude/Codex/Cursor/Gemini** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `README.md` Claim: `clm_0002` supported 0.86
- **Capability exists: Command-Line Startup or Install Flow** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `README.md` Claim: `clm_0001` supported 0.86
- **There are Quick Start / install-command signals** (supported): You can trust that the docs mention a startup or install entrypoint; do not run it directly in your primary environment because of that. Evidence: `README.md` Claim: `clm_0003` supported 0.86

### What You Cannot Trust Yet

- **Tool permission boundaries cannot be trusted before install.** (unverified): MCP/tool projects usually touch files, the network, the browser, or external APIs, so permissions and logs must be checked for real.
- **Real output quality cannot be trusted before install.** (unverified): Prompt Preview can only show how it guides you; it cannot prove result quality in the real project.
- **Host AI version compatibility cannot be trusted before install.** (unverified): Host loading rules and version differences across Claude, Cursor, Codex, Gemini, and others must be verified in a real environment.
- **That it will not pollute your existing host AI's behavior cannot be trusted directly.** (inferred): Skill, plugin, and AGENTS/CLAUDE/GEMINI instructions may change the host AI's default behavior. Evidence: `CLAUDE.md`
- **Safe rollback cannot be assumed by default.** (unverified): Unless the project clearly provides uninstall and recovery instructions, verify in an isolated environment first.
- **After a real install, is it compatible with the user's current host AI version?** (unverified): Compatibility can only be verified in the actual host environment.
- **Does the project's output quality meet the user's specific task?** (unverified): The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **Do the install commands require network access, permissions, or global writes?** (unverified): This affects install risk in both enterprise and personal environments. Evidence: `README.md`

### What Continuing Will Touch

- **Command execution**: Package managers, network downloads, the local plugin directory, project config, or the user's home directory. Why: Running the very first command can already change your environment; decide whether it is worth running first. Evidence: `README.md`
- **Host AI configuration**: The plugin, Skill, or rule-loading config of hosts like Claude/Codex/Cursor/Gemini/OpenCode. Why: Host configuration changes how the AI works afterward and may conflict with the user's existing rules. Evidence: `CLAUDE.md`
- **Local environment or project files**: Install results, plugin caches, project config, or local dependency directories. Why: The write scope and rollback path cannot be proven before install and need isolated verification. Evidence: `README.md`
- **Environment variables / API keys**: Project entry docs explicitly showing API key, token, secret, or account credential configuration. Why: If a real install needs credentials, use test credentials first and go through a permission/compliance review. Evidence: `README.md`
- **Host AI context**: The AI Context Pack, Prompt Preview, Skill routing, risk rules, and project facts. Why: Importing context affects the host AI's later judgment, so avoid packaging unverified items as facts.

### Minimum Safe Next Steps

- **Run Prompt Preview first**: Use a pre-install interactive trial to judge whether the way of working fits; it needs no authorization or environment change. (applies when: Applies to any project, especially when output quality is unknown.)
- **Trial-install only in an isolated directory or a test account**: Avoid letting install commands pollute your primary host AI, real projects, or home directory. (applies when: When there are signals of command execution, plugin config, or local writes.)
- **Back up your host AI configuration first**: Skill, plugin, and rule files may change the default behavior of Claude/Cursor/Codex. (applies when: When there is a plugin manifest, a Skill, or a host rule entrypoint.)
- **Do not use real production credentials**: Once an environment variable / API key enters the host or toolchain, it can create account and compliance risk. (applies when: When environment signals like API, TOKEN, KEY, or SECRET appear.)
- **After install, verify just one minimal task**: Verify loading, compatibility, output quality, and rollback first, then decide whether to use it deeply. (applies when: When moving from a trial into a real workflow.)

### Exit Plan

- **Preserve the pre-install state**: Record the original host config and project state so you can later judge whether it is recoverable.
- **Be ready to remove the host plugin / Skill / rule entrypoint**: If behavior is off after the trial install, you can restore the host AI to its pre-trial state.
- **Record the install commands and written paths**: Without clear uninstall instructions, you at least need to know which directories or configs to clean up manually.
- **Be ready to revoke test API keys or tokens**: If test credentials leak or are misused, you can cut losses quickly.
- **If there is no rollback path, do not enter your primary environment**: No rollback is a blocker before continuing; do not proceed on trust or luck.

## What Can Only Be Previewed

- Explain who the project fits and what it can do
- Demonstrate a typical conversation flow based on project docs
- Help the user decide whether it is worth installing or researching further

## What Must Be Verified After Install

- Actually installing the Skill, plugin, or CLI
- Running scripts, modifying local files, or accessing external services
- Verifying real output quality, performance, and compatibility

## Boundary & Risk Decision Card

- **Mistaking the pre-install preview for a real run**: The user may overestimate how much configuration, permission, and compatibility verification the project has already done. Mitigation: Clearly separate prompt_preview_can_do from runtime_required. Claim: `clm_0008` inferred 0.45
- **Command execution will modify the local environment**: Install commands may write to the user's home directory, the host plugin directory, or project configuration. Mitigation: Run in an isolated environment or a test account first. Evidence: `README.md` Claim: `clm_0009` supported 0.86
- **To confirm**: After a real install, is it compatible with the user's current host AI version?. Why: Compatibility can only be verified in the actual host environment.
- **To confirm**: Does the project's output quality meet the user's specific task?. Why: The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **To confirm**: Do the install commands require network access, permissions, or global writes?. Why: This affects install risk in both enterprise and personal environments.

## Pre-Work Working Context

### Loading Order

- First read how_to_use.host_ai_instruction to establish the boundaries of this pre-install judgment asset.
- Read claim_graph_summary to confirm facts come from the Claim/Evidence Graph, not the Human Wiki narrative.
- Then read intended_users, capabilities, and quick_start_candidates to judge whether the user is a match.
- When you need to carry out a concrete task, check role_skill_index first, then evidence_index.
- For real install, file modification, network access, performance, or compatibility questions, turn to risk_card and boundaries.runtime_required.

### Task Routes

- **Command-Line Startup or Install Flow**: State that this is an after-install capability first, then give a pre-install checklist. Boundary: Must be verified after a real install or run. Evidence: `README.md` Claim: `clm_0001` supported 0.86

### Context Scale

- Total files: 41
- Important-file coverage: 33/41
- Evidence index entries: 30
- Role / Skill entries: 3

### Handling Insufficient Evidence

- **missing_evidence**: State that evidence is insufficient and ask the user for the target file, a README section, or after-install verification records; do not fill in facts.
- **out_of_scope_request**: State that the task is beyond the current AI Context Pack's evidence scope and suggest the user check the Human Manual or verify after a real install.
- **runtime_request**: Provide a pre-install checklist and command sources, but do not run commands for the user or claim they have been run.
- **source_conflict**: Show the conflicting sources side by side, mark them as unverified, and do not force a single version.

## Prompt Recipes

### Fit assessment

- Goal: Judge whether this project fits the user's current task.
- Expected output: A fit conclusion, key reasons, evidence citations, what can be previewed before install, what must be verified after install, and a next-step recommendation.

```text
Based on the AI Context Pack for mentedb-mcp, ask me 3 necessary questions first, then judge whether it fits my task. The answer must cover: who it fits, what it can do, what it cannot do, whether it is worth installing, and where the evidence comes from. Every project fact must cite evidence_refs, source_paths, or a claim_id.
```

### Pre-install experience

- Goal: Let the user feel the core workflow before installing, while avoiding packaging the preview as real capability or a marketing promise.
- Expected output: An experience script with boundary labels, an after-install verification checklist, and a cautious recommendation; with no real-run promises or strong marketing language.

```text
Treat mentedb-mcp as a pre-install experience asset, not an already-installed tool or a real runtime environment.

Output exactly four parts:
1. Ask me 3 necessary questions first.
2. Give an "experience script": use the three labels [Previewable before install], [Must verify after install], and [Insufficient evidence] to show how it might guide the workflow.
3. Give an after-install verification checklist: list which capabilities can only be confirmed after a real install, real host loading, and a real project run.
4. Give a cautious recommendation: only "worth researching/trialing further", "add information before deciding", or "not recommended to continue"; do not endorse the project.

Hard boundaries:
- Do not claim you have installed, run, executed tests, modified files, or produced real results.
- Do not write promise-like phrasing such as "auto-adapts", "guarantees passing", "perfect fit", or "strongly recommend installing".
- If you describe how it works after install, you must use a conditional such as "if installed successfully and the host loads the Skill correctly, it might...".
- The experience script may only be written as "example lines / hypothetical flow": use "might ask / might suggest / might show", not "has written, has generated, has passed, is running, is generating".
- Prompt Preview does not hand out install commands; if the user is ready to trial, only prompt them to read Quick Start and the Risk Card first and to verify in an isolated environment.
- Every project fact must come from a supported claim, evidence_refs, or source_paths; inferred/unverified items can only be risks or open questions.

```

### Role / Skill selection

- Goal: Pick the best-matching asset from the project's roles or Skills.
- Expected output: A list of candidate roles or Skills, each with an applicable scenario, evidence paths, risk boundary, and whether after-install verification is needed.

```text
Read role_skill_index and recommend 3-5 of the most relevant roles or Skills for my target task. For each recommendation, state the applicable scenario, likely output, risk boundary, and evidence_refs.
```

### Risk pre-check

- Goal: Identify environment, permission, rule-conflict, and quality risks before installing or adopting.
- Expected output: A checklist of environment, permission, dependency, license, host-conflict, quality risk, and unknown items.

```text
Based on risk_card, boundaries, and quick_start_candidates, give me a pre-install risk pre-check list. Do not run commands for me; only explain what I should check, why, and what impact a failure would have.
```

### Host AI kickoff instruction

- Goal: Turn the project context into a host AI instruction for the start of a conversation.
- Expected output: A pre-work instruction with clear boundaries and clear evidence citations, suitable to copy to a host AI.

```text
Based on the AI Context Pack for mentedb-mcp, generate a pre-work instruction I can paste to my host AI. This instruction must obey not_runtime=true and must not claim the project has been installed, run, or produced real results.
```

## Role / Skill Index

- Indexed 3 role / Skill / project-doc entries.

- **CLAUDE.md** (project_doc): Project instructions for AI coding assistants working on mentedb-mcp. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CLAUDE.md`
- **MenteDB MCP Server** (project_doc): Beta — MenteDB is under active development. APIs may change between minor versions. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `README.md`
- **Changelog** (project_doc): 0.5.7 https://github.com/nambok/mentedb-mcp/compare/v0.5.6...v0.5.7 - 2026-07-03 Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `CHANGELOG.md`

## Evidence Index

- Indexed 30 evidence entries.

- **CLAUDE.md** (documentation): Project instructions for AI coding assistants working on mentedb-mcp. Evidence: `CLAUDE.md`
- **MenteDB MCP Server** (documentation): Beta — MenteDB is under active development. APIs may change between minor versions. Evidence: `README.md`
- **Package** (package_manifest): { "name": "@mentedb/mcp-darwin-arm64", "version": "0.4.3", "description": "mentedb-mcp binary for darwin-arm64", "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/nambok/mentedb-mcp" }, "os": "darwin" , "cpu": "arm64" , "files": "bin" } Evidence: `npm/darwin-arm64/package.json`
- **Package** (package_manifest): { "name": "@mentedb/mcp-darwin-x64", "version": "0.4.3", "description": "mentedb-mcp binary for darwin-x64", "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/nambok/mentedb-mcp" }, "os": "darwin" , "cpu": "x64" , "files": "bin" } Evidence: `npm/darwin-x64/package.json`
- **Package** (package_manifest): { "name": "@mentedb/mcp-linux-arm64", "version": "0.4.3", "description": "mentedb-mcp binary for linux-arm64", "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/nambok/mentedb-mcp" }, "os": "linux" , "cpu": "arm64" , "files": "bin" } Evidence: `npm/linux-arm64/package.json`
- **Package** (package_manifest): { "name": "@mentedb/mcp-linux-x64", "version": "0.4.3", "description": "mentedb-mcp binary for linux-x64", "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/nambok/mentedb-mcp" }, "os": "linux" , "cpu": "x64" , "files": "bin" } Evidence: `npm/linux-x64/package.json`
- **Package** (package_manifest): { "name": "mentedb-mcp", "version": "0.4.3", "description": "MCP server for MenteDB, persistent memory for AI agents", "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/nambok/mentedb-mcp" }, "homepage": "https://mentedb.com", "keywords": "mcp", "ai", "memory", "database", "agents", "claude", "copilot", "cursor" , "bin": { "mentedb-mcp": "bin/mentedb-mcp" }, "files": "bin", "README.md" , "optionalDependencies": { "@mentedb/mcp-darwin-arm64": "0.4.3", "@mentedb/mcp-darwin-x64": "0.4.3", "@mentedb/mcp-linux-arm64": "0.4.3", "@mentedb/mcp-linux-x64": "0.4.3", "@mentedb/mcp-win32-x64": "0.4.3" } } Evidence: `npm/mentedb-mcp/package.json`
- **Package** (package_manifest): { "name": "@mentedb/mcp-win32-x64", "version": "0.4.3", "description": "mentedb-mcp binary for win32-x64", "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/nambok/mentedb-mcp" }, "os": "win32" , "cpu": "x64" , "files": "bin" } Evidence: `npm/win32-x64/package.json`
- **License** (source_file): Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ Evidence: `LICENSE`
- **Claude Desktop Config** (structured_config): { "mcpServers": { "mentedb": { "command": "mentedb-mcp", "args": "--data-dir", "~/.mentedb" } } } Evidence: `examples/claude_desktop_config.json`
- **Cursor Mcp** (structured_config): { "mcpServers": { "mentedb": { "command": "mentedb-mcp", "args": "--data-dir", "~/.mentedb" , "transportType": "stdio" } } } Evidence: `examples/cursor_mcp.json`
- **Local mode dependencies heavy - embedded DB, embeddings, LLM extraction** (source_file): package name = "mentedb-mcp" version = "0.5.7" edition = "2024" license = "Apache-2.0" description = "MCP server for MenteDB, the cognition aware database for AI agent memory" repository = "https://github.com/nambok/mentedb-mcp" readme = "README.md" keywords = "mcp", "ai", "memory", "database", "agents" categories = "database", "command-line-utilities" Evidence: `Cargo.toml`
- **Cloud Client** (source_file): use reqwest::Client; ⋮---- pub struct CloudClient { ⋮---- struct ToolCallRequest { ⋮---- pub struct ToolCallResponse { ⋮---- pub struct ToolContent { ⋮---- impl CloudClient { pub fn new api url: String, token: String - Self { ⋮---- .timeout std::time::Duration::from secs 30 .build .expect "failed to build HTTP client" ; ⋮---- pub async fn call tool ⋮---- let url = format! "{}/mcp/v1/tools/call", self.api url ; ⋮---- .post &url .header "Authorization", format! "Bearer {}", self.token .header "Content-Type", "application/json" .json &ToolCallRequest { name: name.to string , ⋮---- .send ⋮---- .map err e format! "cloud request failed: {e}" ?; ⋮---- let status = resp.status ; ⋮---- return Err "a… Evidence: `src/cloud_client.rs`
- **Cloud Server** (source_file): use rmcp::RoleServer; use rmcp::ServerHandler; use rmcp::ServiceExt; use rmcp::handler::server::router::tool::ToolRouter; use rmcp::handler::server::tool::ToolCallContext; use rmcp::handler::server::wrapper::Parameters; ⋮---- use rmcp::service::RequestContext; use rmcp::transport::io::stdio; use schemars::JsonSchema; ⋮---- use crate::cloud client::CloudClient; ⋮---- pub struct ProcessTurnRequest { ⋮---- pub struct StoreMemoryRequest { ⋮---- pub struct SearchMemoriesRequest { ⋮---- pub struct ForgetMemoryRequest { ⋮---- pub struct CloudMenteDbServer { ⋮---- impl CloudMenteDbServer { pub fn new client: CloudClient - Self { ⋮---- async fn proxy tool ⋮---- match self.client.call tool name, args… Evidence: `src/cloud_server.rs`
- **Config** (source_file): use std::path::PathBuf; ⋮---- pub fn resolve data dir raw: &str - PathBuf { if raw.starts with '~' && let Some home = dirs home ⋮---- return home.join raw.trim start matches "~/" ; ⋮---- pub struct ServerConfig { ⋮---- impl ServerConfig { pub fn new ⋮---- fn dirs home - Option { std::env::var "HOME" .ok .map PathBuf::from Evidence: `src/config.rs`
- **Daemon** (source_file): use std::sync::Arc; ⋮---- use axum::extract::State; ⋮---- use serde json::json; ⋮---- use crate::config::ServerConfig; ⋮---- use rmcp::handler::server::wrapper::Parameters; ⋮---- pub struct DaemonInfo { ⋮---- pub fn info path data dir: &Path - PathBuf { data dir.join DAEMON FILE ⋮---- pub fn read info data dir: &Path - Option { let raw = std::fs::read to string info path data dir .ok ?; serde json::from str &raw .ok ⋮---- struct DaemonState { ⋮---- fn authorized state: &DaemonState, headers: &HeaderMap - bool { ⋮---- .get "x-mentedb-token" .and then v v.to str .ok .is some and t t == state.token ⋮---- async fn health - Json { Json json! { "ok": true, "version": env! "CARGO PKG VERSION" } ⋮-… Evidence: `src/daemon.rs`
- **Main** (source_file): mod cloud client; mod cloud server; mod config; ⋮---- mod daemon; mod hook; ⋮---- mod resources; ⋮---- mod server; ⋮---- mod tools; ⋮---- use tracing appender::non blocking; use tracing subscriber::EnvFilter; use tracing subscriber::fmt; use tracing subscriber::layer::SubscriberExt; use tracing subscriber::util::SubscriberInitExt; ⋮---- use config::ServerConfig; use config::resolve data dir; ⋮---- fn home dir - Option { ⋮---- .or else std::env::var "USERPROFILE" .ok ⋮---- struct Cli { ⋮---- enum Commands { ⋮---- enum SetupClient { ⋮---- async fn main - anyhow::Result { ⋮---- Some Commands::Setup { client } = return run setup client, false , Some Commands::Update { client } = return run setu… Evidence: `src/main.rs`
- **Server** (source_file): use std::path::Path; ⋮---- use rmcp::ServiceExt; use rmcp::transport::io::stdio; ⋮---- use crate::config::ServerConfig; use crate::tools::MenteDbServer; ⋮---- pub async fn run config: ServerConfig - anyhow::Result { ⋮---- let db = open with retry ⋮---- let db ref = server.db ref ; let db ref signal = db ref.clone ; ⋮---- .expect "failed to register SIGTERM handler" ; ⋮---- .expect "failed to register Ctrl+C handler" ; ⋮---- if let Err e = db ref signal.close { ⋮---- let service = server.serve stdio .await.inspect err e { ⋮---- let = service.waiting .await; ⋮---- if let Err e = db ref.close { ⋮---- Ok ⋮---- fn open with retry ⋮---- match MenteDb::open with config path, cognitive config.clone… Evidence: `src/server.rs`
- **!/usr/bin/env node** (source_file): const { execFileSync } = require "child process" ; const path = require "path" ; const fs = require "fs" ; Evidence: `npm/mentedb-mcp/bin/mentedb-mcp`
- **Backend** (source_file): use std::path::Path; ⋮---- use serde json::json; ⋮---- use crate::cloud client::CloudClient; ⋮---- pub enum Backend { ⋮---- impl Backend { pub async fn resolve data dir: &Path, force local: bool - anyhow::Result { ⋮---- return Ok Backend::Cloud CloudClient::new api url, token ; ⋮---- Ok Backend::Local client ⋮---- pub async fn context &self, prompt: &str - anyhow::Result { ⋮---- .call tool "search memories", json! { "query": prompt, "limit": 8 } ⋮---- .map err e anyhow::anyhow! e ?; ⋮---- .first .map c c.text.clone .unwrap or default ; ⋮---- serde json::from str &text .unwrap or else json! {} ; ⋮---- let memories = parsed.get "results" .cloned .unwrap or else json! ; Ok json! { "memories":… Evidence: `src/hook/backend.rs`
- **Mod** (source_file): mod backend; ⋮---- use std::io::Read; ⋮---- use serde json::json; ⋮---- use backend::Backend; ⋮---- pub enum HookEvent { ⋮---- struct SessionState { ⋮---- fn state path data dir: &Path, session id: &str - PathBuf { ⋮---- .chars .filter c c.is ascii alphanumeric c == '-' c == ' ' .take 64 .collect ; let name = if safe.is empty { "default".to string ⋮---- data dir.join "hook sessions" .join format! "{name}.json" ⋮---- fn load state data dir: &Path, session id: &str - SessionState { std::fs::read to string state path data dir, session id .ok .and then raw serde json::from str &raw .ok .unwrap or default ⋮---- fn save state data dir: &Path, session id: &str, state: &SessionState { let path = st… Evidence: `src/hook/mod.rs`
- **Handler** (source_file): impl ServerHandler for MenteDbServer { fn get info &self - ServerInfo { ⋮---- instructions.push str ⋮---- .enable tools .enable resources .build , ⋮---- .with server info Implementation::new ⋮---- env! "CARGO PKG VERSION" , ⋮---- .with instructions &instructions ⋮---- async fn list resources ⋮---- Ok ListResourcesResult { ⋮---- resources: vec! ⋮---- async fn read resource ⋮---- let uri str = uri.as str ; ⋮---- let memory count = db.memory count ; let stats = json! { ⋮---- return Ok ReadResourceResult::new vec! ResourceContents::text ⋮---- let tools: Vec = vec! ⋮---- let info = json! { ⋮---- .all pain signals .iter .map s { json! { ⋮---- .collect ; ⋮---- .get active phantoms ⋮---- .map p { ⋮… Evidence: `src/tools/handler.rs`
- **Hook Support** (source_file): fn now us - u64 { ⋮---- .duration since std::time::UNIX EPOCH .unwrap or default .as micros as u64 ⋮---- impl MenteDbServer { ⋮---- pub crate fn hook context &self, prompt: &str, k: usize - serde json::Value { ⋮---- let embedding = self.embedding provider.embed prompt .unwrap or default ; ⋮---- .recall hybrid at &embedding, Some prompt , k, now us , None, None .unwrap or default ; let mut memories = resolve memory ids db, &hits ; ⋮---- memories.iter .map sm sm.memory.id .collect ; for sm in recall all memories db { if sm.memory.tags.iter .any t t == "scope:always" && !seen.contains &sm.memory.id { memories.push sm ; ⋮---- .split whitespace .map w w.to lowercase .collect ; let pains = db.get… Evidence: `src/tools/hook_support.rs`
- **Memory** (source_file): impl MenteDbServer { ⋮---- async fn store memory ⋮---- if req.content.len MAX CONTENT BYTES { return error result &format! ⋮---- let memory type = match parse memory type &req.memory type { ⋮---- Err e = return error result &e , ⋮---- .embed &req.content .map err e McpError::internal error format! "Embedding failed: {e}" , None ?; let agent id = match req.agent id.as deref { Some id str = match parse uuid id str { ⋮---- let mut node = MemoryNode::new AgentId agent id , memory type, req.content, embedding ; ⋮---- let mut tags = req.tags.unwrap or default ; ⋮---- if !tags.iter .any t t.starts with "scope:" { let scope = match req.scope.as deref { ⋮---- tags.push format! "scope:{scope}" ; ⋮---… Evidence: `src/tools/memory.rs`
- **Mod** (source_file): mod cognitive; mod consolidation; mod context; mod enrichment; mod graph; mod handler; mod hook support; mod inference; mod ingest; mod memory; mod process turn; mod process turn analysis; mod process turn helpers; mod types; ⋮---- use std::sync::Arc; ⋮---- use mentedb::MenteDb; use mentedb cognitive::trajectory::DecisionState; ⋮---- use mentedb core::edge::EdgeType; ⋮---- use mentedb embedding::CandleEmbeddingProvider; use mentedb embedding::HashEmbeddingProvider; use mentedb embedding::provider::EmbeddingProvider; ⋮---- use rmcp::ServerHandler; use rmcp::handler::server::router::tool::ToolRouter; use rmcp::handler::server::wrapper::Parameters; ⋮---- use serde json::json; use tokio::sync::… Evidence: `src/tools/mod.rs`
- **Process Turn** (source_file): impl MenteDbServer { ⋮---- fn assemble response result: &ProcessTurnResult - String { ⋮---- .iter .take 10 .map sm { ⋮---- let truncated = if content.len CTX MAX CHARS { format! ⋮---- content.clone ⋮---- let scope = if sm.memory.tags.iter .any t t == "scope:always" { ⋮---- json! { ⋮---- .collect ; ⋮---- let mut response = json! { ⋮---- if !result.pain warnings.is empty { response "pain warnings" = json! ⋮---- if !result.proactive recalls.is empty { response "proactive recalls" = json! ⋮---- if !result.detected actions.is empty { response "detected actions" = json! ⋮---- response.to string ⋮---- pub crate async fn process turn ⋮---- let agent id = match req.agent id.as deref { Some id str =… Evidence: `src/tools/process_turn.rs`
- **Process Turn Helpers** (source_file): use mentedb::process turn::ProcessTurnResult; ⋮---- impl MenteDbServer { ⋮---- pub super async fn resolve entities llm &self, conversation: &str - u32 { ⋮---- .split whitespace .filter w w.len = 3 && w.chars .next .is some and c c.is uppercase .map w w.trim matches c: char !c.is alphanumeric .to string .filter w !w.is empty .collect ; ⋮---- if words.is empty { ⋮---- .iter .map w mentedb cognitive::EntityCandidate { name: w.clone , context: Some conversation.to string , ⋮---- match llm.resolve entities &candidates .await { ⋮---- let count = groups.len as u32; ⋮---- pub super async fn verify contradictions llm &self, result: &ProcessTurnResult - u32 { ⋮---- let Ok new mem = db.get memory eid… Evidence: `src/tools/process_turn_helpers.rs`
- **Changelog** (documentation): 0.5.7 https://github.com/nambok/mentedb-mcp/compare/v0.5.6...v0.5.7 - 2026-07-03 Evidence: `CHANGELOG.md`
- **.gitignore** (source_file): /target .log .DS Store .env .env. Evidence: `.gitignore`
- **Release Plz** (source_file): workspace git release enable = true semver check = false Evidence: `release-plz.toml`

## Rules the Host AI Must Follow

- **Treat this asset as pre-work context, not a runtime environment.**: The AI Context Pack contains only an evidence-backed understanding of the project, not the project's executable state. Evidence: `CLAUDE.md`, `README.md`, `npm/darwin-arm64/package.json`
- **When answering the user, distinguish what can be previewed from what can only be verified after install.**: The consumer value of the pre-install experience comes from reducing bad installs and misjudgments, not from pretending to be a real run. Evidence: `CLAUDE.md`, `README.md`, `npm/darwin-arm64/package.json`

## Questions the User Should Answer First

- Which host AI or local environment do you plan to use it in?
- Do you just want to experience the workflow first, or are you ready to actually install?
- What matters most to you: install cost, output quality, or conflicts with your existing rules?

## Acceptance Checks

- Every capability claim can be traced back to a file path in evidence_refs.
- AI_CONTEXT_PACK.md does not package previews as a real run.
- The user can understand who it fits, what it can do, how to start, and the risk boundaries within 3 minutes.

---

## Doramagic Context Augmentation

The following sections strengthen the repository context for a host AI. Human Manual data is a reading route, and pitfall notes become operating constraints.

## Human Manual Outline

Usage rule: this is only a reading route and salience signal, not factual authority. Concrete claims must still return to repo evidence or Claim Graph.

Host AI hard rules:
- Do not treat page titles, section order, summaries, or importance values as factual project evidence.
- When explaining the Human Manual outline, state that it is only a reading route or salience signal.
- Capability, installation, compatibility, runtime state, and risk claims must cite repo evidence, source paths, or Claim Graph.

- **Overview and Architecture**: importance `high`
  - source_paths: src/main.rs, src/server.rs, src/config.rs, src/cloud_client.rs, src/cloud_server.rs
- **MCP Tools and the process_turn Pipeline**: importance `high`
  - source_paths: src/tools/mod.rs, src/tools/handler.rs, src/tools/process_turn.rs, src/tools/process_turn_analysis.rs, src/tools/process_turn_helpers.rs
- **Claude Code Hooks and Local Daemon**: importance `high`
  - source_paths: src/hook/mod.rs, src/hook/backend.rs, src/daemon.rs, src/tools/hook_support.rs, CLAUDE.md
- **Configuration, Deployment, and Operations**: importance `high`
  - source_paths: src/main.rs, src/config.rs, examples/claude_desktop_config.json, examples/cursor_mcp.json, npm/mentedb-mcp/package.json

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `69b8c94cc032f9fb6dc765a0f6a8d6d457d15992`
- inspected_files: `README.md`, `examples/claude_desktop_config.json`, `examples/cursor_mcp.json`

Host AI hard rules:
- Without repo_clone_verified=true, do not claim that the source code has been read.
- Without repo_inspection_verified=true, do not write README, docs, or package-file conclusions as facts.
- Without quick_start_verified=true, do not claim that the Quick Start path has run successfully.

## Doramagic Pitfall Constraints

These rules come from Doramagic discovery, validation, or compilation findings. The host AI must treat them as operating constraints, not background notes.

### Constraint 1: Capability evidence risk requires verification

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: capability.assumptions | https://github.com/nambok/mentedb-mcp
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: downstream_validation.risk_items | https://github.com/nambok/mentedb-mcp
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: risks.scoring_risks | https://github.com/nambok/mentedb-mcp
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Runtime risk requires verification

- Trigger: Developers should check this performance risk before relying on the project: v0.4.25
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.4.25. Context: Source discussion did not expose a precise runtime context.
- Why it matters: Upgrade or migration may change expected behavior: v0.4.25
- Evidence: failure_mode_cluster:github_release | https://github.com/nambok/mentedb-mcp/releases/tag/v0.4.25
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 5: Runtime risk requires verification

- Trigger: Developers should check this performance risk before relying on the project: v0.5.6
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.5.6. Context: Source discussion did not expose a precise runtime context.
- Why it matters: Upgrade or migration may change expected behavior: v0.5.6
- Evidence: failure_mode_cluster:github_release | https://github.com/nambok/mentedb-mcp/releases/tag/v0.5.6
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 6: Maintenance risk requires verification

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/nambok/mentedb-mcp
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 7: Maintenance risk requires verification

- Trigger: release_recency=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/nambok/mentedb-mcp
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 8: Maintenance risk requires verification

- Trigger: Developers should check this maintenance risk before relying on the project: v0.4.24
- Host AI rule: Before packaging this project, run the relevant install/config/quickstart check for: v0.4.24. Context: Source discussion did not expose a precise runtime context.
- Why it matters: Upgrade or migration may change expected behavior: v0.4.24
- Evidence: failure_mode_cluster:github_release | https://github.com/nambok/mentedb-mcp/releases/tag/v0.4.24
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
