Mind Keg MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "MINDKEG_API_KEY=${MINDKEG_API_KEY}" mindkeg-mcp -- npx mindkeg-mcp init
Required:MINDKEG_API_KEY
README.md

A persistent memory MCP server for AI coding agents.

Mind Keg MCP

A persistent memory MCP server for AI coding agents. Stores atomic learnings — debugging insights, architectural decisions, codebase conventions — so every agent session starts with relevant institutional knowledge.

Problem

AI coding agents (Claude Code, Cursor, Windsurf) lose context between sessions. Hard-won insights are forgotten the moment a conversation ends. Developers repeatedly re-explain the same things; agents repeatedly make the same mistakes.

Mind Keg solves this with a centralized, persistent brain that any MCP-compatible agent can query and contribute to.

How It Works

Mind Keg implements a RAG (Retrieval-Augmented Generation) pattern for AI coding agents:

  1. Retrieval — Agent searches the brain for relevant learnings using semantic or keyword search
  2. Augmentation — Retrieved learnings are injected into the agent's conversation context
  3. Generation — The agent responds with awareness of past discoveries and decisions

Unlike traditional RAG systems that chunk large documents, Mind Keg stores pre-curated atomic learnings (max 500 chars each). No chunking strategy needed — each learning IS the retrieval unit. The agent controls both retrieval and storage, creating a feedback loop where knowledge improves over time.

Features

  • Store and retrieve atomic learnings (max 500 chars, one insight per entry)
  • Semantic search with three provider options:
    • FastEmbed (free, local, ONNX-based — BAAI/bge-small-en-v1.5, 384 dims)
    • OpenAI (paid, best quality — text-embedding-3-small, 1536 dims)
    • None (FTS5 keyword fallback — zero external dependencies)
  • Six categories: architecture, conventions, debugging, gotchas, dependencies, decisions
  • Free-form tags and group linking
  • Three scoping levels: repository-specific, workspace-wide, and global learnings
  • Dual transport: stdio (local) + HTTP+SSE (remote)
  • API key authentication with per-repository access control
  • SQLite storage (zero dependencies, zero config)
  • Import/export for backup and migration
  • Enterprise security: encryption at rest, audit logging, TTL/data retention, Prometheus monitoring, rate limiting, content integrity verification

Quick Start

One-command setup

npx mindkeg-mcp init

This auto-detects your agent (Claude Code, Cursor, Windsurf), writes the MCP config, copies agent instructions, and runs a health check. That's it — open your agent and start coding.

Options:

npx mindkeg-mcp init --agent cursor      # Target a specific agent
npx mindkeg-mcp init --no-instructions   # Skip copying AGENTS.md
npx mindkeg-mcp init --no-health-check   # Skip the health check

init is idempotent — safe to run multiple times. It merges with existing configs and never overwrites.

Manual setup

If you prefer to configure manually, or need HTTP mode:

Click to expand manual setup instructions
Install
npm install -g mindkeg-mcp
Create an API key
mindkeg api-key create --name "My Laptop"
# Displays the key ONCE — save it securely
# mk_abc123...
Connect your AI agent

Mind Keg works with any MCP-compatible AI coding agent. Choose your setup:

Claude Code — Add to ~/.claude.json or your project's .claude/mcp.json:

{
  "mcpServers": {
    "mindkeg": {
      "command": "mindkeg",
      "args": ["serve", "--stdio"],
      "env": {
        "MINDKEG_API_KEY": "mk_your_key_here"
      }
    }
  }
}

Cursor — Add to .cursor/mcp.json or global settings:

{
  "mcpServers": {
    "mindkeg": {
      "command": "mindkeg",
      "args": ["serve", "--stdio"],
      "env": {
        "MINDKEG_API_KEY": "mk_your_key_here"
      }
    }
  }
}

Windsurf — Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "mindkeg": {
      "command": "mindkeg",
      "args": ["serve", "--stdio"],
      "env": {
        "MINDKEG_API_KEY": "mk_your_key_here"
      }
    }
  }
}

HTTP mode (any MCP client):

MINDKEG_API_KEY=mk_your_key mindkeg serve --http
# Listening on http://127.0.0.1:52100/mcp
{
  "mcpServers": {
    "mindkeg": {
      "type": "http",
      "url": "http://127.0.0.1:52100/mcp",
      "headers": {
        "Authorization": "Bearer mk_your_key_here"
      }
    }
  }
}

Other MCP-compatible agents — Mind Keg works with any agent that supports the Model Context Protocol — including Codex CLI, Gemini CLI, GitHub Copilot, and more. Use the stdio config above adapted to your agent's MCP settings format.

Add Mind Keg instructions to your repository

Copy templates/AGENTS.md to the root of any repository where you want agents to use Mind Keg.

AGENTS.md is the industry standard supported by 20+ AI tools (Cursor, Windsurf, Codex, Gemini CLI, GitHub Copilot, etc.).

Claude Code only: Claude Code doesn't auto-load `AGEN

Tools (2)

searchSearch the brain for relevant learnings using semantic or keyword search.
storeStore an atomic learning insight.

Environment Variables

MINDKEG_API_KEYrequiredAPI key for authentication

Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "mindkeg": {
      "command": "mindkeg",
      "args": ["serve", "--stdio"],
      "env": {
        "MINDKEG_API_KEY": "mk_your_key_here"
      }
    }
  }
}

Try it

Search my memory for architectural decisions regarding the database schema.
Store this debugging insight: The API timeout is caused by unclosed database connections in the auth middleware.
Find all conventions related to our React component structure.
What are the known gotchas for the current project dependencies?

Frequently Asked Questions

What are the key features of Mind Keg MCP?

Store and retrieve atomic learnings (max 500 chars per entry). Semantic search with FastEmbed, OpenAI, or FTS5 keyword fallback. Three scoping levels: repository-specific, workspace-wide, and global. SQLite storage with zero dependencies. Enterprise security features including encryption at rest and audit logging.

What can I use Mind Keg MCP for?

Maintaining architectural decisions across long-term coding projects. Sharing debugging patterns and common fixes among team members. Storing project-specific coding conventions to ensure agent consistency. Tracking recurring 'gotchas' in third-party dependencies.

How do I install Mind Keg MCP?

Install Mind Keg MCP by running: npx mindkeg-mcp init

What MCP clients work with Mind Keg MCP?

Mind Keg MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Mind Keg MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare