Claude Error Collector
An MCP server that enables Claude to learn from user corrections by recording them as persistent rules in CLAUDE.md files. It manages project-specific or global guidelines to ensure the assistant avoids repeating the same mistakes in future sessions.
README
Claude Error Collector
An MCP server for Claude Code that learns from your corrections. When you tell Claude "that was wrong" or "no, do it like this", it records the lesson as a rule in your CLAUDE.md - so the same mistake doesn't happen twice.
How It Works
- You correct Claude during a coding session
- Claude recognizes the correction and calls the
record_errortool - The server derives a rule and writes it to the appropriate
CLAUDE.md - Claude reads that rule in future sessions and avoids repeating the mistake
The server automatically detects whether you're in a project directory (writes to project CLAUDE.md) or your home directory (writes to ~/.claude/CLAUDE.md).
Tools
record_error
Records a correction and saves it as a learned rule.
| Parameter | Type | Required | Description |
|---|---|---|---|
error_description |
string | yes | What was wrong |
correction |
string | yes | What is correct |
rule |
string | yes | Derived guideline, e.g. "ALWAYS use X instead of Y" |
project_dir |
string | no | Current working directory (for finding project CLAUDE.md) |
list_errors
Lists all learned rules from the relevant CLAUDE.md.
| Parameter | Type | Required | Description |
|---|---|---|---|
project_dir |
string | no | Current working directory |
Output Format
Rules are stored in a ## Learned Rules section in your CLAUDE.md:
## Learned Rules
- ALWAYS use async/await for API calls, NOT .then() chains
- Google Apps Script uses Logger.log(), NOT console.log()
- Confluence API expects ADF format, NOT Wiki markup
Installation
git clone https://github.com/henningziech/claude-error-collector-mcp.git
cd claude-error-collector-mcp
./install.sh
The install script handles everything:
- Installs dependencies and builds the project
- Registers the MCP server with Claude Code (
claude mcp add)
No manual CLAUDE.md editing needed — the server provides its own instructions to Claude via MCP server metadata.
Restart Claude Code after installation to activate.
Manual Installation
If you prefer to set things up manually:
npm install && npm run build
claude mcp add error-collector -- node /path/to/claude-error-collector/dist/index.js
CLAUDE.md Resolution
The server finds the right CLAUDE.md using this logic:
- If
project_diris provided: walk up the directory tree looking forCLAUDE.md - If found and not in the home directory: use it (project-level rules)
- Fallback:
~/.claude/CLAUDE.md(global rules)
Duplicate Detection
Duplicate detection works on two levels:
-
Server-side: Before writing a rule, the server checks existing rules using case-insensitive substring matching. If the new rule is already covered by an existing one (or vice versa), it skips the write.
-
Semantic (via instructions): The server instructs Claude to review existing learned rules for semantic equivalence before calling
record_error— even if the wording differs. Claude will:- Skip silently if the rule clearly already exists
- Record it if the rule is clearly new
- Ask the user if a similar rule exists but it's not 100% clear whether it's a duplicate, offering options to add alongside, consolidate, or skip
License
MIT
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.