Skip to main content
Glama
LogicMem MCP Server

LogicMem MCP Server

Official
by LogicMem

LogicMem: prove what your AI did

Tamper-evident, hash-chained records of what your AI agents did and relied on, so you can show an auditor whether anything was changed. This is the open-source SDK and MCP connector. Records are kept and verified on the LogicMem server, in our cloud.

Observability tells you what broke. LogicMem shows what happened.

Python 3.11+ License: MIT MCP Compatible


The problem

Six months from now, an auditor asks what your AI agent did and what it relied on. Ordinary logs can be edited, and nobody can prove they weren't.

Related MCP server: LogicMem MCP Server

What LogicMem gives you

A tamper-evident, hash-chained record of your agents' key memory operations, so you can show whether anything was changed. Shared memory across vendors comes with it.


What is in this repo

  • Python SDK (logicmem, MIT licensed): a client for the LogicMem REST API at https://api.logicmem.io.

  • Local MCP server (logicmem-server): a stdio bridge that serves logicmem_* tools to MCP clients.

  • Docs for the hosted MCP server at https://mcp.logicmem.io/mcp, which serves logicframe_* tools.

The LogicMem server itself (storage, reasoning engine, audit chain) is not in this repo; it runs in LogicMem's cloud.

Access: API keys are issued to pilot teams. Pilots run 30 days, from $500/mo: logicmem.io/design-partner.


Install

Use a virtual environment (works on macOS, Linux and Windows):

python3 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate

# SDK only
pip install git+https://github.com/LogicMem/LogicMem-mcp-.git

# SDK + local MCP server (logicmem-server)
pip install "logicmem[cli] @ git+https://github.com/LogicMem/LogicMem-mcp-.git"

Install from GitHub as shown. The logicmem package on PyPI is an older 0.1.1 build with out-of-date links.


Quick start

1. Get an API key

Keys start with lm_. They are issued to pilot teams while self-serve sign-up is being rebuilt: request one at logicmem.io/design-partner. Treat the key like a password.

Requests over your rate limit return HTTP 429 (RateLimitError in the SDK).

2. Use the Python SDK

import os
from logicmem import LogicMem

memory = LogicMem(api_key=os.environ["LOGICMEM_API_KEY"])

# Store a memory
memory.log(
    text="User prefers urgent messages via Telegram, not email.",
    category="preference",
    importance=8,
)

# Search memories
results = memory.recall(query="user communication preferences")
for r in results:
    print(r.get("text"))

# Session briefing (a context summary from the server)
brief = memory.session(client_id="default")
print(brief)

3. Reasoning engine

answer = memory.reason(
    question="Should we prioritize the mobile app or web dashboard first?",
    context="User is a solo founder with limited engineering bandwidth.",
    mode="deep",  # fast / deep / exhaustive
)
print(answer.get("answer"))
print(answer.get("confidence"))

verify(), reflect() and intelligence() exist on the client but always raise NotImplementedError: those features run only as MCP tools (logicframe_verify, logicframe_reflect, logicframe_intelligence) on the hosted server. Call them from an MCP client (see below).

4. Agent-to-agent (A2A) memory sharing

import os
from logicmem.a2a import A2AClient

a2a = A2AClient(api_key=os.environ["LOGICMEM_API_KEY"], agent_id="agent-researcher")

# Register this agent
a2a.register(name="Researcher Agent", agent_type="agent", client_id="team-alpha")

# Share context with another agent
a2a.share_memory(
    target_agent_id="agent-executor",
    memory={"text": "User needs Q3 report by Friday. High priority."},
    category="task",
    importance=9,
    client_id="team-alpha",
)

# In the other agent: fetch memories shared by other agents
executor = A2AClient(api_key=os.environ["LOGICMEM_API_KEY"], agent_id="agent-executor")
for entry in executor.sync(client_id="team-alpha"):
    print(entry.get("text"))

5. Verify the audit chain

from logicmem.audit import AuditChain

audit = AuditChain(memory)  # pass a LogicMem client

# Ask the server to re-check the hash chain
print(audit.verify())

