121 MCP Tools · Fully Automatic

cachly AI Brain — MCP Server

Persistent memory for Claude Code, Cursor, Windsurf, GitHub Copilot, Cline & Zed. Sessions start automatically. Lessons accumulate silently. Your AI arrives pre-briefed — every morning, every session, every machine.

Every morning, your AI forgets everything.

Without cachly

“What's your architecture?”

Re-explains the deployment process

Debugs the same bug from scratch

Asks what you worked on yesterday

~45 min/day lost to context re-establishment

With cachly Brain

“Ready. 23 lessons, last session: deployed API.”

Knows your deployment process cold

“You fixed this March 12, exact command:”

Picks up exactly where you left off

~0 min — Brain arrives pre-briefed every time

One command. Everything configured.

Run once. Signs you in, detects all your editors, writes every MCP config, creates a CLAUDE.md Brain file, and installs a git hook that learns from every commit automatically.

terminal
# One command — detects all editors, writes all configs, no credit card
npx @cachly-dev/mcp-server@latest autopilot

Or configure manually:

mcp config (any editor)
{
  "mcpServers": {
    "cachly": {
      "command": "npx",
      "args": ["-y", "@cachly-dev/mcp-server@latest"],
      "env": {
        "CACHLY_JWT": "your-api-key",
        "CACHLY_BRAIN_INSTANCE_ID": "your-instance-uuid"
      }
    }
  }
}

Fully automatic — nothing to call manually

The Brain manages its own lifecycle. Sessions start when your editor connects, end when it closes, and the codebase is indexed daily in the background. You never call session_start or session_end manually.

what happens automatically
# What happens automatically — zero configuration needed:

1. Editor opens  →  session_start fires (reads previous session context)
2. First tool call →  AI gets last session summary + handoff tasks injected
3. Git branch/commit → auto-detected as session focus
4. Codebase indexed  → once per 24h in background (smart hash, skips unchanged)
5. Editor closes    →  session_end fires (git-context summary saved)

# You never type session_start or session_end.
# The Brain arrives briefed. Every time.

On connection

session_start fires, previous context loaded, project indexed in background

First tool call

Session summary + handoff tasks injected automatically into the response

On exit

session_end fires with git-derived summary — zero manual work

The one thing your AI does for you

After every fix, deploy, or discovery — your AI calls learn_from_attempts automatically. Stores the exact command, what failed, what worked. You never debug the same thing twice.

learn + recall example
# After fixing a bug — call this once, never debug it again:
learn_from_attempts(
  instance_id = "9d4077aa-bfa2-468b-89cd-0a8d8f3ec483",
  topic       = "fix:stripe-webhook-body",
  outcome     = "success",
  what_worked = "Use express.raw() before express.json() for /webhooks route",
  what_failed = "express.json() strips raw body — stripe.webhooks.constructEvent() throws",
  severity    = "critical",
  commands    = ["app.use('/webhooks', express.raw({type: '*/*'}))"],
  tags        = ["stripe", "webhook", "express"],
)

# 30 days later, on a new machine, in a new session:
smart_recall("stripe webhook signature")
# → "You fixed this May 9. Use express.raw() — see lesson fix:stripe-webhook-body"

63 Brain tools — key ones

The full tool list covers sessions, lessons, semantic recall, causal graphs, team sync, code indexing, cache management, embeddings and more. Most run automatically.

Auto
session_start / session_end

Fires automatically on connection and exit. Returns previous session summary, handoff tasks, open bugs and top lessons — so your AI arrives pre-briefed.

Core
learn_from_attempts

Store a bug fix, deployment trick, or discovery permanently. Include what worked, what failed, the exact command, severity and file paths.

Core
smart_recall

Semantic + BM25+ hybrid search over all lessons, sessions, and indexed code. Returns ranked results by meaning — not just keyword match.

Core
recall_best_solution

Proactively surface the best past solution before tackling a problem. Returns confidence score, commands and file paths.

Handoff
session_handoff

Save open tasks, completed tasks and critical context before closing a window. The next AI session picks up exactly where you left off.

Auto
index_project

Indexes the current codebase semantically. Runs once daily in the background on session start. Smart MD5 hash: only re-indexes changed files.

Search
brain_search

BM25+ full-text search over all brain data: lessons, session context, indexed files, and the Causal Knowledge Graph.

Predict
brain_predict

Predict likely failure patterns before a deploy or code change. Returns risk score + relevant past incidents with fix commands.

Portability
brain_portability

Model-neutrality proof — shows your Brain ID and ready-to-paste config blocks for all 7 supported clients (Claude Code, Cursor, Windsurf, Copilot, Cline, Zed, Continue). Same Brain, any model.

Graph
ckg_inspect

Inspect the Causal Knowledge Graph: typed edges (CAUSED_BY, FIXED_BY, DEPENDS_ON) with Bayesian confidence scores.

Context
remember_context / recall_context

Store and retrieve arbitrary key-value context (analysis results, config notes, file contents). Supports glob patterns.

Supported editors

The setup wizard detects and configures all of these automatically.

EditorConfig pathStatus
Claude Code~/.claude/claude_desktop_config.jsonNative
Cursor.cursor/mcp.jsonSupported
Windsurf~/.codeium/windsurf/mcp_config.jsonSupported
GitHub Copilot (VS Code).vscode/settings.jsonSupported
Continue.dev~/.continue/config.jsonSupported
Zed~/.config/zed/settings.jsonSupported
Cline.vscode/settings.jsonSupported

For autonomous agents

Works with LangChain, AutoGen, CrewAI, LlamaIndex and any custom agent via REST API. Give your agent a brain that accumulates knowledge across runs.

Python agent with persistent Brain
import httpx

BRAIN_INSTANCE = "your-instance-id"
CACHLY_KEY = "your-api-key"

async def agent_learn(topic: str, what_worked: str, what_failed: str = ""):
    """Store a lesson after every task."""
    await httpx.AsyncClient().post(
        f"https://api.cachly.dev/api/v1/instances/{BRAIN_INSTANCE}/learn",
        headers={"Authorization": f"Bearer {CACHLY_KEY}"},
        json={"topic": topic, "outcome": "success",
              "what_worked": what_worked, "what_failed": what_failed}
    )

async def agent_recall(query: str) -> str:
    """Recall relevant past lessons before a task."""
    r = await httpx.AsyncClient().post(
        f"https://api.cachly.dev/api/v1/instances/{BRAIN_INSTANCE}/brain-search",
        headers={"Authorization": f"Bearer {CACHLY_KEY}"},
        json={"query": query, "top_k": 3}
    )
    return r.json()

Full Python, Go, Rust, Java, Kotlin, .NET, Swift, PHP SDKs → Agents docs

Ready to give your AI a memory that never forgets?

Free Brain instance — one command, under 60 seconds, no credit card.