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

Save

Delete

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 projects
memstate_get(project_id="x") → full project tree
memstate_get(project_id="x", keypath="db") → subtree
memstate_get(memory_id="mem_...") → single memory
ParameterTypeRequiredDescription
project_idstringOptionalProject to retrieve from. Omit to list all projects.
keypathstringOptionalSubkeypath within project. Omit to get full project tree. Auto-prefixed.
memory_idstringOptionalGet a single memory by UUID (exclusive with other params).
recursivebooleanDefault: trueInclude subtree when browsing by keypath.
include_contentbooleanDefault: falseHydrate full memory content (not just keypaths).
content_limitintegerDefault: 200Max memories to hydrate when include_content is true.
at_revisionintegerOptionalTime-travel to a specific project revision number.
Example: Browse all memories for a project
memstate_get({
  project_id: "myapp"
})
Example: Browse a subtree with full content
memstate_get({
  project_id: "myapp",
  keypath: "database",
  include_content: true
})
Example: Time-travel to revision 42
memstate_get({
  project_id: "myapp",
  keypath: "auth",
  at_revision: 42
})
Response (keypath mode)
{
  "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_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.

ParameterTypeRequiredDescription
project_idstringRequiredProject to store in. Auto-creates if new.
contentstringRequiredMarkdown or text to remember (max 100,000 chars). Server extracts keypaths automatically.
sourcestringOptionalSource type: "agent", "readme", "docs", "meeting", "code".
contextstringOptionalOptional hint to guide keypath extraction.
Example: Task completion summary
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"
})
Example: Save a decision
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"
})
Response
{
  "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.

ParameterTypeRequiredDescription
project_idstringRequiredProject to store in. Auto-creates if new.
keypathstringRequiredHierarchical path (e.g., "config.port", "status"). Auto-prefixed.
valuestringRequiredThe value to store (max 2,000 chars). Short, simple values only — not markdown.
categorystringOptionalCategory: decision, preference, fact, task, context, requirement, note, code, learning.
topicsstring[]OptionalOptional additional tags.
Example
memstate_set({
  project_id: "myapp",
  keypath: "config.database.port",
  value: "5432"
})
Response
{
  "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.

ParameterTypeRequiredDescription
project_idstringOptionalRequired when using keypath.
keypathstringOptionalGet history for this keypath. Auto-prefixed with project_id.
memory_idstringOptionalOr get history for a specific memory chain by ID.
Provide either project_id + keypath, or memory_id. Not both.
Example
memstate_history({
  project_id: "myapp",
  keypath: "auth.provider"
})
Response
{
  "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.

ParameterTypeRequiredDescription
project_idstringRequiredProject containing the memory.
keypathstringRequiredKeypath to delete. Auto-prefixed with project.{project_id}.
recursivebooleanDefault: falseIf true, delete the entire keypath subtree.
Example: Delete a single keypath
memstate_delete({
  project_id: "myapp",
  keypath: "config.old_setting"
})
Example: Delete an entire subtree
memstate_delete({
  project_id: "myapp",
  keypath: "config",
  recursive: true
})
Response
{
  "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.

ParameterTypeRequiredDescription
project_idstringRequiredProject ID to soft-delete.
Example
memstate_delete_project({
  project_id: "old-project"
})
Response
{
  "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:

Response 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. */ }
}