polymnemo MCPサーバー
コミット 2026年10月27日Postgresとpgvectorを使用し、セマンティック検索、セッション管理、マルチメディアストレージを通じて、異なるLLM間で共有可能な長期記憶を提供します。
別名 PCBZ/polymnemo
- スター
- 0
- ツール
- 2
- ダウンロード数(30日間)
- —
- 最新バージョン
- 1.5.0
- 最終コミット
- 2026年10月27日
- ライセンス
- MIT
polymnemo MCPとは
polymnemoはMCPサーバーです。 Postgresとpgvectorを使用し、セマンティック検索、セッション管理、マルチメディアストレージを通じて、異なるLLM間で共有可能な長期記憶を提供します。. 2個のツールを提供しており、keyword, rrfなどがあります。
プロジェクトのREADMEから生成された概要
polymnemo MCP server について
polymnemoは、Model Context Protocolを通じて、異なるLLM間で共有可能な長期記憶システムを提供します。Claude DesktopやIDEなどのMCP対応クライアントを単一のエンドポイントに接続することで、複数のアシスタントが同じ保存済み情報にアクセスできます。このサーバーはpgvectorを備えたPostgresデータベースを使用してセマンティック検索を管理し、事実の保存、会話トランスクリプト全体の保存、画像や動画などのマルチメディアファイルの管理を可能にします。
このサーバーはプライバシーとローカルコントロールを重視して設計されています。エンベディングはONNXを使用してローカルで処理されるため、外部のエンベディングAPIキーは不要であり、サーバーによる生成系LLMへの呼び出しも発生しません。ユーザーは名前空間(namespace)を通じてデータを管理でき、共有名前空間は全員が読み取り可能ですが、その他のコレクションは所有者のみがアクセスできるプライベートな状態に保たれます。セットアップにはPostgresの接続文字列とBearer認証用のAPIキーが必要であり、システムはTerraformを使用してAzure Container AppsやGoogle Cloud Runにデプロイできます。
できること
- 1アシスタントを跨いだ知識共有開発者は、あるAIアシスタントで特定の事実を保存し、別のLLMクライアントを使用する際にその情報を正確に呼び出すことができます。
- 2永続的な会話履歴AIに対してチャットのトランスクリプト全体を保存するよう指示することで、将来のセッションでコンテキスト全体を再ロードできます。
- 3セマンティックな情報検索AIクライアントは、単なるキーワードの一致だけでなく、意味に基づいたクエリを使用して保存された記憶を検索できます。
- 4マルチメディア記憶の添付ユーザーは記憶にファイル、画像、または動画を添付できます。実際のバイトデータはオブジェクトストレージに保存され、検索可能な説明文はベクトルデータベースに保持されます。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
polymnemo MCPのインストール方法
フォーマット検証日 2026年11月10日Claude Codeにpolymnemo MCPをインストール
$ claude mcp add --transport http polymnemo https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcpCursorにpolymnemo MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"polymnemo": {
"url": "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
}
}
}VS Codeにpolymnemo MCPをインストール
.vscode/mcp.json
{
"servers": {
"polymnemo": {
"type": "http",
"url": "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
}
}
}Codexにpolymnemo MCPをインストール
~/.codex/config.toml
[mcp_servers.polymnemo] url = "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
Gemini CLIにpolymnemo MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"polymnemo": {
"httpUrl": "https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcp"
}
}
}polymnemo MCPツール 2
READMEから検出keywordrrf
| keyword | — | |
| rrf | — |
設定
POLYMNEMO_API_KEYSPOLYMNEMO_DATABASE_URL
| 名前 | 説明 | 種類 |
|---|---|---|
| POLYMNEMO_API_KEYS | — | |
| POLYMNEMO_DATABASE_URL | — |
自動チェック
実行日 2026年11月14日詳細レポート →まだ検証されていません。サーバーには80点のスコア、重大な問題がないこと、および検証に必要な十分なデータが必要です。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能pcbz/polymnemo is public and reachablegithub.com/pcbz/polymnemo ↗合格
- パッケージがこのリポジトリをソースとして示している未チェック
- ビルドの来歴(Sigstore 証明)未チェック
- オープンソースライセンス (OSI)MITspdx.org/licenses/MIT.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-10-28github.com/pcbz/polymnemo ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していない未チェック
- パッケージと依存関係に重大なアドバイザリがない未チェック
- モデルへの隠れた指示がない2 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされているNo tool named like delete, drop or exec合格
- リモート endpoint が MCP ハンドシェイクに応答するHTTPS endpoint answered 401 (sign-in required)合格
README
GitHubで見るpolymnemo
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のよくある質問
polymnemo MCPをClaude Codeに追加するには
ターミナルでclaude mcp add --transport http polymnemo https://polymnemo.purpleground-26f6d744.westus2.azurecontainerapps.io/mcpを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
polymnemo MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
polymnemo MCPが提供するツールは
2個のツールを提供しており、keyword, rrfなどがあります。
このサーバーは生成系LLMへの呼び出しを行いますか?
いいえ、このサーバーは生成系LLMへの呼び出しを行いません。エンベディングはONNXを使用してローカルで実行されます。
異なるAIアシスタント間でどのように記憶を共有できますか?
MCPに対応したクライアントを単一のpolymnemoエンドポイントに向けることで、Postgresデータベースに保存された同じ記憶を共有できます。
記憶の中に画像や動画を保存できますか?
はい、ファイル、画像、動画を添付できます。実際のバイトデータはオブジェクトストレージに送信され、検索可能な説明文がエンベディングされます。
記憶を呼び出すための検索モードにはどのようなものがありますか?
意味に基づく類似性検索、完全一致のサブストリング検索、およびその両方を組み合わせるRRF (Reciprocal Rank Fusion) をサポートしています。