MemCastle 发布本地优先的 AI 编码智能体共享记忆服务器
memcastle/memcastle
MemCastle 发布本地优先、常驻运行的记忆服务器,通过 MCP 或 HTTP 让 OpenCode、Claude Code、Cursor 等多个 AI 编码智能体共享同一份记忆。
Local-first, always-on memory server for AI coding agents over MCP/HTTP
Running several AI coding agents (OpenCode, Claude Code, Cursor, ...) side by side usually means each one gets its own, disconnected memory — or none at all. MemCastle is a single daemon per palace (the memory store that one or more of your projects share) that all of them talk to over MCP or HTTP, so a mining run, a search, or a saved decision from one agent is immediately visible to every other agent and to the CLI. Everything lives in one SurrealDB store, embedded by default, so there is no external service to run.
flowchart LR
A[OpenCode] & B[Claude Code] & C[Other MCP clients] -->|MCP| D
CLI[memcastle CLI] -->|REST| D
D[memcastle daemon] --> E[(Palace: SurrealDB)]
Loading
Installation
brew install noirbizarre/homebrew-tap/memcastle # macOS paru -S memcastle-bin # Arch Linux (AUR)
Or download a binary for your platform from the latest release,
or build from source with cargo install --path ..
See the installation guide for details and platform notes.
Quickstart
Start the daemon in one terminal.
It serves 127.0.0.1:8420 and keeps its data in ~/.local/share/memcastle/default:
memcastle serve
Then, from another terminal:
memcastle status # is it up, where, and is its datastore healthy? memcastle mine ./project # submits a durable, resumable job — doesn't block memcastle job list # follow it memcastle search "why did we switch to GraphQL?"
Connect an MCP client to http://127.0.0.1:8420/mcp:
claude mcp add --transport http memcastle http://127.0.0.1:8420/mcp # Claude CodeFor OpenCode, add a remote server to opencode.json.
The MCP client guide has the exact configuration for both.
Stop and restart the daemon whenever you like: the palace is on disk, and it is all still there.
Documentation
The full documentation is at https://memcastle.github.io/.
| To... | Read |
|---|---|
| Install and try it | Installation, Quickstart |
| Use it from an agent | Connect an MCP client, Agent integrations (memcastle integration install), Agent skills, MCP tools and REST API |
| Run it day to day | Running the daemon, Authentication, Memory modes, Project configuration, Mining sources, Deduplication, Database access, Troubleshooting |
| Configure it | Configuration (XDG paths on Linux and macOS, config file, environment, flags), CLI reference |
| Know where data lives | Storage and data, Migrations and upgrades |
| Understand or change it | Architecture, Development, Architecture Decisions, Writing and publishing sources, Integration contract |
Contributing
See CONTRIBUTING.md.
License
MIT — see LICENSE.
来源:GitHub · github.com