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.
README
@doclea/mcp
Local MCP server for Doclea - persistent memory for AI coding assistants.
Installation
Prerequisites
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
- Verify the path in config is absolute
- Check that
bun run buildcompleted successfully - 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。