Memgate

MCP文档知识

提供方 未标注

文档知识 未标注 未标注 社区 / 第三方 ClaudeCursorVS CodeGemini CLI

共享智能体记忆的访问控制、冲突解决与审计。

一句话选型结论

按资料字段整理

Memgate 属于文档知识类 MCP 服务器,传输方式未标注,鉴权方式未标注,可直接接入 Claude、Cursor、VS Code 等,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类文档知识 传输方式未标注 鉴权未标注 部署方式未标注
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

文档知识
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

记忆

安装与配置

未标注 未标注
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
文档检索问答

在你的文档库里按问题找答案。

知识库读写

把新资料写进知识库,随用随取。

内容整理

把零散资料归纳成结构化笔记。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 已适配 Claude、Cursor、VS Code,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在文档知识场景里让模型直接调用外部能力的人。
  • 已经在用 Claude、Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Memgate当前 未标注 未标注 未标注 无 未标注
dify 未标注 stdio · 本地进程 本地部署 有 2026-04-11
open-webui 未标注 stdio · 本地进程 本地部署 有 2026-04-11
JeecgBoot 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Cherry Studio 未标注 未标注 未标注 无 2026-05-17
mempalace 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

文档知识
字段来自项目仓库与公开索引,中文说明由本站标注
提供方未标注上游标注的维护方 未标注
分类文档知识本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式未标注远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

8.3 KB
来自项目仓库与上游目录的原文,未做删改

Memgate

Access control, conflict resolution, and audit for shared agent memory.

Memgate sits in front of the memory your AI agents share. It decides who can read and write what, resolves conflicting writes, and records every operation — so a multi-agent system's memory stays trustworthy as it grows.

It speaks MCP, so agents connect with one config entry and no code changes.

> Status: early but working. The core (policy, conflict handling, audit, MCP tools) runs and is tested end-to-end with real agents. Adapters for external memory backends and a hosted dashboard are on the roadmap, not built yet. Feedback and issues welcome.


Demo


The problem

A single agent's memory is easy: keep the conversation in context, done. But when several agents share one memory pool — one handling support, one writing code, one doing billing — that pool degrades:

  • Conflicting writes. One agent records "customer is happy," another records "customer is angry." Nobody knows which is current.
  • No access boundaries. The billing agent can read customer PII; the support agent can overwrite financial records. Nothing stops it.
  • No accountability. When something goes wrong, there's no record of which agent wrote what, or when.

Memory stores like pgvector, Mem0, or Zep hold memory well. They don't govern it. Memgate is the governance layer that sits on top.

The idea

Think of the shared memory as a ledger, and Memgate as the gatekeeper standing in front of it. Agents never touch the ledger directly — every request goes through the gate, which does three things:

  1. Policy — checks whether this agent's role may read or write this namespace. Default is deny.
  2. Conflict resolution — when a record already exists for an entity, applies the namespace's strategy (last-write-wins, versioned, or require-review) instead of silently clobbering it.
  3. Audit — appends every operation, allowed or denied, to an append-only log.

Identity is bound to the API key, not to anything the agent says. An agent cannot escalate its own privileges by claiming a different role.

How it works```

Agent A ─┐
Agent B ─┼── MCP ──▶ [ Memgate ] ──▶ Postgres + pgvector
Agent C ─┘ policy · conflict · audit


Agents call three tools through MCP:

| Tool | What it does |
|------|--------------|
| `memory_write(namespace, entity_key, content)` | Policy check → conflict resolution → write → audit |
| `memory_read(namespace, entity_key)` | Policy check → return the active record → audit |
| `memory_search(namespace, query)` | Policy check → semantic search over authorized namespaces → audit |

---

## Quickstart

Requires Docker.```bash
git clone https://github.com/denizayhan04/memgate
cd memgate
docker compose up --build

This starts Postgres (with pgvector), runs migrations, and serves the MCP endpoint on :8088.

Create an agent and get its API key:```bash
docker compose exec memgate memgate agent create --name support-bot --role support

→ API key (shown once): mg_live_...


Connect an MCP client (Claude Code, Cursor, or anything that speaks MCP). Add to your project's `.mcp.json`:```json
{
  "mcpServers": {
    "memgate": {
      "type": "http",
      "url": "http://localhost:8088/mcp",
      "headers": { "Authorization": "Bearer mg_live_YOUR_KEY" }
    }
  }
}

Now the agent has memory_write, memory_read, and memory_search tools, scoped to whatever its role allows.

