DEV Community

Srinivas Kondepudi
Srinivas Kondepudi

Posted on

I built an MCP server to log every AI conversation, here's what I learned

Every serious system gets audited; databases, code, finances. AI shouldn't be the exception. I'm building the tools to close that gap. chron is the first one.

The problem

I was doing long coding sessions with Claude. We'd work through a problem, make decisions, figure out an approach together. Then the context window fills up. It resets. And suddenly the AI has forgotten everything, but I still need to know what we decided and why.

I wanted a permanent local record. Not stored in some cloud. Not owned by any AI company. Just mine, on my machine, in a format I can actually read.

What is MCP?
MCP (Model Context Protocol) is an open standard from Anthropic that lets you extend Claude with custom tools. Think of it like a plugin system, you build a server that exposes tools, Claude learns to call them, and suddenly your AI can do things it couldn't before.

I'd never built one before. This was my first.

Turns out it's simpler than it sounds. You define a tool with three things:

A name Claude can call
A description Claude reads to know when to use it
An input schema so Claude knows what arguments to pass
That's it. Claude figures out the rest.

What I built
chron; an MCP server that automatically logs every AI conversation to a local SQLite database. Every message. Every timestamp. Fully yours.

npx -y chron-mcp
Run that once in your terminal. It detects which AI tools you have installed, Claude Desktop, Claude Code, Cursor, Windsurf, and configures them automatically. Restart your AI tool. Done. Everything gets logged from that point on, with zero manual steps.

Three things I built that were interesting

  1. Hash chaining

Each message stores a SHA-256 hash that includes the previous message's hash, same idea as a blockchain, but much simpler. It means you can verify the log hasn't been tampered with. If anyone edits an old message, every hash after it breaks.

message 1: hash(content) → abc123
message 2: hash(content + abc123) → def456
message 3: hash(content + def456) → ghi789
Run verify_session and chron walks the chain. Any break means tampering.

  1. Auto-setup

The hardest part of building an MCP server isn't the server, it's getting people to install it. Writing JSON config files by hand is a real barrier.

So npx -y chron-mcp now does it automatically. It reads your filesystem, detects which AI clients are installed, writes their config files, and installs a SessionStart hook in Claude Code so the logging skill loads on every new session. One command, restart, works.

  1. The SessionStart hook

Claude Code has a hook system; shell commands that run automatically at session start. I use this to inject the chron skill instructions so Claude knows to call the logging tools without you doing anything. This was the missing piece. Without it, the MCP server is registered but idle.

What surprised me
The install experience is harder than the feature itself. Getting the MCP server running took a day. Getting it to work without any user configuration took a week.

Also: npm download counts are mostly bots. chron crossed 1,000 downloads in the first week, but honest estimate is maybe 50–150 real humans. Security scanners and registry mirrors download every new package automatically. Worth knowing before you celebrate.

What's next
The data is locked in SQLite right now. The next step is a local web UI — npx chron-mcp --ui opens a browser showing your sessions, messages, and stats. If AI is doing real work, you should be able to read the log without writing SQL.

If you use Claude, Cursor, or Windsurf and you care about keeping a record of your AI conversations, give it a try.

npx -y chron-mcp
GitHub: github.com/sirinivask/chron

I'm happy to answer questions about building MCP servers, it's genuinely worth learning right now.

Top comments (0)