Skip to content
MCP server

ContextLib

Project memory kept as plain Markdown files with a tamper-evident append-only log

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, self-hosted, macOS
Runs
Locally
Version
0.1.0
Listing updated
1 day ago

About ContextLib

ContextLib is an open-source MCP server for files and documents. It runs locally on your machine and is started by your AI client.

Decisions, requirements, facts, lessons, glossary entries, sources and returned work are saved as Markdown files with a small front-matter block, one folder per project. The folders can live on an external drive, and a person can follow a project from the file browser alone. Any database is only a rebuildable search index, never the source of truth.

Agents use the same files through a stdio server whose tools are prefixed with context_, or through the ctxlib command line tool. Records an agent proposes wait in an inbox until a person accepts or rejects them, so an owner's decision lands as current while an agent's lesson is held back. Records can carry evidence, review-by dates and approvers, and a newer record can supersede an older one while keeping the earlier body hash. A health check command reports problems in plain English, and the README mentions that a secret is refused when written.

It is the open core of the context plugin of AgentBrain, needs only the Python standard library (3.9 or newer), and optionally syncs through git.

Install

Run in a terminal

claude mcp add agentbrain-contextlib -- docker run -i --rm ghcr.io/willykeenan/agentbrain-contextlib:0.1.0

Add to claude_desktop_config.json

{
  "mcpServers": {
    "agentbrain-contextlib": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/willykeenan/agentbrain-contextlib:0.1.0"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "agentbrain-contextlib": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/willykeenan/agentbrain-contextlib:0.1.0"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "agentbrain-contextlib": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/willykeenan/agentbrain-contextlib:0.1.0"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "agentbrain-contextlib": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/willykeenan/agentbrain-contextlib:0.1.0"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "agentbrain-contextlib": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/willykeenan/agentbrain-contextlib:0.1.0"
      ]
    }
  }
}

What it does

Markdown storage
Keeps knowledge as readable files with front matter, one folder per project.
Proposal inbox
Holds agent-proposed records until a person accepts or rejects them.
Supersession chain
Replaces old records while preserving the body hash and reason.
Review dates
Flags records whose review-by date has passed.
Rebuildable index
Uses SQLite search that can be regenerated from the files.
Health check
Reports library problems in plain English.
Export and import
Zips a project and imports it elsewhere, with private records excluded by default.

Good for

  • Give coding agents durable project memory across sessions
  • Record decisions and requirements a team can read without special tools
  • Review and approve lessons an agent proposes
  • Carry project knowledge to another machine as files
  • Find when a recorded fact is due for review

Pricing

Open source

Prices change. Check huggingface.co before you buy.

ContextLib FAQ

Where is the data kept?

In plain Markdown files in a folder you choose, such as an external drive.

What if the search database is lost?

It can be rebuilt from the files, which are the source of truth.

Can an agent change decisions on its own?

Agent-proposed records go to an inbox and become current only when accepted.

What does it need to run?

Python 3.9 or newer and no third-party packages; Git is optional.

Is ContextLib free?

Yes. ContextLib is open source, so you can use and self-host it for free.

How do I add ContextLib to Claude Code?

Run this command in your terminal: claude mcp add agentbrain-contextlib -- docker run -i --rm ghcr.io/willykeenan/agentbrain-contextlib:0.1.0

What are the best alternatives to ContextLib?

The closest alternatives to ContextLib are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to ContextLib

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools