ClawStash
Mirror all stashes into a GitHub repository with scheduled, on-change, or manual backups, supporting GitHub sign-in or PAT authentication.
Supports Markdown content with file attachments and inline Mermaid diagram rendering.
Render Mermaid diagrams from .mmd files or inline ```mermaid blocks in Markdown, with lazy-loading for performance.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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, and binary attachments (images, PDFs, archives as base64) shown as plain files instead of rendered
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; the last 200 snapshots per stash are kept (
STASH_VERSION_LIMIT,0= keep everything — what gets deleted, and when)Duplicate a stash — open any stash as a pre-filled new one and use it as a template
Import files from disk — drop text files onto the editor (or pick them) to add them as file rows, instead of copy-pasting each one
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)One-click code copy — every fenced code block in rendered Markdown gets a copy button (keyboard reachable, always visible on touch)
HTML preview copy buttons — opt-in controls copy plain text from the report without enabling scripts
Maximize a file — blow any one file of a stash (HTML preview, Mermaid diagram, Markdown, code) up to fill the screen; the Restore button or a backdrop click restores it, Esc too once focus is outside the HTML preview
Web GUI included — dark-themed dashboard to browse, search, and manage stashes manually, with a resizable sidebar that remembers its width
Update notice — the footer says when a newer commit is on
mainand links to the commits since your build
Related MCP server: codemem
HTML preview copy buttons
Save the report as an HTML text file and open its rendered preview. To offer direct copy with a manual fallback, use ordinary HTML:
<button type="button" data-clawstash-copy="pré:note.1" disabled>
<span data-clawstash-copy-label>Copy example</span>
</button>
<span role="status" data-clawstash-copy-status="pré:note.1"></span>
<p data-clawstash-copy-fallback="pré:note.1">Open “Read text” to copy it manually.</p>
<details>
<summary>Read text</summary>
<pre id="pré:note.1">Example text to copy.</pre>
</details>Button and target. A genuine pointer or keyboard activation of an HTML
<button type="button">opts in only if it hasdata-clawstash-copy="ID".IDis a nonempty, case-sensitive HTML ID without ASCII whitespace. It is matched literally (including Unicode and punctuation) to exactly one element in this preview document, and that element must be an HTML<pre>with non-whitespace text. Do not add a selector or fragment prefix. Only the target'stextContent, including its spaces and line breaks, is copied; never its markup. The<details>can stay closed.Availability. Start valid opted-in buttons with native
disabledso a reader without this support doesn't get a dead control. Enabling removesdisabled; it does not change the button's text,aria-labelor CSS. Author the active accessible name (for example, “Copy example”) from the start, and use:disabledfor inactive styling. Do not usearia-disabled="true"orinertfor progressive enablement. Invalid or unmarked buttons are left as authored; script-generated clicks do not copy.Feedback. Optional
data-clawstash-copy-status="ID"goes on a plain-text<span>,<small>or<p>outside the button and<pre>. Userole="status"to announce the outcome. If there is no matching status, a single plain-text<span data-clawstash-copy-label>inside the button briefly shows the result and then gets its original text back. With a separate status the button label stays unchanged.Manual hint. Optional
data-clawstash-copy-fallback="ID"goes on a plain-text<span>,<small>or<p>outside the button and<pre>. Use an empty value for a report-wide hint. The viewer hides it only while a matching enabled button is reachable (any such button for a report-wide hint), and shows it again on failure. A closed<details>exposes only its visible<summary>; opening or closing it updates the hint. The<pre>itself need not be visible. Leave the hint visible in the source and don't override[hidden]in report CSS.
ClawStash writes in the parent app: it tries the Async Clipboard API (normally HTTPS) and falls back to legacy text copying on plain HTTP or a refusal during the same recent gesture. The legacy path refuses literal carriage returns (\r, including CRLF) rather than silently normalizing them. On failure, optional inline feedback points to manual copy. Writes from this app page and its previews do not overlap. If the browser is still processing an earlier click, the latest click can copy as it settles, while focus and user activation remain. Otherwise the new click fails: try again after the first operation finishes. The app never replays a failed click or cancels a write already handed to the browser. Copying never opens the details, displays a dialog, navigates or reads the clipboard. Report scripts remain disabled; the preview sandbox and Content Security Policy are unchanged.
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.mdReplace 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 -dOpen 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, hand your AI agent the onboarding prompt from Settings → API & Tokens → MCP API ("Copy onboarding prompt for your agent" — the token banner offers the same prompt with a freshly created token filled in). Or point the agent at the server's own guides:
GET http://<HOST_OR_IP>:<PORT>/api/agent-skill # SKILL.md — when to store, workflow, conventions, limits, errors, maintenance
GET http://<HOST_OR_IP>:<PORT>/api/mcp-onboarding # the skill plus the complete MCP specification (every tool's JSON Schema)
GET http://<HOST_OR_IP>:<PORT>/llms.txt # discovery index when the agent only knows the hostConnected via MCP, the agent gets the same guidance without fetching anything: the server hands out usage instructions on initialize, exposes the two guides as resources (clawstash://guide/skill, clawstash://guide/onboarding), and get_server_info returns the token's scopes, the callable tools, the size limits and every endpoint in one call.
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).
Breaking change — MCP tokens need
read/write. Themcpscope is a transport gate: it lets a token connect to/mcp, and nothing more. Each MCP tool is authorized separately, with the same scope its REST equivalent requires —readto read stashes,writeforcreate_stash,update_stash,archive_stashanddelete_stash. Until now the MCP endpoint checked onlymcp, so a token carrying just that scope could write through MCP while every REST write route rejected it.Who is affected: anyone whose agent uses a token with
mcpbut withoutwrite(or withoutread). Its calls now come back as MCP tool errors naming the missing scope. Fix: issue a new token withread,writeandmcpand swap it into the agent's MCP config. Expect to need this: the scope combination was recommended here and in docs/openclaw-onboarding-prompt.md, but the self-onboarding endpointGET /api/mcp-onboardingand docs/mcp.md named onlymcpuntil this release — a token created by following those two must be reissued. Unaffected: tokens that already carryread/write/mcp(oradmin), and the local stdio transport, which carries no token at all.
MCP Tools
Tool | What it does |
| Store new content with files, tags, metadata |
| Get stash metadata + file list (content on demand) |
| Read a single file — most token-efficient |
| Browse all stashes with summaries |
| Full-text search with ranked results |
| Update existing stash content |
| Remove a stash |
| Archive/unarchive a stash without deleting |
| List all tags with usage counts |
| Explore tag relationships |
| Storage statistics |
| Fetch the OpenAPI 3.0 schema (JSON) |
| Fetch the full MCP specification (markdown) |
| Get latest tool specs (for connected agents) |
| Check for updates (with upgrade instructions) |
| Orient: scopes, callable tools, limits, endpoints |
Documentation
Doc | Content |
Copy-paste prompt for full agent-driven setup | |
REST endpoints, examples, query parameters | |
MCP tools, token-efficient patterns, transport options | |
Admin login, API tokens, scopes | |
Mirror stashes into a GitHub repo: setup, security | |
Docker, CI/CD, GHCR, production setup |
Development
Prerequisites: Node.js 22.23.4+, 24.22.1+ or 26.12.1+. package.json declares engines: { "node": "^22.23.4 || ^24.22.1 || >=26.12.1" } — the first patch of each supported line with the fix for CVE-2026-111497 ("Node2Shell", Brotli decoder out-of-bounds write); Node 20 and the odd majors 23/25 are EOL without a fix. Any other version draws an EBADENGINE warning from npm install. Docker and CI run Node 26.
git clone https://github.com/fo0/clawstash.git
cd clawstash
npm install
cp .env.example .env # adjust DATABASE_PATH / ADMIN_PASSWORD as needed
npm run dev # Next.js dev server at http://localhost:3000
npm run format # auto-format with Prettier (CI verifies formatting via format:check)
npm run lint # ESLint (correctness rules; formatting stays with Prettier)
npx tsc --noEmit # TypeScript type check (no npm script — CI runs this exact command)
npm test # vitest test suite (npm run test:watch for watch mode)
npm run build # production build
npm start # serve the production build
npm run mcp # MCP server (stdio transport, for local MCP client testing)CI runs that same chain (format:check → tsc --noEmit → lint → test → build, in that order)
from one reusable workflow, quality.yml: ci.yml calls it on every pull request and push to main,
and docker-publish.yml (manual workflow_dispatch) calls it before it builds the image. Alongside
it, docs-format.yml (Prettier on **.md) and GitHub's CodeQL analysis run on PRs. Run the local
chain before every push, so a red step locally is caught before it is a red check.
See CONTRIBUTING.md for code-style rules and the PR workflow.
Browser acceptance for HTML preview copy
On Linux, use a fresh checkout without .env files, Node.js 26, OpenSSL and a full Chromium binary such as Chrome for Testing (not chrome-headless-shell, which can refuse the Async Clipboard API). After npm ci and npm run build, point the test at Chromium and a scratch install of playwright-core (not a project dependency):
tools=$(mktemp -d)
npm install --prefix "$tools" --no-save --no-package-lock playwright-core@1.65.1
PLAYWRIGHT_MODULE="$tools/node_modules/playwright-core/index.mjs" \
CHROMIUM_PATH=/path/to/chromium node scripts/verify-html-preview-copy.mjsThe script starts its own loopback-only app with a disposable database, a generic report and a per-run HTTPS test certificate. It checks actual keyboard paste after real activations on both insecure HTTP and secure HTTPS, without granting clipboard-read permissions. It closes the browser and servers and removes the disposable database and certificate on exit.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Persistent file storage for AI agents via MCP and curl. Upload, download, and version files.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with persistent knowledge storage, enabling them to store, search, and retrieve text, documents, and files using semantic and keyword search via MCP tools.35Apache 2.0
- AlicenseNot gradedqualityBmaintenanceProvides persistent, searchable memory across coding projects and machines, letting agents record and retrieve projects, reusable assets, sessions, decisions, commits, and handoffs via MCP.3Apache 2.0
- AlicenseNot gradedqualityBmaintenanceProvides persistent memory for AI agents via MCP, enabling agents to store and access notes, files, and session context across sessions and clients while under user control.4MIT

sayouofficial
AlicenseNot gradedqualityDmaintenanceProvides AI agents with a persistent, file-based workspace for storing, versioning, and retrieving contextual knowledge across sessions via MCP tools.29Apache 2.0