Inspect what happened:```bash
docker compose exec memgate memgate audit --entity "customer:acme"
``````
ID AT AGENT ACTION NAMESPACE ENTITY_KEY RESULT
14 2026-07-08T15:43:30Z test-eng write customer-data customer:acme denied
13 2026-07-08T15:43:14Z test-eng read customer-data customer:acme allowed
12 2026-07-08T15:41:05Z test-support read customer-data customer:acme allowed
11 2026-07-08T15:41:02Z test-support write customer-data customer:acme allowed


Two agents, one shared record, different permissions — the support agent writes and reads; the engineer reads but cannot write. Every attempt, allowed or denied, is on record.

---

## Policies

Policies live in a YAML file (`config/policies.example.yaml` by default), not in the database — so they're versioned in git and reviewed like any other config. The rule is **default deny**: anything not explicitly granted is closed.```yaml
namespaces:
  customer-data:
    conflict_strategy: versioned        # old record superseded, new active; history queryable
  tech-context:
    conflict_strategy: last-write-wins  # new record overwrites old
  billing:
    conflict_strategy: require-review   # write parked as pending until a human approves

roles:
  support:
    customer-data: [read, write]
    tech-context:  [read]
  engineer:
    tech-context:  [read, write]
    customer-data: [read]
  finance-bot:
    billing:       [read, write]
    customer-data: [read]
  auditor:
    "*":           [read]

The running server reloads the policy file without a restart, on SIGHUP or via memgate reload.

Conflict strategies

When a write targets an entity that already has an active record:

  • last-write-wins — the new record becomes active, the old one is marked superseded.
  • versioned — same, but history is preserved and queryable (what did we know, and when).
  • require-review — the new write is parked as pending_review; the existing record stays active until a human approves it.

Reviewing parked writes:```bash
memgate review list # list memories awaiting review
memgate review approve <id> # make a pending memory active
memgate review reject <id> # reject it


---

## CLI```
memgate serve                            Start the MCP (Streamable HTTP) server
memgate migrate                          Apply SQL migrations
memgate agent create --name N --role R   Create an agent and print its API key
memgate review list                      List memories awaiting review
memgate review approve &lt;id&gt;              Approve a pending memory
memgate review reject &lt;id&gt;               Reject a pending memory
memgate reload                           Reload the policy YAML in a running server
memgate audit [--entity K] [--namespace N] [--agent A] [--limit N]
                                         Show audit log, most recent first

Environment

Variable Purpose
MEMGATE_DATABASE_URL Postgres DSN (required)
MEMGATE_POLICY_FILE Policy YAML path (default config/policies.example.yaml)
MEMGATE_LISTEN_ADDR Listen address for serve (default :8080)
MEMGATE_MIGRATIONS_DIR Migrations directory (default migrations)
MEMGATE_PID_FILE PID file written by serve, read by reload
MEMGATE_OPENAI_API_KEY Optional. Set for real embeddings; unset falls back to a deterministic offline embedder, so search works without a key.

Local development```bash

make build # compile to bin/memgate
make test # run tests
make migrate # apply migrations (needs MEMGATE_DATABASE_URL)
make run # run the MCP server locally
make up # docker compose up --build
make down # stop and remove services


Running from source without Docker:```bash
export MEMGATE_DATABASE_URL=&quot;postgres://memgate:memgate@localhost:5432/memgate?sslmode=disable&quot;
go run ./cmd/memgate agent create --name support-bot --role support

Design notes

  • Backend-agnostic by design. The memory store is behind an interface. Today the only implementation is Postgres + pgvector; adapters for external stores (Mem0, Zep) can be added without touching the policy, conflict, or audit layers.
  • Identity is the key, not the claim. An agent's role is resolved from its API key on every request. What the agent says about its role is irrelevant — there is no way to self-escalate.
  • Audit is append-only. The audit log rejects updates and deletes at the database level, not just in application code.

Roadmap

  • Backend adapters (Mem0, Zep)
  • REST endpoints alongside MCP, for clients that don't speak MCP
  • A read-only audit dashboard
  • Team policy management and SSO (hosted)

Tech

Go · Postgres + pgvector · mark3labs/mcp-go · MCP Streamable HTTP transport.

License

Apache 2.0. See LICENSE.

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
Memgate 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Memgate 怎么在 Claude、Cursor、VS Code 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Memgate 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Memgate 需要 API Key 吗?

资料没有标注鉴权方式,是否需要密钥取决于服务本身,接入前按官方文档确认。

Memgate 支持哪些客户端?

资料标注支持 Claude、Cursor、VS Code、Gemini CLI、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Memgate 能提供哪些能力?

资料显示能力标签包括 记忆。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。