# Log a correction (stored on the server and queued for its training pipeline)
audit.log_correction(
    original="The user prefers email for urgent messages.",
    corrected="The user prefers Telegram for urgent messages, not email.",
    reason="User explicitly stated Telegram in a call.",
)
print(audit.dpo_stats())

Architecture

┌──────────────────────────────────────────────────────────────┐
│                      Your AI Agent                           │
│              (Claude, GPT, any MCP client)                   │
└──────────────────────────────────────────────────────────────┘
          │ MCP (hosted or local stdio)        │ Python SDK
          ▼                                    ▼
┌───────────────────────────┐      ┌───────────────────────────┐
│ Hosted MCP server         │      │ REST API                  │
│ mcp.logicmem.io/mcp       │      │ api.logicmem.io           │
│ logicframe_* tools        │      │ (also used by             │
│                           │      │  logicmem-server)         │
└───────────────────────────┘      └───────────────────────────┘
          └──────────────► LogicMem server ◄──────────┘
                 memory · reasoning · A2A · audit chain

Connect an MCP client

Option A: hosted MCP server URL

Add LogicMem as a streamable-http MCP server. Example for OpenClaw (~/.openclaw/openclaw.json):

{
  "mcp": {
    "servers": {
      "logicmem": {
        "transport": "streamable-http",
        "url": "https://mcp.logicmem.io/mcp",
        "headers": {
          "Authorization": "Bearer lm_YOUR_API_KEY"
        }
      }
    }
  }
}

Other clients (Claude Code, Cursor and similar) use the same URL and header in their own MCP settings.

Option B: local stdio server

If your client works better with a local command, install the CLI extra:

pip install "logicmem[cli] @ git+https://github.com/LogicMem/LogicMem-mcp-.git"
logicmem-server --help

Then point your client at the logicmem-server command:

{
  "mcp": {
    "servers": {
      "logicmem": {
        "command": "logicmem-server",
        "env": {
          "LOGICMEM_API_KEY": "lm_YOUR_API_KEY",
          "LOGICMEM_CLIENT_ID": "your-client-id"
        }
      }
    }
  }
}

Check your setup

openclaw mcp list   # LogicMem should be listed

Then ask your agent to store a note with logicframe_memory_log (hosted) or logicmem_memory_log (local) and recall it.

Environment variables (for logicmem-server)

The Python SDK does not read these; pass api_key and base_url to LogicMem(...) instead.

Variable

Default

Description

LOGICMEM_API_KEY

—

Your API key (lm_...), issued to pilot teams

LOGICMEM_SERVER_URL

https://api.logicmem.io

Override the LogicMem REST API URL

LOGICMEM_CLIENT_ID

default

Default client_id for memory operations

LOGICMEM_TIMEOUT

30

HTTP request timeout in seconds


MCP reference

Hosted MCP endpoint: https://mcp.logicmem.io/mcp (JSON-RPC over HTTPS POST) REST API base URL: https://api.logicmem.io

Authentication: Authorization: Bearer <api_key>. initialize and tools/list are public; tools/call requires a key.

Tool name prefix: the hosted server serves logicframe_* tool names (e.g. logicframe_memory_log, logicframe_memory_recall). The local pip server (logicmem-server) serves logicmem_* tool names. Both use the same backend.

Commonly used hosted tools

The hosted server lists many more tools; run tools/list to see them all.

Tool

Description

logicframe_memory_log

Store a new memory with category, importance, tags

logicframe_memory_recall

Search memories with natural language

logicframe_memory_context

Get context about a client, project, or person

logicframe_reason

Multi-step reasoning that consults memory

logicframe_verify

Check a claim against stored memories

logicframe_reflect

Critique a draft answer against memory

logicframe_intelligence

Look for patterns and overdue items

logicframe_audit_verify

Verify integrity of the audit chain

logicframe_correction_log

Log a correction (queued for DPO training)

logicframe_conversations_store

Store conversation state for auto-resume

logicframe_conversations_resume

Retrieve stored conversation state

See MCP-PROTOCOL.md for details.


Security

  • In transit: HTTPS (the hosted endpoints negotiate TLS 1.3)

  • Audit: key memory operations made through the API and MCP connector (for example log, recall and correct) are logged to a tamper-evident, hash-linked chain that you can re-check with logicframe_audit_verify or AuditChain.verify(). Not every endpoint writes an audit entry yet.

  • API keys: sent as a Bearer token; keep them out of code and git

See SECURITY.md.


Documentation

Doc

What you need

Start here

Install + first script

MCP protocol

Hosted MCP server reference

A2A sharing

Agent-to-agent memory

Security

Transport, auth, audit chain

Code examples

All examples in one place

Embedding fallback

How the server handles embedding-provider outages

Doc index

Everything else


Contributing

Contributions welcome. Please see CONTRIBUTING.md. We especially welcome MCP client examples, framework integrations (LangChain, CrewAI, etc.), A2A extensions, and SDKs in other languages.

Changelog

See CHANGELOG.md.

License

MIT License. See LICENSE.

Available Tools

12 tools
logicmem_a2a_heartbeatD

Send a heartbeat to the A2A registry.

Inputs: agent_id (required), client_id (required), status.

logicmem_a2a_list_agentsA

List all registered agents for a client_id.

Inputs: client_id (required).

logicmem_a2a_registerC

Register this agent in the A2A registry.

Inputs: agent_id (required), client_id (required), name, agent_type.

logicmem_a2a_syncB

Check for new shared memories from other agents since last sync.

Inputs: agent_id (required), client_id (required), limit, since_timestamp.

logicmem_a2a_write_sharedC

Write a memory to the shared A2A pool.

Inputs: text (required), agent_id (required), client_id (required), tags, +3 more.

logicmem_memory_healthA

Check if the LogicMem memory server is healthy.

Inputs: no named parameters.

logicmem_memory_logA

Store a new memory. The agent's memory is permanent and searchable across sessions. Be specific — include who, what, when, why.

Inputs: text (required), tags, source, category, +2 more.

logicmem_memory_outcomeB

Record whether a stored memory was useful. Feeds the DPO training pipeline.

Inputs: success (required), memory_ids (required), magnitude.

logicmem_memory_recallC

Search memory for relevant entries.

Inputs: query (required), limit, client_id.

logicmem_memory_reflectB

Self-critique: evaluate a draft answer against retrieved memories.

Inputs: question (required), draft_answer (required), memory_query.

logicmem_memory_sessionB

Full memory session briefing — recall + sentiment + constraints + intelligence + gaps.

Inputs: client_id.

logicmem_memory_statsA

Get memory system stats — total entries, categories, storage.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 12 tools

    Disambiguation5/5

    All 12 tools have clearly distinct purposes, split into two coherent groups: memory operations (log, recall, stats, session, health, outcome, reflect) and A2A operations (register, heartbeat, list_agents, write_shared, sync). No overlapping functionality.

    Naming Consistency5/5

    Tool names follow a consistent pattern: `logicmem_<group>_<action>`. Memory tools use `memory_` and A2A tools use `a2a_`. Verbs are descriptive (log, recall, stats, etc.), making the pattern predictable.

    Tool Count5/5

    With 12 tools covering memory management and agent-to-agent communication, the count is well-scoped. Each tool serves a distinct function without redundancy, fitting the server's purpose.

    Completeness4/5

    The set covers core memory operations (store, recall, stats, session, outcome, reflect, health) and A2A operations (register, heartbeat, list, write shared, sync). Minor gaps exist, such as no explicit delete/update for memories, but the design suggests permanence.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Governed shared memory platform for AI agents and agent fleets. Provides persistent memory, cross-agent knowledge sharing, permissions, audit trails, and multi-tenant isolation through a Model Context Protocol (MCP) server.
      4 npm
      556
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides persistent memory for AI coding agents through the Model Context Protocol, enabling them to store and retrieve project knowledge across sessions.
      27 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Gives AI agents durable project memory via the Model Context Protocol, allowing them to read tasks, record decisions, search context, and sync snapshots to the cloud.
      12 npm
      MIT