ClawStash
Provides persistent storage for AI agents via MCP and REST API, enabling saving and retrieving text, code, configs, and files with full-text search, tags, version history, and GitHub backup.
README
ClawStash
Persistent storage for AI agents. Store text, code, configs, and files — retrieve them via MCP or REST API.
Built for agents like OpenClaw that need a reliable place to save and recall information across sessions.
Why ClawStash?
AI agents lose context between sessions. ClawStash gives them a persistent memory:
- Store anything — code snippets, configs, notes, multi-file projects
- Organize with tags & metadata — structured key-value metadata and tags for easy retrieval
- Full-text search — find stashes by content, name, description, or tags
- Token-efficient — MCP tools return summaries first, full content only on demand
- Version history — every change is tracked, diffable, and restorable
- GitHub backup — mirror all stashes into a GitHub repo (scheduled, on change, or manual) with "Sign in with GitHub" or a PAT — see docs/backup.md
- Mermaid diagrams —
.mmdfiles and inline```mermaidblocks in Markdown render as diagrams (lazy-loaded, no bundle bloat) - Web GUI included — dark-themed dashboard to browse, search, and manage stashes manually
Get Started
1. Let your agent do it (recommended)
Copy this into your OpenClaw agent — it installs ClawStash, creates test stashes, and sets up MCP automatically:
Install ClawStash (ghcr.io/fo0/clawstash) on my server and set it up as your default persistent storage via MCP. Server: <HOST_OR_IP>, User: <SSH_USER>, Auth: <PASSWORD_OR_KEY>. Use port <PORT> (docker compose port mapping "<PORT>:3000"). Set ADMIN_PASSWORD to a secure value. After install: create an API token (scopes: read, write, mcp), create 2 test stashes to verify, then fetch /api/mcp-onboarding to read the full MCP spec and configure yourself. Details: https://raw.githubusercontent.com/fo0/clawstash/main/docs/openclaw-onboarding-prompt.md
Replace the <...> placeholders with your server details — your agent handles the rest.
Step-by-step version: docs/openclaw-onboarding-prompt.md
2. Manual setup
Run this on your server — no clone needed:
mkdir clawstash && cd clawstash && cat > docker-compose.yml <<'EOF'
services:
clawstash:
image: ghcr.io/fo0/clawstash:latest
ports:
- "3000:3000"
volumes:
- ./data:/app/data
environment:
- NODE_ENV=production
- DATABASE_PATH=/app/data/clawstash.db
# - ADMIN_PASSWORD=your-secret-password
restart: unless-stopped
EOF
docker compose up -d
Open http://localhost:3000 — done. Database persists in ./data/.
Change port mapping (e.g.
"8080:3000") for a different port. UncommentADMIN_PASSWORDto protect the instance. If login fails and the logs showSQLITE_READONLY(data directory created by an older version), runsudo chown -R 1000:1000 ./dataonce and restart — details in Deployment → Bind mounts & file permissions.
After starting, point your AI agent at the onboarding endpoint to self-configure:
GET http://<HOST_OR_IP>:<PORT>/api/mcp-onboarding
This returns all available MCP tools, schemas, and recommended workflows — your agent reads it and starts using ClawStash immediately.
MCP Connection
Add to your MCP client config (OpenClaw, Claude Code, Cursor, etc.):
{
"mcpServers": {
"clawstash": {
"type": "streamable-http",
"url": "http://<HOST_OR_IP>:<PORT>/mcp",
"headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
}
}
Create API tokens in the web GUI under Settings > API & Tokens (scopes: read, write, mcp).
MCP Tools
| Tool | What it does |
|---|---|
create_stash |
Store new content with files, tags, metadata |
read_stash |
Get stash metadata + file list (content on demand) |
read_stash_file |
Read a single file — most token-efficient |
list_stashes |
Browse all stashes with summaries |
search_stashes |
Full-text search with ranked results |
update_stash |
Update existing stash content |
delete_stash |
Remove a stash |
archive_stash |
Archive/unarchive a stash without deleting |
list_tags |
List all tags with usage counts |
get_tag_graph |
Explore tag relationships |
get_stats |
Storage statistics |
get_rest_api_spec |
Fetch the OpenAPI 3.0 schema (JSON) |
get_mcp_spec |
Fetch the full MCP specification (markdown) |
refresh_tools |
Get latest tool specs (for connected agents) |
check_version |
Check for updates |
Documentation
| Doc | Content |
|---|---|
| OpenClaw Onboarding | Copy-paste prompt for full agent-driven setup |
| API Reference | REST endpoints, examples, query parameters |
| MCP Guide | MCP tools, token-efficient patterns, transport options |
| Authentication | Admin login, API tokens, scopes |
| GitHub Backup | Mirror stashes into a GitHub repo: setup, security |
| Deployment | Docker, CI/CD, GHCR, production setup |
License
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。