The MCP server exposes Pensyve tools over stdio, so any MCP-compatible client (Claude Desktop, Cursor, etc.) can use agent memory directly.

Build

cargo build -p pensyve-mcp --release

The binary lands at target/release/pensyve-mcp.

Or run directly:

cargo run -p pensyve-mcp

Claude Desktop Configuration

Add this to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "pensyve": {
      "command": "/path/to/pensyve-mcp",
      "env": {
        "PENSYVE_PATH": "~/.pensyve/",
        "PENSYVE_NAMESPACE": "default"
      }
    }
  }
}

Replace /path/to/pensyve-mcp with the actual path to your built binary.

Restart Claude Desktop after editing the config.

Available Tools

The MCP server exposes six tools:

ToolDescription
pensyve_recallSearch memories by semantic similarity and text matching. Returns ranked results from episodic, semantic, and procedural memory.
pensyve_rememberStore an explicit fact about an entity as a semantic memory.
pensyve_episode_startBegin tracking an interaction episode with named participants. Returns an episode_id.
pensyve_episode_endClose an episode and extract memories. Takes the episode_id from start.
pensyve_forgetDelete all memories associated with an entity.
pensyve_inspectView all memories stored for an entity, optionally filtered by type.

Tool Parameters

pensyve_recall

ParameterTypeRequiredDescription
querystringyesSearch query text
entitystringnoFilter by entity name
typesstring[]noFilter by memory type: "episodic", "semantic", "procedural"
limitnumbernoMax results (default: 5)

pensyve_remember

ParameterTypeRequiredDescription
entitystringyesEntity this fact is about
factstringyesThe fact to store
confidencenumbernoConfidence in [0.0, 1.0] (default: 1.0)

pensyve_episode_start

ParameterTypeRequiredDescription
participantsstring[]yesEntity names of participants

pensyve_episode_end

ParameterTypeRequiredDescription
episode_idstringyesThe ID returned by pensyve_episode_start
outcomestringno"success", "failure", or "partial"

pensyve_forget

ParameterTypeRequiredDescription
entitystringyesEntity whose memories to remove
hard_deletebooleannoPermanently delete instead of soft-delete

pensyve_inspect

ParameterTypeRequiredDescription
entitystringyesEntity to inspect
memory_typestringnoFilter: "episodic", "semantic", or "procedural"
limitnumbernoMax memories to return (default: 20)

Example Usage

Once configured, Claude can use Pensyve tools in conversation:

User: "Remember that I prefer TypeScript over JavaScript."

Claude calls pensyve_remember:

{
  "entity": "user",
  "fact": "Prefers TypeScript over JavaScript",
  "confidence": 0.95
}

User: "What do you know about my preferences?"

Claude calls pensyve_recall:

{
  "query": "user preferences",
  "entity": "user",
  "limit": 10
}

Environment Variables

VariableDefaultPurpose
PENSYVE_PATH~/.pensyve/SQLite database location
PENSYVE_NAMESPACEdefaultMemory namespace

Set these in the env block of your MCP config, or export them in your shell before running the binary.