Doclea MCP

Doclea MCP

A local MCP server providing persistent memory for AI coding assistants by storing and searching architectural decisions, patterns, and solutions. It also includes tools for git automation and mapping codebase expertise based on project history.

Category
Visit Server

README

@doclea/mcp

Local MCP server for Doclea - persistent memory for AI coding assistants.

Installation

Prerequisites

  • Bun v1.0+ (curl -fsSL https://bun.sh/install | bash)
  • Docker & Docker Compose
  • Git

Step 1: Clone and Build

git clone https://github.com/your-org/doclea.git
cd doclea/packages/doclea-mcp

# Install dependencies
bun install

# Download embedding model (first time only, ~130MB)
./scripts/setup-models.sh

# Build
bun run build

Step 2: Start Services

# Start Qdrant + Embeddings
bun run docker:up

# Verify services
curl http://localhost:6333/readyz   # Should return "ok"
curl http://localhost:8080/health   # Should return "ok"

Step 3: Add to Claude Code

Option A: Claude Code CLI (~/.claude.json or project .claude.json):

{
  "mcpServers": {
    "doclea": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/doclea/packages/doclea-mcp/dist/index.js"]
    }
  }
}

Option B: Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "doclea": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/doclea/packages/doclea-mcp/dist/index.js"]
    }
  }
}

Option C: For development (uses source directly):

{
  "mcpServers": {
    "doclea": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/doclea/packages/doclea-mcp/src/index.ts"]
    }
  }
}

Step 4: Restart Claude Code

After updating config, restart Claude Code to load the MCP server.

Step 5: Initialize Your Project

In Claude Code, navigate to your project and ask:

Initialize doclea for this project

This scans your codebase, git history, and documentation to bootstrap memories.

Usage

Once installed, Claude Code automatically has access to these tools:

Store a Decision

Store this as a decision: We're using PostgreSQL because we need ACID
compliance for financial transactions. Tag it with "database" and "infrastructure".

Search for Context

Search memories for authentication patterns

Generate Commit Message

Generate a commit message for my staged changes

Generate PR Description

Create a PR description for this branch

Find Code Experts

Who should review changes to src/auth/?

Generate Changelog

Generate a changelog from v1.0.0 to HEAD for users

Configuration

Create .doclea/config.json in your project root (optional - uses defaults):

{
  "embedding": {
    "provider": "local",
    "endpoint": "http://localhost:8080"
  },
  "qdrant": {
    "url": "http://localhost:6333",
    "collectionName": "doclea_memories"
  },
  "storage": {
    "dbPath": ".doclea/local.db"
  }
}

Embedding Providers

Provider Config
local (default) { "provider": "local", "endpoint": "http://localhost:8080" }
openai { "provider": "openai", "apiKey": "sk-...", "model": "text-embedding-3-small" }
nomic { "provider": "nomic", "apiKey": "...", "model": "nomic-embed-text-v1.5" }
voyage { "provider": "voyage", "apiKey": "...", "model": "voyage-3" }
ollama { "provider": "ollama", "endpoint": "http://localhost:11434", "model": "nomic-embed-text" }

MCP Tools Reference

Memory Tools

Tool Description
doclea_store Store a memory (decision, solution, pattern, architecture, note)
doclea_search Semantic search across memories
doclea_get Get memory by ID
doclea_update Update existing memory
doclea_delete Delete memory

Git Tools

Tool Description
doclea_commit_message Generate conventional commit from staged changes
doclea_pr_description Generate PR description with context
doclea_changelog Generate changelog between refs (markdown/json, developers/users)

Expertise Tools

Tool Description
doclea_expertise Map codebase expertise, identify bus factor risks
doclea_suggest_reviewers Suggest PR reviewers based on file ownership

Bootstrap Tools

Tool Description
doclea_init Initialize project, scan git history, docs, and code
doclea_import Import from markdown files or ADRs

Memory Types

  • decision - Architectural decisions, technology choices
  • solution - Bug fixes, problem resolutions
  • pattern - Code patterns, conventions
  • architecture - System design notes
  • note - General documentation

Troubleshooting

Docker services not starting

# Check logs
docker compose -f docker-compose.test.yml logs

# Restart
bun run docker:down
bun run docker:up

First startup is slow

The embeddings service downloads the model (~130MB) on first run. After that, it's cached.

Port conflicts

Default ports: Qdrant (6333), Embeddings (8080). Edit docker-compose.test.yml to change.

MCP server not appearing in Claude

  1. Verify the path in config is absolute
  2. Check that bun run build completed successfully
  3. Restart Claude Code completely

Development

# Run in development mode (hot reload)
bun run dev

# Run all tests
bun test

# Run unit tests only
bun run test:unit

# Run integration tests (requires Docker services)
bun run test:integration

# Type check
bun run typecheck

# Build for production
bun run build

Architecture

┌─────────────────────────────────────────────────────────┐
│                     Claude Code                          │
│                         ↓ MCP                            │
├─────────────────────────────────────────────────────────┤
│                   Doclea MCP Server                      │
│  ┌─────────┐ ┌─────────┐ ┌──────────┐ ┌───────────┐    │
│  │ Memory  │ │   Git   │ │Expertise │ │ Bootstrap │    │
│  │  Tools  │ │  Tools  │ │  Tools   │ │   Tools   │    │
│  └────┬────┘ └────┬────┘ └────┬─────┘ └─────┬─────┘    │
│       └───────────┴───────────┴─────────────┘           │
│                         ↓                                │
│  ┌──────────────┐ ┌──────────────┐ ┌──────────────┐    │
│  │   SQLite     │ │    Qdrant    │ │  Embeddings  │    │
│  │  (metadata)  │ │  (vectors)   │ │ (local/API)  │    │
│  └──────────────┘ └──────────────┘ └──────────────┘    │
└─────────────────────────────────────────────────────────┘

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured