Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

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.md

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.mmd files and inline `mermaid blocks 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. Uncomment ADMIN_PASSWORD to protect the instance. If login fails and the logs show SQLITE_READONLY (data directory created by an older version), run sudo chown -R 1000:1000 ./data once 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 |

Development

Prerequisites: Node.js 20+ (project pins Node 26 in Docker)

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)
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 (docker-publish.yml) gates on format:checktsc --noEmittestbuild, in that order — run the same chain locally before pushing.

See CONTRIBUTING.md for code-style rules and the PR workflow.

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.