Skip to main content

memcp

PyPI CI OpenSSF Scorecard License

Backend-agnostic, multi-tenant MCP memory server. AI clients connect and get persistent long-term memory over streamable HTTP.

Quickstart

Start memcp on 127.0.0.1:8080 with the sqlite backend, using Docker or pip. For search by meaning and fact extraction, use mem0 instead.

With Docker

Needs Docker. The command names your key and its space after your login, $USER. A key name holds only letters, digits, _, . and -: if your login has anything else, or USER is unset, replace $USER with such a name.

mkdir memcp && cd memcp &&
  curl -fsSLO https://raw.githubusercontent.com/Jartan-LLC/memcp/main/docker-compose.yml &&
  curl -fsSL -o .env https://raw.githubusercontent.com/Jartan-LLC/memcp/main/.env.example &&
  chmod 600 .env &&
  TOKEN=$(openssl rand -hex 32) && echo "$TOKEN" &&
  printf '[[keys]]\nname = "%s"\nsecrets = ["sha256:%s"]\ngrants = [{ space = "%s", relation = "writer" }]\n' \
    "$USER" "$(printf %s "$TOKEN" | sha256sum | cut -d' ' -f1)" "$USER" > keys.toml

Keep the token that printed; keys.toml holds only its hash (on macOS, use shasum -a 256 in place of sha256sum). Then start it:

docker compose up -d --wait

With pip

Needs Python 3.12 or later.

pip install memcp-server
MEMCP_BACKEND=sqlite MEMCP_SQLITE_PATH="$HOME/.memcp/memcp.sqlite3" MEMCP_HOST=127.0.0.1 memcp

Where the system Python refuses pip install (an "externally managed" environment), use pipx install memcp-server. With no MEMCP_KEYS_FILE, memcp serves one key on loopback and clients connect without a token.

Connect from Claude Code

With the token you generated:

claude mcp add --scope user --transport http memcp http://localhost:8080/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"

Behind a reverse proxy, the URL is https://<your-host>/mcp. A server started with memcp on loopback and no MEMCP_KEYS_FILE takes no --header.

Try it

Ask Claude to remember something:

"Remember that I prefer Python 3.12 and use ruff for linting."

In a new conversation, ask:

"What linter do I use?"

Claude searches memory automatically and uses the stored context. On the quickstart's sqlite backend this works because linter and linting share a stem — matching is lexical, so a question phrased in words that do not appear in the memory will not find it. mem0 is the backend that matches on meaning.

What it does

  • Durable, keyless local storage (sqlite), or mem0 on pgvector for semantic search and a knowledge graph
  • Add, search, list, update and delete memories over MCP — 12 tools, frozen surface
  • Flat scope-based filtering (agent_id, run_id)
  • Bearer-token keys, each read-only or read-write on one space, stored as hashes
  • Stateless HTTP transport — safe behind reverse proxies

Documentation

Document What it covers
deployment.md Running memcp with Docker Compose — backends, keys, reverse proxies, and running the server without Docker
reference.md Environment variables, the 12 MCP tools, and known limitations per backend
architecture.md How memcp is divided into packages, how it keeps spaces apart, and what a backend must guarantee
CONTRIBUTING.md Working on memcp itself — setup and the check loop
tests/mem0/README.md Running the conformance suite against a real mem0
CHANGELOG.md What changed, per release

Status

v0.2.0 — API may change before v1.0. Suitable for development and early adoption.

License

AGPL-3.0 — see LICENSE.

Metadata

Release files for memcp-server 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memcp-server 0.2.0
File Size Uploaded Provenance Actions
memcp_server-0.2.0.tar.gz 203.5 kB With provenance Details for memcp_server-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for memcp-server 0.2.0
File Interpreter ABI Platform Actions
memcp_server-0.2.0-py3-none-any.whl Python 3 none any Details for memcp_server-0.2.0-py3-none-any.whl

Total release size: 287.2 kB

Release files / memcp_server-0.2.0.tar.gz

Download URL memcp_server-0.2.0.tar.gz
Size 203.5 kB
Tags Source
SHA-256 checksum
How to use checksums
433737f18544476dafc87058650876c744fb7f9a7d3c3e8553dd36ea3391bec9
BLAKE2b-256 checksum
How to use checksums
adc092266634fcea02b040dac8146894987a11b7c696557d244090fdc2585add
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / memcp_server-0.2.0-py3-none-any.whl

Download URL memcp_server-0.2.0-py3-none-any.whl
Size 83.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
414e969cac1c3b499b5c431a69b285033fcc596068cdf1b79e1017584e1c2c0c
BLAKE2b-256 checksum
How to use checksums
5325d9beda31143aa8c1045448dcd366e856214b1c31067dbfca5b7c638afb0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Security for memcp-server 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for memcp_server-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page