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.
# One command — detects all editors, writes all configs, no credit card npx @cachly-dev/mcp-server@latest autopilot
Or configure manually:
{
"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 — 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.
# 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.
session_start / session_endFires automatically on connection and exit. Returns previous session summary, handoff tasks, open bugs and top lessons — so your AI arrives pre-briefed.
learn_from_attemptsStore a bug fix, deployment trick, or discovery permanently. Include what worked, what failed, the exact command, severity and file paths.
smart_recallSemantic + BM25+ hybrid search over all lessons, sessions, and indexed code. Returns ranked results by meaning — not just keyword match.
recall_best_solutionProactively surface the best past solution before tackling a problem. Returns confidence score, commands and file paths.
session_handoffSave open tasks, completed tasks and critical context before closing a window. The next AI session picks up exactly where you left off.
index_projectIndexes the current codebase semantically. Runs once daily in the background on session start. Smart MD5 hash: only re-indexes changed files.
brain_searchBM25+ full-text search over all brain data: lessons, session context, indexed files, and the Causal Knowledge Graph.
brain_predictPredict likely failure patterns before a deploy or code change. Returns risk score + relevant past incidents with fix commands.
brain_portabilityModel-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.
ckg_inspectInspect the Causal Knowledge Graph: typed edges (CAUSED_BY, FIXED_BY, DEPENDS_ON) with Bayesian confidence scores.
remember_context / recall_contextStore 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.
| Editor | Config path | Status |
|---|---|---|
| Claude Code | ~/.claude/claude_desktop_config.json | Native |
| Cursor | .cursor/mcp.json | Supported |
| Windsurf | ~/.codeium/windsurf/mcp_config.json | Supported |
| GitHub Copilot (VS Code) | .vscode/settings.json | Supported |
| Continue.dev | ~/.continue/config.json | Supported |
| Zed | ~/.config/zed/settings.json | Supported |
| Cline | .vscode/settings.json | Supported |
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.
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.