weasley-deepmind
MCP server that gives AI agents persistent long-term memory, storing and recalling facts, decisions, errors, procedures, and episodes across sessions.
README
<!-- mcp-name: io.github.potatohoney-p/weasley-deepmind -->

Weasley DeepMind
Weasley DeepMind is a self-hosted memory server for AI agents. It stores small, typed memory fragments, links related evidence, and recalls the right context through MCP without forcing an entire conversation history back into every prompt.
It is part of the Weasley Open Source family and is released under Apache-2.0.
Why DeepMind
- Useful recall, not a transcript dump. Keyword, PostgreSQL GIN, graph-neighbor, and optional pgvector search are merged and ranked within a token budget.
- Memory with structure. Facts, decisions, procedures, preferences, episodes, and errors keep provenance, importance, links, and lifecycle state.
- MCP-native. Use a local stdio process or the Streamable HTTP endpoint at
/mcp. - Fail-closed HTTP security. The HTTP server rejects requests when no access key is configured. Authentication can only be disabled explicitly for local development.
- Self-hosted data. PostgreSQL is the system of record. Redis and external embedding or LLM providers are optional.
- Operationally ready. Migrations are serialized with a PostgreSQL advisory lock, secrets are redacted from logs, and updates refuse dirty Git checkouts.
Requirements
- Node.js 20.19 or newer
- PostgreSQL 15 or newer with the
pgvectorextension - Redis 7 (optional, for cache and low-latency keyword lookup)
Install from npm
npm install --global weasley-deepmind
Create a PostgreSQL database with pgvector, then configure the connection:
export DATABASE_URL='postgresql://postgres:password@localhost:5432/weasley_deepmind'
export WEASLEY_DEEPMIND_ACCESS_KEY='replace-with-a-long-random-secret'
weasley-deepmind migrate
weasley-deepmind serve
The HTTP server listens on http://127.0.0.1:57332 by default. Its MCP endpoint is http://127.0.0.1:57332/mcp.
Add it to an MCP client
The npm package includes a newline-delimited stdio transport. A generic MCP client configuration looks like this:
{
"mcpServers": {
"weasley-deepmind": {
"command": "npx",
"args": ["-y", "weasley-deepmind", "stdio"],
"env": {
"DATABASE_URL": "postgresql://postgres:password@localhost:5432/weasley_deepmind",
"WEASLEY_DEEPMIND_AUTO_MIGRATE": "true"
}
}
}
}
For an already-running HTTP deployment, point the client at /mcp and send Authorization: Bearer <WEASLEY_DEEPMIND_ACCESS_KEY>.
Run the repository locally
git clone https://github.com/potatohoney-p/weasley-deepmind.git
cd weasley-deepmind
npm ci
docker compose -f docker-compose.dev.yml up -d
cp .env.example.minimal .env
npm run migrate
npm start
The development Compose file exposes PostgreSQL at localhost:35432 and Redis at localhost:36379. Update .env to match those ports before starting the server.
Core flow
flowchart LR
Agent["AI agent"] --> MCP["stdio or Streamable HTTP"]
MCP --> Tools["remember · recall · reflect · context"]
Tools --> Rank["keyword + graph + vector ranking"]
Rank --> Postgres["PostgreSQL + pgvector"]
Rank -. optional cache .-> Redis["Redis"]
The main tool set includes remember, batch_remember, recall, forget, amend, link, reflect, context, memory_stats, memory_consolidate, graph_explore, fragment_history, reconstruct_history, and search_traces. Tool availability can be limited by API-key permissions and operating mode.
Configuration
| Variable | Purpose | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection URL | derived from POSTGRES_* |
WEASLEY_DEEPMIND_ACCESS_KEY |
Required bearer secret for HTTP mode | none; HTTP fails closed |
WEASLEY_DEEPMIND_AUTH_DISABLED |
Explicit loopback-only authentication opt-out; startup rejects non-loopback listeners | false |
WEASLEY_DEEPMIND_AUTO_MIGRATE |
Run migrations before stdio startup | false (server.json suggests true) |
WEASLEY_DEEPMIND_HOME |
CLI cache and local state directory | ~/.weasley/deepmind |
WEASLEY_DEEPMIND_HOST |
HTTP listen address | 127.0.0.1 |
PORT |
HTTP port | 57332 |
REDIS_ENABLED |
Enable Redis-backed features | false |
EMBEDDING_PROVIDER |
openai, gemini, ollama, localai, cloudflare, transformers (optional install), or custom |
openai |
EMBEDDING_API_KEY |
Optional embedding provider secret | none |
See .env.example, configuration, and the installation guide for the complete matrix.
Local transformer embeddings are intentionally excluded from the default install so the core MCP server does not inherit an optional native-image dependency. Follow the pinned setup in docs/embedding-local.md before selecting EMBEDDING_PROVIDER=transformers.
CLI
weasley-deepmind serve Start the HTTP MCP server
weasley-deepmind stdio Start the local stdio MCP server
weasley-deepmind migrate Apply pending database migrations
weasley-deepmind health Check database, Redis, and embeddings
weasley-deepmind recall Search memory from the terminal
weasley-deepmind remember Store a memory fragment
weasley-deepmind update Preview or apply an update
Run weasley-deepmind --help or see the CLI reference for every command.
Security defaults
- Keep the HTTP listener on loopback unless you have a trusted reverse proxy and an explicit origin allowlist.
- Use a unique, high-entropy
WEASLEY_DEEPMIND_ACCESS_KEYand never commit.env. - Stdio mode trusts the local MCP host process; protect the host account and database credentials accordingly.
- Report vulnerabilities privately using the instructions in SECURITY.md.
Development
npm ci
npm test
npm run lint
npm run lint:migrations
npm pack --dry-run
Architecture and operations details live in docs/architecture.en.md and docs/operations. Contributions are welcome through CONTRIBUTING.md.
License
Copyright 2026 Weasley Open Source.
Licensed under the Apache License 2.0. See NOTICE for attribution information.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。