Clark MCP Server
Provides a memory layer for personal agents, enabling MCP-compatible agents to store and query profile, factual, episodic, and procedural memory.
README
Clark
Clark is a memory layer for personal agents. It stores profile, factual, episodic, and procedural memory behind one query surface, so tools such as Hermes, Codex, Claude Code, Gemini CLI, Cursor, and MCP-compatible agents can retrieve useful context without stitching several memory systems together.
The repository is being hardened for open-source production use. The current production path is:
- Postgres 16 with
pgvectorfor server deployments. - SQLite plus
sqlite-vecfor local development and single-user experiments. - DeepSeek for LLM extraction by default.
- Gemini embeddings by default.
- FastAPI HTTP API with bearer-token auth.
- MCP server for agent-native integration.
uvfor local development and CI-style commands.
Status
Clark is ready for public open-source development and production-path evaluation. The local CLI, HTTP API, MCP transports, Docker path, Postgres/pgvector backend, and provider contracts are covered by real tests.
Benchmark claims are intentionally conservative: publish comparative numbers only when they come from the checked-in benchmark runners, real provider credentials, and recorded artifacts.
Install
git clone https://github.com/Nomads-AI-Lab/clark.git
cd clark
uv sync --extra test --extra server --extra mcp --extra postgres
For local editable development:
uv pip install -e ".[test,server,mcp,postgres]"
Configuration
Create .env from .env.example and set real credentials:
cp .env.example .env
Required for production server mode:
CLARK_ENV=production
CLARK_AUTH_TOKEN=replace-with-a-long-random-token
CLARK_DATABASE_URL=postgresql://clark:strong-password@postgres:5432/clark
GEMINI_API_KEY=...
DEEPSEEK_API_KEY=...
Important behavior:
- Clark does not silently replace missing providers with fake embeddings or fake LLM output.
- If a required provider key is absent for the code path you run, the operation fails explicitly.
- Server production mode requires
CLARK_AUTH_TOKEN.
CLI
uv run clark doctor
uv run clark migrate
uv run clark stats
uv run clark remember "Alice prefers concise technical answers"
uv run clark query "How should I answer Alice?"
uv run clark session-start
clark migrate applies the Postgres/pgvector schema when CLARK_DATABASE_URL is set. Without CLARK_DATABASE_URL, the legacy SQLite schema initializes on first use.
Docker
cp .env.example .env
# edit .env and set strong real values
docker compose up --build
Then migrate the database:
docker compose exec clark-api clark migrate
Health and API smoke:
curl http://127.0.0.1:8000/healthz
curl -H "Authorization: Bearer $CLARK_AUTH_TOKEN" http://127.0.0.1:8000/v1/stats
HTTP API
uv run clark serve 8000
Endpoints:
GET /healthzGET /readyzGET /v1/statsPOST /v1/memoriesPOST /v1/query
Authenticated request:
curl -X POST http://127.0.0.1:8000/v1/memories \
-H "Authorization: Bearer $CLARK_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text":"Alice is building a production memory layer","source":"api"}'
MCP
Run a stdio MCP server:
uv run clark mcp
Run streamable HTTP transport:
uv run clark mcp streamable-http
Available tools:
clark_healthclark_statsclark_queryclark_remember
Resource:
clark://stats
When CLARK_DATABASE_URL is set, MCP uses the Postgres backend. Otherwise it uses the local SQLite backend.
Python API
from clark import HybridMemory
memory = HybridMemory()
memory.remember("Alice works on agent memory infrastructure")
result = memory.query("What does Alice work on?")
print(result["results"])
For production server deployments, prefer the HTTP API or MCP server over importing the legacy SQLite class directly.
Tests
Run the local suite:
uv run pytest
Run real provider contract tests:
GEMINI_API_KEY=... DEEPSEEK_API_KEY=... uv run pytest tests/test_provider_contracts.py
Run real Postgres/pgvector integration tests:
docker run --rm -d --name clark-pgvector-test \
-p 15434:5432 \
-e POSTGRES_DB=clark \
-e POSTGRES_USER=clark \
-e POSTGRES_PASSWORD=clark-local-dev-password \
pgvector/pgvector:pg16
CLARK_DATABASE_URL=postgresql://clark:clark-local-dev-password@127.0.0.1:15434/clark \
GEMINI_API_KEY=... \
uv run pytest tests/test_postgres_backend.py
docker rm -f clark-pgvector-test
Open-Source Documents
- Production readiness roadmap
- Agent integrations
- Benchmark methodology
- Verification status
- Contributing guide
- Security policy
- Code of conduct
- MIT License
Security
Do not expose the HTTP API without CLARK_AUTH_TOKEN. Do not commit .env, database dumps, provider keys, or personal memory exports. Treat memory contents as sensitive user data.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。