-
Notifications
You must be signed in to change notification settings - Fork 0
Memory MCP Tools
Complete reference for all Memory MCP tools with parameters, examples, and best practices.
Store content in persistent memory.
| Parameter | Type | Required | Description |
|---|---|---|---|
content |
string | Yes | The content to store |
type |
enum | Yes | One of: code, note, conversation, reference
|
source |
string | Yes | Origin identifier (file path, URL, etc.) |
tags |
array[string] | No | Categorization tags |
project |
string | No | Project association |
Store a user preference:
{
"content": "User prefers functional programming patterns. Avoid classes, use pure functions.",
"type": "note",
"source": "conversation:2024-01-15",
"tags": ["preference", "coding-style", "functional"],
"project": "user-profile"
}Store an error solution:
{
"content": "TypeError in UserList.tsx:45 - async data not loaded. Fixed with loading state check.",
"type": "code",
"source": "src/components/UserList.tsx",
"tags": ["error", "react", "async", "resolved"],
"project": "dashboard-app"
}Store an architecture decision:
{
"content": "Chose JWT over sessions. Reasons: stateless scaling, microservices support.",
"type": "reference",
"source": "architecture:auth-strategy",
"tags": ["decision", "architecture", "auth"],
"project": "api-gateway"
}- Include both the problem AND solution for errors
- Use consistent tag naming (kebab-case recommended)
- Always include project for project-specific content
- Summarize long content, store details in vault
Search memory using text, semantic, or hybrid search.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | Yes | Search query |
type |
enum | No |
text, semantic, or hybrid (default: text) |
limit |
integer | No | Maximum results (default: 10) |
filters |
object | No | Filter criteria |
{
"filters": {
"doc_type": "code",
"project": "api-gateway",
"tags": ["auth", "error"]
}
}Simple text search:
{
"query": "authentication error",
"type": "text",
"limit": 5
}Semantic search for similar content:
{
"query": "undefined property error in React",
"type": "semantic",
"limit": 10,
"filters": {
"doc_type": "code",
"tags": ["error"]
}
}Hybrid search with project filter:
{
"query": "JWT implementation decisions",
"type": "hybrid",
"limit": 15,
"filters": {
"project": "api-gateway"
}
}| Use | When |
|---|---|
text |
Exact keywords, error messages, variable names |
semantic |
Conceptual queries, "find similar", different wording |
hybrid |
Best of both, most accurate, slightly slower |
Retrieve a specific memory by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Document ID |
{
"id": "mem_abc123def456"
}Full document including:
- Content
- Metadata (type, source, tags, project)
- Timestamps (created, updated, accessed)
- Access statistics
Remove a memory from all storage tiers.
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Document ID to delete |
{
"id": "mem_old_preference_123"
}- Search first to verify you're deleting the right memory
- Use when information is superseded, not just old
- Store replacement before deleting if updating
List memories with optional filters.
| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Maximum results (default: 20) |
type |
string | No | Filter by doc_type |
project |
string | No | Filter by project |
List recent memories:
{
"limit": 20
}List code snippets for a project:
{
"limit": 10,
"type": "code",
"project": "api-gateway"
}List all notes:
{
"limit": 50,
"type": "note"
}- Session start: Get overview of recent activity
- Project switch: What do I know about this project?
- Cleanup: Find old memories to review/delete
Persist current session state for later restoration.
| Parameter | Type | Required | Description |
|---|---|---|---|
project_path |
string | Yes | Project directory path |
active_files |
array[string] | No | Files being worked on |
context |
object | No | Custom context data |
Basic session save:
{
"project_path": "/Users/dev/api-gateway"
}Full session save:
{
"project_path": "/Users/dev/api-gateway",
"active_files": [
"src/auth/middleware.ts",
"src/auth/jwt.ts",
"tests/auth.test.ts"
],
"context": {
"current_task": "implementing JWT refresh",
"completed": ["JWT verification", "access token generation"],
"blockers": ["refresh token storage decision needed"],
"next_steps": ["implement token blacklist", "add rotation endpoint"]
}
}- Save at natural stopping points
- Include active files for quick resumption
- Document current task and next steps in context
- Save before switching projects
Restore a previous session's state.
| Parameter | Type | Required | Description |
|---|---|---|---|
session_id |
string | No | Specific session ID (latest if omitted) |
Restore most recent session:
{}Restore specific session:
{
"session_id": "sess_2024-01-15_api-gateway"
}- Active files list
- Custom context
- Recent memory IDs
- Session timestamps
Write a note to the Obsidian-compatible vault.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | Yes | Note path (without .md extension) |
content |
string | Yes | Markdown content |
folder |
enum | No | One of: code, notes, conversations, references, daily
|
tags |
array[string] | No | Tags for the note |
Project documentation:
{
"path": "projects/api-gateway/architecture",
"content": "# API Gateway Architecture\n\n## Overview\n...",
"folder": "references",
"tags": ["architecture", "api-gateway"]
}Daily note:
{
"path": "daily/2024-01-15",
"content": "# 2024-01-15\n\n## Completed\n- JWT refresh tokens\n...",
"folder": "daily",
"tags": ["daily", "api-gateway"]
}Code snippet:
{
"path": "code/retry-pattern",
"content": "# Retry Pattern\n\n```typescript\nasync function retry<T>...\n```",
"folder": "code",
"tags": ["pattern", "typescript", "reliability"]
}- Use for content that should be human-readable
- Great for documentation summaries
- Can be version controlled separately
- Accessible outside Claude
Read a note from the Obsidian vault.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | Yes | Note path |
{
"path": "references/projects/api-gateway/architecture"
}{
"path": "daily/2024-01-15"
}- Note content (markdown)
- Frontmatter metadata if present
- File timestamps
Get memory system statistics and health information.
None required.
{}{
"sqlite_count": 150,
"session_id": "current-session-id",
"components": {
"sqlite": true,
"vault": true,
"redis": true,
"graphiti": false,
"lancedb": true,
"livegrep": false,
"embedder": true
},
"health": {
"sqlite": {"status": "healthy", "latency_ms": 2.5},
"vault": {"status": "connected", "latency_ms": 15.3},
"redis": {"status": "healthy", "latency_ms": 0.8},
"embedder": {"status": "active", "provider": "local/nomic-embed"}
},
"redis": {
"connected": true,
"used_memory": "1.5M",
"cache_hits": 45,
"cache_misses": 12
}
}- Verify components are available
- Debug slow operations
- Monitor system health
When Graphiti is enabled, additional tools are available:
Search for entities in the knowledge graph.
{
"query": "user preferences",
"limit": 10
}Search for relationships/facts between entities.
{
"query": "decided to use JWT",
"limit": 10
}When livegrep is enabled:
Search code across repositories.
{
"query": "async function.*retry",
"path_filter": "*.ts",
"max_matches": 20
}Find function definitions.
{
"function_name": "authenticateRequest",
"language": "typescript"
}Find class definitions.
{
"class_name": "AuthMiddleware",
"language": "typescript"
}