7.5 KiB
Memory MCP Strategic Guidelines
This document outlines the STRATEGY, SEMANTICS, and CASING STANDARDS for using the MCP Memory Server.
You do not need to memorize JSON schemas for these tools; they are strictly defined and typed in the tools/list endpoint. Focus purely on WHEN and WHY to use them.
1. Casing & Naming Standards (CRITICAL)
To prevent graph fragmentation and ensure seamless LLM context retrieval:
- Entity Types (
entity_type): MUST ALWAYS bePascalCase(e.g.DatabaseTable,McpTool,ArchitectureComponent,File,DataStructure). - Relation Types (
relation_type): MUST ALWAYS besnake_case(e.g.depends_on,calls,implements,uses,contains). - Field Keys & Properties: MUST ALWAYS be
snake_case(e.g.file_path,git_commit,created_at).
Note
The server automatically enforces and migrates incoming entity and relation types to these canonical casing rules on every read and write operation.
2. Consolidated Smart Tools Architecture
The server consolidates granular single-purpose tools into domain-named smart tools. Always prefer the consolidated tools over legacy aliases:
-
tasks: Complete task lifecycle management.action: "add": Create a new task (requirestitle, optionaldescription,git_branch,parent_id,dependencies).action: "update": Update task status (requiresid,status: "pending" | "completed" | "cancelled").action: "delete": Delete task and child tasks (requiresid).action: "list": List active tasks (optionalgit_branch,summary_level: "compact" | "detailed" | "full",max_tokens).action: "set_criteria": Set acceptance criteria (requiresid,criteria: Vec<String>).action: "verify": Verify criteria met (requiresid).
-
milestones: Milestone tracking.action: "add": Create milestone (requirestitle).action: "update": Update milestone status (requiresid,status).action: "list": List milestones.
-
sticky_notes: Ephemeral scratchpad notes with TTL.action: "add": Add note (requirescontent, optionalttl_seconds,session_only).action: "read": Read all active notes.action: "delete": Delete note by index (requires 1-basedindex).action: "clear": Clear all sticky notes.
-
handoff_memos: Session handoff notes for future agents.action: "leave": Leave a memo (requirescontent).action: "read": Read active handoff memos.action: "clear": Clear memos.
-
pinned_files: Focus file working set.action: "pin": Pin file to focus set (requirespath).action: "unpin": Unpin file from focus set (requirespath).action: "list": List pinned files.
-
context_workspaces: Workspace context state snapshots.action: "save": Save context workspace (requiresname).action: "load": Restore saved context workspace (requiresname).action: "list": List saved context workspaces.action: "delete": Delete saved context workspace (requiresname).action: "diff": Compare two saved context workspaces (requiresname,other_name).
-
pr_checklist: Pre-commit and PR checklist.action: "add": Add checklist item (requiresdescription).action: "get": Get PR checklist items.action: "clear": Clear PR checklist.
-
snippets: Reusable code snippet vault.action: "store": Store snippet (requiresqueryas name, optionallanguage,code,description,tags).action: "search": Search snippet vault (optionalquery,tags,hybrid: true).action: "delete": Delete snippet (requiresid).action: "tag": Attach classification tags (requiresid,tags: Vec<String>).
-
decisions: Architectural Decision Records (ADRs).action: "log": Log ADR (requirestitle, optionalstatus,context,decision,consequences).action: "query": Query ADRs (optionalquery).action: "delete": Delete ADR (requiresid).
-
tech_debt: Engineering debt backlog.action: "log": Log debt item (requiresdescription, optionalideal_solution,git_commit,git_branch,symbol_references,line_range).action: "resolve": Resolve debt item (requiresid).action: "list": List debt items (optionalinclude_resolved).
-
environment: Infrastructure and requirements tracking.action: "update_fingerprint": Update tool versions.action: "read_fingerprint": Read tool versions fingerprint.action: "log_requirement": Log environment variable requirement (requireskey).action: "register": Register target environment (requiresname).action: "get_details": Read full environment details.
-
clipboard: OS Clipboard management.action: "read": Read OS clipboard.action: "write": Write text/html/files/image to clipboard.action: "toggle_watch": Toggle auto-clipboard watcher.
3. Subgraph Expansion & Multi-Hop Navigation
- Tool:
get_subgraph - When to use: When you need to understand the complete architectural neighborhood surrounding a specific component, module, or database table.
- Behavior: Performs a multi-hop Breadth-First Search (BFS) around a
root_node(orroot_entity) up to a requesteddepth(e.g. 1 to 3 hops) and returns all connected entities and relations. Passformat: "markdown_tree"to generate a compact, token-budgeted Markdown topology tree capped within a requestedmax_tokensbudget.
4. Automated Error Fix Auto-Matcher
- Tools:
log_error_fix,search_error_fixes(and aliassuggest_error_fix) - When to use: When encountering a build error, test failure, or stack trace. Call
search_error_fixeswith either a textqueryorstack_tracebefore attempting a fix from scratch. - Behavior: Computes cosine similarity between error trace embeddings and past resolution logs when
stack_traceis provided, or keyword filtering whenqueryis provided, returning top matched solutions, modified files, and git commits.
5. Memory State Checkpointing & Rollbacks
- Tool:
checkpoint_state,restore_state(orcreate_snapshot,restore_snapshot) - When to use: Before initiating a large refactor, running experimental subagent tasks, or executing destructive batch operations.
- Behavior: Saves or restores a point-in-time snapshot of graph entities, active tasks, and tech debt backlogs.
6. Self-Healing Graph Health Sweeper
- Tool:
sweep_graph_health - When to use: Periodically or before committing major graph changes to audit entity consistency.
- Behavior: Detects orphaned nodes (0 relations), computes name similarity to identify near-duplicates (e.g.,
APIGatewayvsApiGateway), and provides structuredmerge_entitiesrecommendations or auto-prunes orphans.
7. Causal Lineage & Provenance Tracker
- Tool:
query_lineage - When to use: When asking "Why was this component modified?" or "What task or ADR led to this code change?"
- Behavior: Searches across tasks, ADRs, audit ledger entries, and error fixes to assemble a unified chronological timeline explaining the provenance behind any file, symbol, or commit.
8. LLM Pre-Flight Context Bundle
- Tool:
get_preflight_context - When to use: At the start of a turn or subagent task to gain total situational awareness in 1 call.
- Behavior: Aggregates current active branch, in-progress tasks with acceptance criteria, pinned files, top open tech debts, and active unverified hypotheses into a consolidated executive context bundle.