brain
Adaptive error memory & code intelligence MCP server with Hebbian synapse network, cross-project learning, and auto-error detection
claude mcp add --transport stdio timmeck-brain npx -y @timmeck/brain \ --env BRAIN_LOG_LEVEL="info|debug|warn|error (optional)" \ --env BRAIN_CONFIG_PATH="Path to MCP brain configuration file (optional)"
How to use
Brain is an adaptive MCP server that enhances Claude Code by adding memory, learning, and code intelligence capabilities. It uses On-Your-Device memory and persistent context to remember errors, patterns, and reusable code modules across projects. With its Error Memory, Code Intelligence, and Persistent Memory features, Brain can propose fixes faster, reuse existing solutions, and keep track of decisions and tasks over time. To start using it, install the CLI globally and run Brain setup, which configures MCP hooks and starts the daemon. Once running, Brain exposes an MCP interface (stdio + HTTP/SSE) that Claude Code and other clients can connect to for error analysis, solution retrieval, and context-aware code recommendations.
After setup, you can interact with Brain via its standard MCP endpoints and tooling. Brain can register reusable code modules across projects, track error fingerprints, suggest preventive patterns, and maintain a project-wide memory of decisions, goals, and lessons. When you report an error, Brain searches its hybrid index (TF-IDF + vector + synapse boost) for matching solutions, returns a confidence-scored recommendation, and can re-use modules from other projects to avoid rework. It also logs commits and changes that relate to the errors, enabling cross-project learning and better traceability over time.
How to install
Prerequisites
- Node.js and npm installed on your system
- Internet access to fetch the Brain package from npm
Installation steps
-
Install Brain globally via npm: npm install -g @timmeck/brain
-
Run the initial setup to configure MCP, hooks, and start the daemon: brain setup
-
Verify Brain is running and accessible via MCP endpoints. If needed, customize environment variables or configuration as described in the additional notes.
Optional
- If you want to run Brain in a container or via a package manager alternative, refer to the ecosystem monorepo for additional installation options.
Additional notes
Notes and tips:
- The Brain MCP server is designed to work with Claude Code and related tooling via stdio and HTTP/SSE interfaces.
- You can customize behavior with environment variables such as BRAIN_CONFIG_PATH to point to a config file, or BRAIN_LOG_LEVEL to control verbosity.
- If you encounter slow startup or connection issues, ensure networking allows the MCP endpoints (stdio, plus any HTTP/SSE ports used by your setup).
- Brain emphasizes learning over time: ensure you have ongoing projects indexed so Code Intelligence and Persistent Memory have material to learn from.
- When upgrading, review the Change Logs in the brain ecosystem to understand new features like Semantic Changelog, Task/Goal Tracking, and Cross-Project Learning.
Related MCP Servers
Wax
Sub-Millisecond RAG on Apple Silicon. No Server. No API. One File. Pure Swift
mcp-jest
Automated testing for Model Context Protocol servers. Ship MCP Servers with confidence.
create -kit
Scaffold a production-ready Model Context Protocol (MCP) server in seconds.
vibe-workspace
Manage a vibe workspace with many repos
mcp-tidy
CLI tool to visualize and manage MCP server configurations in Claude Code. List servers, analyze usage statistics, and clean up unused servers
Mira
Local MCP server that gives Claude Code persistent context, code intelligence, and background analysis. Runs on your machine, stored in SQLite.