Skip to main content
Glama
LogicMem MCP Server

LogicMem MCP Server

Official
by LogicMem
README.md
# LogicMem: prove what your AI agents did

Six months from now, someone asks what your AI agent did and what it relied on. A risk team, an auditor, a customer who disputes a decision. Ordinary logs can be edited, and you can't show they weren't.

Meanwhile you're the go-between. You paste one agent's output into chat so the next agent can use it, and when a handoff goes wrong you rebuild it from history.

LogicMem fixes both. What your agents store, search and share through LogicMem lands on a hash-chained, tamper-evident record for your workspace that you can re-check at any time. The same connection lets your agents share notes with each other in real time.

This repo is the open-source client kit: a Python SDK and a local MCP bridge. The LogicMem service runs in our cloud and is not in this repo.

[![Python 3.11+](https://img.shields.io/badge/Python-3.11+-blue)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![MCP](https://img.shields.io/badge/MCP-streamable%20HTTP-blueviolet)](https://modelcontextprotocol.io)

## What you get

- **A record you can check.** Each entry carries the hash of the one before it. Change or reorder an entry and the next check fails at that spot.
- **Agents that hand off without you.** One agent shares a note. Agents with an open listening connection hear about it as it happens; the rest catch up the next time they check in.
- **One record across vendors.** Any agent that speaks MCP can connect with the same workspace key, so their writes land on the same chain.

What a check does not do: it doesn't prove a note was true or complete, and on its own it doesn't show that the newest entries were removed. Save the `head_hash` from a check somewhere outside LogicMem; a later check that no longer reaches it shows entries went missing. LogicMem is a building block for your records, not a compliance certificate, and nothing here is legal advice.

## Get a key

Create a free account at **[logicmem.io/signup](https://logicmem.io/signup)**, confirm your email, and copy your API key from the dashboard. Keys start with `lm_`. Treat yours like a password and keep it out of git.

Running a team pilot? [Request a pilot](https://logicmem.io/design-partner/). Pilot pricing is on request.

## Connect an agent (no install needed)

Point any MCP client that supports remote servers at the hosted endpoint:

- URL: `https://mcp.logicmem.io/mcp` (streamable HTTP)
- Header: `Authorization: Bearer lm_YOUR_API_KEY`

Many clients take a JSON config like this one. Check your client's docs for where it goes and the exact key names:

```json
{
  "mcpServers": {
    "logicmem": {
      "url": "https://mcp.logicmem.io/mcp",
      "headers": { "Authorization": "Bearer lm_YOUR_API_KEY" }
    }
  }
}
```

Every request needs the key, including `initialize` and `tools/list`. Without one the server answers HTTP 401.

Then try a handoff with two agents on the same workspace:

1. In agent A: "Use `logicframe_memory_share` to tell my other agents the deploy freeze starts Friday."
2. In agent B: "Use `logicframe_memory_sync_check` with an empty client_id to see what my other agents shared." (Today that tool still asks for a `client_id`; an empty one means your key's workspace.)
3. In either one: "Run `logicframe_audit_verify`." You should see `"chain_valid": true`.

### Hosted tools

These are the tools a standard key sees (checked Dec 4, 2026). Run `tools/list` for the current set and full schemas.

| Tool | What it does |
|------|--------------|
| `logicframe_memory_log` | Store a memory (goes on the audit record) |
| `logicframe_memory_recall` | Search memories in plain language |
| `logicframe_memory_share` | Share a note with your other agents |
| `logicframe_memory_sync_check` | Catch up on shares from your other agents |
| `logicframe_memory_supersede` | Mark older facts as replaced by a newer one |
| `logicframe_memory_contradiction_candidates` | Find stored memories a new fact may contradict (changes nothing) |
| `logicframe_action_log` | Record an action your agent took (a tool call, handoff or decision) |
| `logicframe_audit_verify` | Re-check the hash chain |
| `logicframe_audit_export` | Export the audit chain, or just a head-hash receipt |
| `logicframe_data_delete_request` | Delete memories by `entry_id` |
| `logicframe_health` | Check the connection |

Pass a stable `agent_id` (the same name every time) so the record shows which agent did what.

## Python SDK

```bash
python3 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install git+https://github.com/LogicMem/LogicMem-mcp-.git
export LOGICMEM_API_KEY="lm_YOUR_API_KEY"
```

Install from GitHub as shown. The `logicmem` package on PyPI is an older 0.1.1 build that doesn't match the current service.

```python
import os
from logicmem import LogicMem, A2AClient, AuditChain

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

# Store and search
memory.log(text="The deploy freeze starts Friday.", category="task", importance=8, agent_id="planner")
for hit in memory.recall(query="deploy freeze"):
    print(hit["text"])

# Re-check the audit record
check = AuditChain(memory).verify()
print(check["chain_valid"], check["head_hash"])

# Hand off between two agents on the same workspace
researcher = A2AClient(api_key=os.environ["LOGICMEM_API_KEY"], agent_id="researcher")
researcher.share(text="Q3 report is due Friday. Cost breakdown first.", category="task", importance=9)

executor = A2AClient(api_key=os.environ["LOGICMEM_API_KEY"], agent_id="executor")
for note in executor.sync():
    print(note["agent_id"], "shared:", note["text"])
```

You don't need a `client_id`. The server uses your key's workspace. If you send a different one, the server answers 403 and the SDK raises `PermissionDeniedError`.

Errors are subclasses of `LogicMemError`: `AuthenticationError` (401), `PermissionDeniedError` (403), `MemoryNotFoundError` (404), `RateLimitError` (429), `ValidationError` (400 or 422), `ServerError` (5xx) and `NetworkError`.

## Local stdio bridge

Some MCP clients can only start a local command. For those, install the kit and use `logicmem-server`. It forwards your client's MCP messages to the hosted server, so your agent sees the same tools.

```json
{
  "mcpServers": {
    "logicmem": {
      "command": "logicmem-server",
      "env": { "LOGICMEM_API_KEY": "lm_YOUR_API_KEY" }
    }
  }
}
```

If your client can't find the command, use the full path from `which logicmem-server`, or `"command": "python3", "args": ["-m", "logicmem.cli"]`. The bridge passes along your client's requests only, so live share notifications need a direct connection; through the bridge, use `logicframe_memory_sync_check` to catch up.

## Docs

- [Quickstart](docs/QUICKSTART.md): key, first agent, first check, in a few minutes
- [MCP reference](docs/MCP-PROTOCOL.md): endpoint, auth, tools
- [Agent-to-agent sharing](docs/A2A-PROTOCOL.md): shares, catch-up, what goes on the record
- [Security](docs/SECURITY.md): what is protected and what isn't
- [Examples](docs/EXAMPLES.md)
- [Offline verifier](verify/README.md): check a saved export against your receipts without trusting our server

## Links

- [logicmem.io](https://logicmem.io)
- [Try the record check in your browser](https://logicmem-sandbox.pages.dev) (sample data, runs locally)
- [EU AI Act Article 12 in plain English](https://logicmem.io/eu-ai-act-article-12/)
- Questions: [info@logicframe.io](mailto:info@logicframe.io)
- Security reports: see [SECURITY.md](SECURITY.md)

## Contributing and license

Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) and the [changelog](CHANGELOG.md). MIT licensed, see [LICENSE](LICENSE).

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