MCP Tools Reference
Complete reference for all 7 Memstate MCP tools. Use remember for markdown and task summaries (preferred); use set only for a single keypath value.
Quick Start
- 1.
Check what you know
memstate_get(project_id="myapp") - 2.
Save markdown summary (preferred)
memstate_remember( project_id="myapp", content="## Summary\n- Done X, Y, Z", source="agent" ) - 3.
Set one value only
memstate_set( project_id="myapp", keypath="config.port", value="8080" ) - 4.
Find by meaning
memstate_search( query="authentication", project_id="myapp" )
All Tools
Read / discover
- memstate_get — browse & retrieve (before tasks)
- memstate_search — find by meaning
Save
- memstate_remember — markdown/summaries (preferred)
- memstate_set — single keypath = value
- memstate_history — version history
Delete
- memstate_delete — soft-delete a keypath
- memstate_delete_project — soft-delete an entire project
Keypath convention
Keypaths are hierarchical dot-paths (e.g. database.config, auth.provider). When you pass project_id, the keypath is auto-prefixed — so keypath="database" becomes project.myapp.database. Project IDs can contain hyphens (e.g. my-app-v2).
Tools
memstate_get
Browse project keypaths, get memory content, or list all projects. Use before starting tasks to fetch existing knowledge.
Usage Modes
memstate_get() → list all projectsmemstate_get(project_id="x") → full project treememstate_get(project_id="x", keypath="db") → subtreememstate_get(memory_id="mem_...") → single memory| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Optional | Project to retrieve from. Omit to list all projects. |
| keypath | string | Optional | Subkeypath within project. Omit to get full project tree. Auto-prefixed. |
| memory_id | string | Optional | Get a single memory by UUID (exclusive with other params). |
| recursive | boolean | Default: true | Include subtree when browsing by keypath. |
| include_content | boolean | Default: false | Hydrate full memory content (not just keypaths). |
| content_limit | integer | Default: 200 | Max memories to hydrate when include_content is true. |
| at_revision | integer | Optional | Time-travel to a specific project revision number. |
memstate_get({
project_id: "myapp"
})memstate_get({
project_id: "myapp",
keypath: "database",
include_content: true
})memstate_get({
project_id: "myapp",
keypath: "auth",
at_revision: 42
}){
"memories": {
"project.myapp.auth.provider": "SuperTokens Cloud with passwordless OTP",
"project.myapp.auth.session": "JWT session management with refresh tokens",
"project.myapp.auth.middleware": "API key auth for MCP, session auth for web"
},
"total_count": 3,
"revision_number": 15
}memstate_search
Find memories by meaning using semantic search. Returns ranked summaries — use memstate_get(memory_id=...) to fetch full content of a result.
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Required | Natural language search query. |
| project_id | string | Optional | Filter by project. |
| limit | integer | Default: 20 | Maximum results to return (max: 100). |
| categories | string[] | Optional | Filter by categories. |
| keypath_prefix | string | Optional | Filter by keypath prefix (e.g., "auth" matches "auth.provider"). |
| include_superseded | boolean | Default: false | Include older superseded versions in results. |
memstate_search({
query: "how does authentication work",
project_id: "myapp",
limit: 3
}){
"results": [
{
"id": "mem_abc123",
"summary": "Authentication via SuperTokens Cloud with passwordless OTP",
"keypath": "auth.provider",
"score": 0.92,
"version": 2,
"created_at": "2026-02-15T10:30:00Z"
}
],
"total_found": 1,
"query": "how does authentication work"
}memstate_remember
Save markdown, task summaries, or any text. Server extracts keypaths and creates structured memories automatically. This is the PREFERRED way to save information.
Preferred for saving
Use remember after a task to save a markdown summary. The server organizes keypaths, detects conflicts, and versions automatically. Use memstate_set only when you need to set one specific keypath to a short value.
| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Required | Project to store in. Auto-creates if new. |
| content | string | Required | Markdown or text to remember (max 100,000 chars). Server extracts keypaths automatically. |
| source | string | Optional | Source type: "agent", "readme", "docs", "meeting", "code". |
| context | string | Optional | Optional hint to guide keypath extraction. |
memstate_remember({
project_id: "myapp",
content: "## Task Summary\n- Added OAuth with Google provider\n- Session management via SuperTokens Cloud\n- Key files: auth/oauth.go, middleware/auth.go",
source: "agent"
})memstate_remember({
project_id: "myapp",
content: "We decided to migrate from session-based auth to JWT tokens. Access tokens have a 1-hour expiry with refresh tokens stored in httpOnly cookies.",
source: "meeting",
context: "Architecture decision from sprint planning"
}){
"job_id": "job_abc123",
"status": "pending",
"message": "Ingestion job enqueued successfully"
}Conflict resolution
Conflicts are classified as one of:
- none/additive — New information, stored without superseding
- supersede — Replaces outdated information
- contradiction — Both versions stored, with the newer version automatically taking precedence
memstate_set
Set one keypath to a short value. Only for simple key=value facts like config, status, or version numbers. For task summaries or markdown, use memstate_remember instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Required | Project to store in. Auto-creates if new. |
| keypath | string | Required | Hierarchical path (e.g., "config.port", "status"). Auto-prefixed. |
| value | string | Required | The value to store (max 2,000 chars). Short, simple values only — not markdown. |
| category | string | Optional | Category: decision, preference, fact, task, context, requirement, note, code, learning. |
| topics | string[] | Optional | Optional additional tags. |
memstate_set({
project_id: "myapp",
keypath: "config.database.port",
value: "5432"
}){
"memory_id": "mem_abc123",
"action": "created",
"version": 1,
"message": "Memory stored at config.database.port"
}memstate_history
View version history for a keypath or specific memory chain. Shows all previous versions in chronological order.
| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Optional | Required when using keypath. |
| keypath | string | Optional | Get history for this keypath. Auto-prefixed with project_id. |
| memory_id | string | Optional | Or get history for a specific memory chain by ID. |
project_id + keypath, or memory_id. Not both.memstate_history({
project_id: "myapp",
keypath: "auth.provider"
}){
"versions": [
{
"id": "mem_abc123",
"summary": "Session-based authentication",
"version": 1,
"created_at": "2026-01-15T08:00:00Z",
"superseded_by": "mem_def456"
},
{
"id": "mem_def456",
"summary": "SuperTokens Cloud with passwordless OTP",
"version": 2,
"created_at": "2026-02-06T14:30:00Z",
"superseded_by": null
}
],
"total_versions": 2
}memstate_delete
Soft-delete a memory by keypath. Creates a tombstone version preserving full version history. The memory can be un-deleted by setting a new value at the same keypath.
| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Required | Project containing the memory. |
| keypath | string | Required | Keypath to delete. Auto-prefixed with project.{project_id}. |
| recursive | boolean | Default: false | If true, delete the entire keypath subtree. |
memstate_delete({
project_id: "myapp",
keypath: "config.old_setting"
})memstate_delete({
project_id: "myapp",
keypath: "config",
recursive: true
}){
"deleted_keypaths": [
"project.myapp.config.port",
"project.myapp.config.host",
"project.myapp.config.old_setting"
],
"deleted_count": 3,
"message": "Soft-deleted 3 memory(ies) under keypath 'project.myapp.config'"
}Soft-delete preserves history
Deleted memories are not erased. A tombstone version is created in the version chain, visible via memstate_history. To un-delete a keypath, simply set a new value with memstate_set or memstate_remember.
memstate_delete_project
Soft-delete an entire project and all its memories. Creates tombstone versions for every memory, preserving full history. The project is hidden from listings.
| Parameter | Type | Required | Description |
|---|---|---|---|
| project_id | string | Required | Project ID to soft-delete. |
memstate_delete_project({
project_id: "old-project"
}){
"project_id": "old-project",
"deleted_keypaths": [
"project.old-project.auth.provider",
"project.old-project.config.port",
"project.old-project.database.host"
],
"deleted_count": 3,
"message": "Soft-deleted project 'old-project' and 3 memory(ies)"
}All memories are tombstoned
Every memory in the project gets an individual tombstone version. Use memstate_history on any keypath to see its full history including the deletion.
Response Format
All MCP tool responses use a consistent envelope:
{
"ok": true,
"schema_version": 1,
"tool": "memstate_get",
"operation": "memories_by_keypath",
"request": { /* echo of your input */ },
"data": { /* the actual response data */ },
"meta": { /* metadata like resolved_keypath, mode, etc. */ }
}