cd /news/ai-tools/i-built-an-mcp-server-that-gives-ai-… · home topics ai-tools article
[ARTICLE · art-25729] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

I built an MCP server that gives AI coding assistants persistent memory (85.6% token reduction)

A developer built sessionmem, a local-first MCP server that gives AI coding assistants persistent memory by injecting compact session summaries at the start of each new session. The tool reduces token usage by 85.6% compared to full conversation history, storing data in a local SQLite database with no cloud dependencies.

read2 min publishedJun 12, 2026

Every time you start a new Claude Code session, your AI has zero context about what you were working on. Same with Cursor, Cline, Windsurf. You spend the first few minutes re-explaining the codebase, the decisions you made, where you left off. It's annoying.

I got tired of it and built something to fix it.

sessionmem is a local-first MCP server that watches your coding sessions and auto-injects a compact summary at the start of each new one. Your AI instantly knows what you were working on, what decisions were made, and what's next.

The compression is aggressive. Instead of feeding the full conversation history into context (expensive, often impossible due to token limits), sessionmem distills sessions down to just the key facts. In testing we're seeing 85.6% token reduction compared to keeping full history.

Everything is stored in SQLite at ~/.sessionmem/memories.db

. No cloud, no account, no API keys, no config files to mess with.

Install in 30 seconds:

npx sessionmem

Then add to your MCP config:

{
  "mcpServers": {
    "sessionmem": {
      "command": "npx",
      "args": ["-y", "sessionmem"]
    }
  }
}

That's it. sessionmem starts watching your sessions immediately and builds up memory over time.

Your code is sensitive. Your thought process, architecture decisions, and in-progress work shouldn't be sent to a third-party service.

SQLite is fast and zero-dependency. Works offline, no daemon to manage, no Docker.

You own your data. The database file is right there at ~/.sessionmem/memories.db

  • readable, deletable, no lock-in.

After each session, sessionmem generates a compact summary capturing: what you were building, key decisions made, files touched, and what's left to do. Next time you start a session, this gets injected automatically before you type anything.

The summaries get better at capturing what matters in your specific workflow over time.

Would love feedback if you try it out - especially on whether the right context is being captured in the summaries.

── more in #ai-tools 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-an-mcp-serve…] indexed:0 read:2min 2026-06-12 ·