I Gave Claude Code a Memory — Here's How MCP Connects AI Tools to Your Knowledge Base

Dev.to / 3/25/2026

💬 OpinionDeveloper Stack & InfrastructureTools & Practical Usage

Key Points

  • The article explains why most AI coding tools (e.g., Claude Code, ChatGPT, Cursor) don’t retain prior work automatically and how that affects developers’ ability to reuse past decisions.
  • It introduces the Model Context Protocol (MCP) as an open standard that lets AI tools call external functions to retrieve and use information from a personal knowledge base instead of copying context into prompts.
  • Nokos is presented as an MCP-based connector that exposes three tools—search_nokos for keyword/semantic search, get_nokos for retrieving full items, and save_session for saving conversations.
  • A practical example shows Claude Code using search_nokos to find relevant prior sessions/memos about authentication implementation, enabling faster, context-aware responses.
  • The key takeaway is that MCP-compatible tools can both read from and write to personal memory systems, creating a tighter feedback loop between development history and AI assistance.

Claude Code doesn't remember what you built last week.

Neither does ChatGPT. Neither does Cursor. Every AI tool starts fresh — no memory of your architecture decisions, debugging sessions, or that clever workaround you spent two hours on.

In my previous article, I showed how Nokos auto-captures coding sessions. But capturing is only half the story. The other half: letting AI tools search that knowledge.

That's where MCP comes in.

What is MCP?

Model Context Protocol is an open standard that lets AI tools call external functions. Think of it as "APIs for AI" — instead of you copying context into a prompt, the AI calls a tool to fetch what it needs.

Nokos exposes three MCP tools:

Tool What it does
search_nokos Search memos + coding sessions by keyword or meaning
get_nokos Fetch full content of any item
save_session Save the current AI conversation to Nokos

With these three tools, any MCP-compatible AI can read from and write to your personal knowledge base.

The "Aha" Moment

Here's what it looks like in practice:

You (in Claude Code): "How did I implement auth in this project?"

Claude Code calls: search_nokos({ query: "auth implementation" })

Nokos returns: 3 relevant items
  - Session from Feb 15: "Implemented Firebase Auth with Device Authorization Flow"
  - Memo from Feb 10: "Auth architecture: stateless JWT + RLS"
  - Session from Feb 8: "Added unified auth middleware for API key, JWT, and Firebase"

Claude Code: "Based on your previous sessions, you implemented a three-layer
auth approach: Firebase for web, Device Auth JWT for CLI, and API keys
for programmatic access. The unified middleware is in unified-auth.ts..."

Claude Code answered with your actual implementation history — not generic advice, not hallucinated code, but what you actually built. The AI searched your knowledge base, found relevant sessions, and synthesized an answer.

Two MCP Servers, One Protocol

We run two MCP servers that expose the same three tools:

Local Agent (stdio)

For AI tools running on your machine — Claude Code, Codex, any MCP client:

Claude Code ←→ stdio ←→ @nokos/cli mcp ←→ Nokos API

The CLI starts an MCP server over stdio. Authentication uses Device Auth JWT tokens stored in ~/.nokos/credentials.json. Setup is one command:

nokos setup  # registers MCP server + hooks

Remote Server (Streamable HTTP)

For cloud-based AI tools — claude.ai, ChatGPT (when MCP-enabled):

claude.ai ←→ HTTPS ←→ mcp.nokos.ai ←→ PostgreSQL

This runs on Cloud Run with OAuth 2.1 + PKCE for authentication. The remote server connects directly to the database — no extra API hop.

Why two servers? Latency and access patterns are different. The local agent proxies through the API (simple, works everywhere). The remote server has direct DB access (faster for cloud-based tools that need quick responses).

How Search Works Behind the Scenes

When an AI calls search_nokos, it hits a hybrid search pipeline:

  1. Full-text search (pg_bigm) — exact keyword matching, great for Japanese + English
  2. Vector search (pgvector) — semantic matching via embeddings, finds related content even without keyword overlap

The results are merged and deduplicated. This means "auth implementation" matches sessions that talk about "Firebase authentication middleware" even without the exact word "auth."

Both memos and coding sessions live in the same index. Your handwritten notes and AI-generated session logs are searchable together.

The Knowledge Loop

The real power isn't any single tool — it's the loop:

1. You work with Claude Code → session auto-captured to Nokos
2. You write a memo in Nokos → indexed and embedded
3. Next Claude Code session → AI searches Nokos for context
4. AI gives better answers → captured again

Each cycle adds to the knowledge base. Over time, your AI gets more useful because it has more of your context.

This isn't AGI memory. It's a practical, queryable database of your actual work — sessions, notes, decisions — that any AI tool can tap into through a standard protocol.

What MCP Gets Right (And What's Still Hard)

What works well:

  • Standard protocol means one integration works across multiple AI tools
  • Tool descriptions guide the AI on when to call what
  • Structured responses let the AI reason about results

What's still hard:

  • AI tools don't always know when to search. Sometimes Claude Code will try to answer from training data when your actual implementation is one MCP call away
  • Context window limits mean you can't dump everything — the AI needs to be selective about what it retrieves
  • OAuth setup for remote MCP is still friction. The local stdio path is much smoother

Try It

If you use Claude Code:

npm install -g @nokos/cli
nokos login
nokos setup

After setup, try asking Claude Code: "Search my Nokos for recent sessions about [topic]." It will call search_nokos and return your actual work history.

For claude.ai, connect via the MCP settings panel at mcp.nokos.ai.

nokos.ai — free plan available.

This is article 5 in my series about building a SaaS with AI. Article 1: Zero Lines of Code. Article 2: AI Cost Split. Article 3: PostgreSQL RLS. Article 4: Session Capture.

Launching on Product Hunt March 31st — follow for updates!