polymnemo MCP server
Commit Oct 27, 2026Provides shared long-term memory across different LLMs using semantic recall, session management, and multimedia storage via Postgres and pgvector.
Also known as PCBZ/polymnemo
- Stars
- 0
- Tools
- 2
- Downloads, 30 days
- โ
- Latest version
- 1.5.0
- Last commit
- Oct 27, 2026
- License
- MIT
What is polymnemo MCP?
polymnemo provides shared long-term memory across different LLMs using semantic recall, session management, and multimedia storage via Postgres and pgvector. It exposes 2 tools, such as keyword, rrf.
Summary generated from the project's README
About polymnemo MCP server
polymnemo provides a shared long-term memory system for different LLMs through the Model Context Protocol. By connecting any MCP client, such as Claude Desktop or an IDE, to a single endpoint, multiple assistants can access the same stored information. The server uses a Postgres database with pgvector to manage semantic recall, allowing users to store facts, save entire conversation transcripts, and manage multimedia files like images or video.
This server is designed for privacy and local control. Embeddings are processed locally using ONNX, meaning no external embedding API keys are required and no generative LLM calls are made by the server. Users can manage data through namespaces, where a shared namespace is readable by everyone while other collections remain private to the owner. Setup requires a Postgres connection string and API keys for bearer authentication, and the system can be deployed to Azure Container Apps or Google Cloud Run using Terraform.
What you can do with it
- 1Cross-assistant knowledge sharingA developer can save a specific fact with one AI assistant and then recall that exact information when using a different LLM client.
- 2Persistent conversation historyYou can instruct an AI to save a full chat transcript so that the entire context can be reloaded in a future session.
- 3Semantic information retrievalAn AI client can search through stored memories using meaning-based queries rather than just exact keyword matches.
- 4Multimedia memory attachmentUsers can attach files, images, or video to their memories, storing the actual bytes in object storage while keeping a searchable description in the vector database.
Written from the project's README. Every use case is checked against a quote from it.
How to install polymnemo MCP
Formats verified 10 Nov 2026Install polymnemo MCP in Claude Code
$ claude mcp add --transport http polymnemo https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcpInstall polymnemo MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"polymnemo": {
"url": "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
}
}
}Install polymnemo MCP in VS Code
.vscode/mcp.json
{
"servers": {
"polymnemo": {
"type": "http",
"url": "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
}
}
}Install polymnemo MCP in Codex
~/.codex/config.toml
[mcp_servers.polymnemo] url = "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
Install polymnemo MCP in Gemini CLI
~/.gemini/settings.json
{
"mcpServers": {
"polymnemo": {
"httpUrl": "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
}
}
}polymnemo MCP tools 2
Detected from the READMEkeywordrrf
| keyword | โ | |
| rrf | โ |
Configuration
POLYMNEMO_API_KEYSPOLYMNEMO_DATABASE_URL
| Name | Description | |
|---|---|---|
| POLYMNEMO_API_KEYS | โ | |
| POLYMNEMO_DATABASE_URL | โ |
Automated checks
Ran Nov 14, 2026Full report โNot verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work
- Source repository linked and reachablepcbz/polymnemo is public and reachablegithub.com/pcbz/polymnemo โPass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html โPass
- Commit or release in the last yearLast commit or release 2026-10-28github.com/pcbz/polymnemo โPass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model2 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeHTTPS endpoint answered 401 (sign-in required)Pass
README
View on GitHubpolymnemo
A shared long-term memory across any LLM, over MCP.
Point Claude Desktop, an MCP-capable IDE, or any MCP client at one polymnemo endpoint and they share the same memories โ stored in your own Postgres. Store a fact with one assistant, recall it from another; save whole sessions and reload them; even attach files, images, or video. Embeddings run locally (no embedding API key), and the server makes no generative-LLM calls.
Status: active development. Semantic memory + pgvector store, session save/reload, and multimedia memories all work; deployable to Azure Container Apps (or Cloud Run) via Terraform. Wiki ยท Issues
Features
- ๐ Cross-LLM shared โ point any MCP client at one endpoint; they share the same memory.
- ๐ง Semantic recall โ vector search over Postgres + pgvector by default, with exact-text and fused (RRF) modes when you need to find an ID or a name.
- ๐ฌ Sessions โ save a full transcript and reload it verbatim, or recall across it.
- ๐ผ๏ธ Multimedia โ attach files, images, or video; bytes go to object storage, only a searchable description is embedded.
- ๐ Local & private โ embeddings run locally (ONNX): no embedding API key, and no generative-LLM calls, ever.
- ๐ฅ Namespaces โ "born-shared" collections readable by everyone, vs. private-to-owner; writes are always owner-scoped.
- ๐งฉ Pluggable layers โ store, embedder, auth, retriever, blob store, and rate limiter are all swappable
Protocols. - โ๏ธ Multi-cloud deploy โ one Terraform stack to Azure Container Apps or Cloud Run, scale-to-zero.
- ๐ฆ Rate limiting โ optional global token bucket.
How it works
flowchart LR
Clients["MCP clients<br/>(Claude Desktop, IDEs, โฆ)"] -->|"/mcp ยท Bearer key"| P["polymnemo<br/>(MCP server)"]
P --> DB[("Postgres + pgvector<br/>text + pointers")]
P -. "large files<br/>(presigned URLs)" .-> OS[("Object storage<br/>S3 / R2")]
A request carries a bearer key (which resolves to a user_id); the tool passes
the rate-limit gate, then delegates to a MemoryService that chunks + embeds
text and stores the vectors in pgvector โ large files go to object storage via
presigned URLs, with only a searchable description embedded.
Every layer is a typing.Protocol, wired together by a composition root
(context.py), so you can swap an implementation
without touching the tools:
| Layer | Default | Swap for |
|---|---|---|
| Store | PostgresStore (pgvector) |
InMemoryStore (dev/tests) |
| Embedder | fastembed (local ONNX) |
StubEmbedder (offline) |
| Auth | GitHub OAuth + API tokens | static bearer keys (dev) |
| Retriever | VectorRetriever |
your own ranker |
| BlobStore | S3 / R2 | off |
| RateLimiter | global token bucket | off |
The ping tool returns the active layers, so you can see how a running server is
wired.
Quickstart
Requires Python 3.11+.
1. Install
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e . # add ".[dev]" for the test + lint tooling
2. Provision Postgres (pgvector)
The durable store is Postgres + pgvector; the easiest hosted option is Neon (use the pooled connection string). Apply the schema once:
psql "<your-connection-string>" -f scripts/schema.sql
3. Configure
Copy .env.example to .env and set the database URL and at least one API key:
POLYMNEMO_DATABASE_URL=postgresql://user:pass@host/db?sslmode=require
POLYMNEMO_API_KEYS=sk-alice-secret:alice,sk-bob-secret:bob # "key:user_id" pairs
Each key maps a bearer token to a user_id; writes are scoped to that user.
4. Run
polymnemo # Streamable HTTP at http://127.0.0.1:8000/mcp
Or with Docker:
docker build -t polymnemo .
docker run -e POLYMNEMO_DATABASE_URL="..." -e POLYMNEMO_API_KEYS="sk-alice-secret:alice" \
-e PORT=8080 -p 8080:8080 polymnemo
5. Connect an MCP client
Any client that supports remote (HTTP) MCP servers with custom headers needs two things:
- Endpoint:
http://<host>:<port>/mcp - Header:
Authorization: Bearer <your-key>
For clients that read an mcpServers config:
{
"mcpServers": {
"polymnemo": {
"url": "http://127.0.0.1:8000/mcp",
"headers": { "Authorization": "Bearer sk-alice-secret" }
}
}
}
Or verify with the inspector:
npx @modelcontextprotocol/inspector
# Transport: Streamable HTTP ยท URL: http://127.0.0.1:8000/mcp
# Header: Authorization: Bearer sk-alice-secret โ call ping / remember / recall
Concepts
- Users & keys โ sign in with GitHub, or present a bearer token. Either way
the request resolves to a
user_id, and writes are owner-scoped (you can only edit or delete your own memories). - Headless clients โ CI, cron jobs and server-side agents can't complete a
browser sign-in, so they use an API token instead. Sign in with GitHub at
<server>/tokensto create, list and revoke them; a new token is shown once and stored only as a SHA-256 hash. Deliberately not MCP tools โ a secret must never travel an LLM channel. - Namespaces โ memories live in namespaces. A shared namespace (default
shared) is readable by everyone ("born shared"); everything else is private to its owner. Sessions and media default to private namespaces. - Chunking โ long content is split into chunks on write (one vector each), so
remembermay return several ids andrecallreturns the closest chunks. - Secret scanning โ optional, and off unless you turn it on: set
POLYMNEMO_RSP_CONFIGto a scanner config (the image ships one at/app/plugins/rsp.toml). Unset, every write goes through a no-op guard and nothing is scanned. When on, the text of a memory is scanned before it is embedded or stored, so a refused write was never written rather than deleted afterwards. It coversremember,save_session,updateand a media memory's description. The contents of uploaded files are not scanned and are stored as you sent them: the bytes go straight to object storage under a presigned URL and never pass through this server. A file's description is scanned; the file is not.
Tools
polymnemo exposes MCP tools for storing, searching, and managing memories:
- Memory โ
remember,recall,list_memories,get_memory,update,forget
recall takes a mode:
| mode | finds | good for | not for |
|---|---|---|---|
similarity (default) |
by meaning, across languages | "what do I know about coffee?" | exact IDs, names, error strings |
keyword |
rows containing every word, case-insensitively | order 88312, a project codename, an error message |
synonyms; may return fewer than limit or nothing |
rrf |
both, fused by rank | when you are unsure which kind of query it is | โ |
keyword is an exact substring match. rrf fuses the top 50 candidates from each
leg, so paging through it reaches at most about 100 results.
score is only comparable within one mode, and total is the size of the
namespace searched, not the number of matches.
- Sessions โ
save_session,load_session - Media โ
create_upload,confirm_upload,get_download_url
Plus a ping health check and a memory://{namespace} resource for
auto-injecting a collection. Media bytes go to object storage via presigned URLs
โ never through the MCP channel โ with only a searchable description embedded
(needs the blob extra).
Full arguments and return shapes live in the dedicated MCP tools reference (coming soon). See Concepts for how keys, namespaces, and chunking work.
Configuration
POLYMNEMO_* environment variables (or .env) โ full list in
.env.example. The essentials:
| Variable | Default | Purpose |
|---|---|---|
POLYMNEMO_DATABASE_URL |
(unset) | Postgres+pgvector DSN. Required in production; unset โ in-memory (dev/tests). |
POLYMNEMO_API_KEYS |
(empty) | "key1:alice,key2:bob" โ required for bearer auth. |
POLYMNEMO_SHARED_NAMESPACES |
shared |
Namespaces readable by every user. |
POLYMNEMO_HOST / POLYMNEMO_PORT / POLYMNEMO_MCP_PATH |
127.0.0.1 / 8000 / /mcp |
Transport. |
POLYMNEMO_RATELIMIT_ENABLED / _PER_MIN |
false / 600 |
Optional global rate limit (ops per minute). |
POLYMNEMO_BLOB_BACKEND (+ _BUCKET / _ENDPOINT_URL / _ACCESS_KEY_ID / _SECRET_ACCESS_KEY) |
none |
Object storage for media memories; s3 = Cloudflare R2 / S3-compatible. |
POLYMNEMO_RSP_CONFIG |
(unset) | Path to a scanner config; unset means no scanning. The image ships one at /app/plugins/rsp.toml. |
Development
pip install -e ".[dev]"
pytest # fast, offline (stub embedder, in-memory store)
ruff check . && ruff format --check . # lint + format (enforced in CI)
Postgres tests run when TEST_DATABASE_URL points at a pgvector Postgres. CI
(.github/workflows/ci.yml) runs lint + the suite with coverage and posts a
pass/fail/coverage table to each run's summary.
Deploy
polymnemo is stateless (all state in Neon + object storage), so it runs on
Azure Container Apps (primary) or Google Cloud Run with scale-to-zero.
Everything is Terraform in deploy/terraform/: shared
neon/ (Postgres) and r2/
(media bucket) roots own the durable state, and a compute root deploys a service
that reads both โ so memories and media are shared across clouds.
The Azure path deploys from CI in one click: set the GitHub secrets
(scripts/setup-github-secrets.sh), bootstrap the state backend
(scripts/bootstrap-tfstate-azure.sh), then run the deploy (azure) workflow
(neon โ schema โ r2 โ build โ app). GCP is a manual failover. Full walkthrough
in docs/deploy.md.
License
MIT โ see LICENSE.
polymnemo MCP questions
How do I add polymnemo MCP to Claude Code?
Run claude mcp add --transport http polymnemo https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp in your terminal. Add --scope user to make it available in every project.
How do I add polymnemo MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does polymnemo MCP provide?
It exposes 2 tools, including keyword, rrf.
Does this server make calls to generative LLMs?
No, the server makes no generative-LLM calls and embeddings run locally using ONNX.
How can I share memories between different AI assistants?
You can point any MCP-capable client at a single polymnemo endpoint to share the same memories stored in your Postgres database.
Can I store images or videos in the memory?
Yes, you can attach files, images, or video; the actual bytes are sent to object storage while a searchable description is embedded.
What search modes are available for recalling memories?
The server supports similarity search for meaning, keyword search for exact substrings, and RRF (Reciprocal Rank Fusion) to combine both.