Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:24kchengYe MemoMind MCP Tool Exposure

From Leeroopedia
Knowledge Sources
Domains MCP, LLM_Engineering, API_Design
Last Updated 2026-10-28 00:00 GMT

Overview

Pattern that exposes a memory system's operations (retain, recall, reflect) as MCP tools, enabling AI agents like Claude Code to autonomously call them through the Model Context Protocol.

Description

The Model Context Protocol (MCP) is a standard for connecting AI agents to external tools and data sources. By registering memory operations as MCP tools, an AI agent can:

  • Retain: store new memories as it learns facts
  • Recall: search past memories for relevant context
  • Reflect: deep-reason over all memories to answer complex questions

The registration system is configurable:

  • Multi-bank mode: all tools expose a `bank_id` parameter for cross-bank operations
  • Single-bank mode: tools are scoped to one bank (no `bank_id` parameter)
  • Tool filtering: per-bank `mcp_enabled_tools` allowlist restricts which tools are available
  • Tool tolerance: extra LLM-generated arguments (e.g., "explanation") are silently stripped

Beyond the core three tools, the full set includes mental model management, directive CRUD, memory browsing, document operations, operation tracking, tag listing, and bank management.

Usage

Use this principle when an AI agent needs direct, autonomous access to a memory system's operations. It is the integration layer between Claude Code (or any MCP client) and MemoMind.

Theoretical Basis

# Abstract MCP registration (not real implementation)
mcp = FastMCP("hindsight-mcp-server")

@mcp.tool()
async def retain(content, context="general", tags=None, bank_id=None):
    """Store a memory."""
    result = await memory.submit_async_retain(bank_id, content, ...)
    return {"status": "accepted", "operation_id": result["operation_id"]}

@mcp.tool()
async def recall(query, max_tokens=2048, bank_id=None):
    """Search memories."""
    return await memory.recall_async(bank_id, query, max_tokens, ...)

@mcp.tool()
async def reflect(query, bank_id=None):
    """Deep reasoning over memories."""
    return await memory.reflect_async(bank_id, query, ...)

The MCP server runs as an HTTP transport endpoint (`/mcp/` for multi-bank, `/mcp/{bank_id}/` for single-bank), registered via `claude mcp add --transport http`.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment