MegaBrain
MegaBrain is an MCP server that provides persistent memory, rule enforcement, and mistake vaccination for AI coding assistants.
Consult stored rules, specs, blind spots, and golden patterns before coding (
brain_consult).Record mistakes and fixes as vaccines (
brain_record_experience).Enforce strict constraints (
brain_record_rule).Require reading specific spec files (
brain_require_spec).Save verified code snippets as golden patterns (
brain_record_golden_pattern).List active rules (
brain_list_rules).Get knowledge base statistics (
brain_stats).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MegaBrainconsult the brain before I write the PHP MySQL signup query"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π§ MegaBrain (MCP)
Persistent Cross-Agent Memory, Rule Enforcer, and Blindspot Vaccine for AI Coding Assistants.
Compatible with Claude Desktop, VS Code (Cline, Roo Code, Continue), Antigravity IDE, and Local AI (llama.cpp).
π― The Problem
When vibecoding with AI coding agents (Claude, Antigravity, or local LLMs via llama.cpp), developers face two relentless frustrations:
Relentless Repetitive Errors (AI Blind Spots):
The AI writes a PHP/MySQL script and fails on the first try every single time, blindly retrying until it works. In the next session, it resets its memory and makes the exact same mistake again.Context & Spec Amnesia:
The AI ignores project rules (e.g., answering in Portuguese when English is strictly required) or writes UI components without reading the project's design specifications.
Related MCP server: Sugar
π‘ The Solution: MegaBrain
MegaBrain is an autonomous memory engine running locally via the Model Context Protocol (MCP). It stores rules, mandatory specifications, and battle-tested code snippets in a high-speed SQLite database with FTS5 full-text search.
Because MegaBrain uses a single local database (~/.megabrain/megabrain.db), any lesson learned by Claude or Antigravity is instantly available to your local llama.cpp model in VS Code, and vice-versa.
βββββββββββββββββββββββββββββββββββββ
β MegaBrain SQLite DB β
β (~/.megabrain/megabrain.db) β
βββββββββββββββββββ¬ββββββββββββββββββ
β (MCP / CLI)
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ
β Claude Desktop β β VS Code (Cline) β β Antigravity IDE β
β & Claude Code β β & llama.cpp β β β
ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββββ‘ The 3 Pillars
1. Mandatory Pre-Flight Check (brain_consult)
Before the AI generates code, designs layout, or queries databases, it queries MegaBrain with its task context. MegaBrain immediately surfaces:
Strict Constraints: E.g.,
STRICT_LANGUAGE: English.Prerequisite Specs: Traps the agent: "You are FORBIDDEN from generating layout code before reading
specs/design-tokens.md".Known Blind Spots: E.g., "You repeatedly fail PDO connection syntax. Do NOT use X; use Y."
Golden Patterns: Verified, working code snippets.
2. Autonomous Post-Mortem Vaccine (brain_record_experience)
Whenever the agent takes $\ge 2$ attempts to fix an error, or when the user says "Grava isso no cΓ©rebro" ("Remember this"), the agent records what failed and what worked.
MegaBrain tracks a recurrence counter and vaccinates the entire environment against that mistake.
3. Golden Patterns (Verified Code Snippets)
Instead of letting the AI hallucinate boilerplates from average internet tokens, MegaBrain stores validated implementations that the AI must adopt directly.
π Quickstart
Prerequisites
Python 3.10 or higher
uv (recommended) or standard
pip
Installation
# 1. Clone the repository
git clone https://github.com/dougrn/MCP-MegaBrain.git
cd MCP-MegaBrain
# 2. Sync dependencies with uv
uv syncTry the CLI
# View knowledge base stats
uv run megabrain stats
# Add a strict rule
uv run megabrain record-rule "All code comments and docs must be in English" --category language --project my-app
# Require a spec before touching design
uv run megabrain record-spec "specs/design-tokens.md" --trigger "design,ui,layout" --project my-app
# Record an anti-pattern vaccine
uv run megabrain record-experience --context "php mysql" --failed "Called set_charset on uninitialized PDO" --fix "Pass charset=utf8mb4 inside DSN string"
# Save a verified Golden Pattern
uv run megabrain golden-pattern --title "PHP PDO UTF8MB4" --context "php mysql pdo" --code "$pdo = new PDO('mysql:host=localhost;dbname=test;charset=utf8mb4', $user, $pass, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);"
# Consult MegaBrain (see what the AI receives!)
uv run megabrain consult "php mysql query" --project my-app
# List and delete obsolete records
uv run megabrain list rules
uv run megabrain delete rules 1π Connecting to Your AI Clients
1. Claude Desktop
Add to your claude_desktop_config.json:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"megabrain": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\Users\\dougl\\Desktop\\ServiΓ§os\\_Pessoais\\MCP-MegaBrain",
"megabrain-server"
]
}
}
}2. VS Code (Cline / Roo Code)
Add to your Cline MCP settings:
{
"mcpServers": {
"megabrain": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\Users\\dougl\\Desktop\\ServiΓ§os\\_Pessoais\\MCP-MegaBrain",
"megabrain-server"
],
"disabled": false,
"autoApprove": [
"brain_consult",
"brain_record_experience",
"brain_stats"
]
}
}
}3. Antigravity IDE
Add to your MCP server configuration:
{
"mcpServers": {
"megabrain": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\Users\\dougl\\Desktop\\ServiΓ§os\\_Pessoais\\MCP-MegaBrain",
"megabrain-server"
]
}
}
}4. Local AI (llama.cpp)
Run the prompt enricher before passing prompts to llama-server or CLI:
uv run python examples/llama-cpp-wrapper/query_megabrain.pyπ The Agent Behavioral Contract
To guarantee that your AI assistant actively consults MegaBrain and records mistakes autonomously, add the following prompt rule to your agent's instructions (e.g. .cursorrules, .agents/rules/megabrain.md, or Claude project instructions):
# MegaBrain Protocol (Persistent Knowledge & Vaccine)
You are equipped with MegaBrain via MCP tools. You MUST follow these mandatory protocols:
## 1. MANDATORY PRE-FLIGHT CONSULTATION
BEFORE generating code, proposing architecture, querying databases, or touching UI design:
- Call `brain_consult(context="<stack/keywords>", project="<project_id_or_global>")`.
- **Prerequisite Specs**: If any mandatory specs are returned, you are strictly FORBIDDEN from writing code or plans until you inspect the spec file using your file reading tool.
- **Golden Patterns**: If a verified snippet is provided, you MUST adopt it instead of inventing your own implementation.
- **AI Blind Spots / Traps**: Carefully avoid the listed anti-patterns and apply the proven fixes.
## 2. AUTONOMOUS SELF-IMPROVEMENT (POST-MORTEM VACCINE)
Whenever you:
- Spend 2 or more attempts trying to fix an error in a terminal/script, OR
- Discover a non-obvious bug or runtime pitfall:
- IMMEDIATELY call `brain_record_experience(context="...", what_failed="...", fix_applied="...", project="...")`.
- If a clean, reusable code snippet solved the issue, pass it to `verified_snippet`.
## 3. HUMAN TRIGGERS
If the user says:
- "Grava isso no cΓ©rebro" / "Aprende isso" / "Vacina contra esse erro" / "Remember this":
- Immediately extract the context keywords, what failed, and the working fix.
- Call `brain_record_experience`.π οΈ CLI Reference
Command | Description | Example |
| Query active rules, specs, and vaccines |
|
| Enforce a strict constraint |
|
| Bind a spec file to topic triggers |
|
| Vaccinate against a repeated error |
|
| Save a battle-tested code snippet |
|
| List stored memory by type |
|
| Delete stored item by type and ID |
|
| Display memory overview & item counts |
|
| Output the agent system instructions |
|
| Launch MCP server over stdio |
|
π§ͺ Running Tests
uv run pytestAll 15 test suites validate schema migrations, FTS5 full-text search, recurrence increments, deletion operations, and MCP tool executions.
π§π· Resumo em PortuguΓͺs
O MCP-MegaBrain Γ© um cΓ©rebro persistente para desenvolvedores que trabalham com mΓΊltiplos agentes (Antigravity, Claude, VS Code/Cline, llama.cpp). Ele resolve de forma definitiva:
Erros repetitivos e teimosia da IA: Transforma bugs corrigidos em "vacinas" com contador de recorrΓͺncia.
AmnΓ©sia de especificaΓ§Γ΅es: Obriga a IA a ler suas specs de design/arquitetura antes de emitir cΓ³digo.
DesobediΓͺncia de regras: Garante conformidade com idioma, padrΓ΅es de commit e restriΓ§Γ΅es de arquitetura.
100% Local e Gratuito: Armazenado em SQLite local com busca instantΓ’nea (FTS5), sem mensalidades ou nuvem.
π License
This project is licensed under the MIT License.
Available Tools
7 toolsbrain_consultA
MANDATORY PRE-FLIGHT CHECK: Call this before writing, designing, or refactoring code. Returns:
Active project rules & hard constraints
Prerequisite specifications you MUST inspect before coding
Known AI blind spots (previous traps & working vaccines)
Golden Patterns (verified working code snippets to use directly)
Args: context: The topic, stack, or task description (e.g., 'php mysql pdo', 'react button design', 'authentication') project: Project name/slug or 'global'
| Name | Required | Description | Default |
|---|---|---|---|
| context | Yes | ||
| project | No | global |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden, and it does disclose a good deal: the tool is a retrieval/consultation operation whose output comprises rules, specs, traps, and verified code patterns. It omits operational traits like permissions, caching, or whether results are scoped/paginated, but the read-only nature is unambiguous from the 'Returns:' framing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the mandatory pre-flight directive, followed by a scannable Returns list and Args block. Efficient overall, though the Returns bullets partially duplicate what the output schema already exposes, adding mild redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a low-complexity two-parameter retrieval tool, the description is essentially complete: it conveys purpose, trigger, output categories, and both parameters. The presence of an output schema makes the Returns list somewhat redundant, but nothing an agent needs to invoke it correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate β and it does, documenting both parameters: 'context' as the topic/stack/task with concrete examples ('php mysql pdo', 'authentication'), and 'project' as a name/slug with the 'global' fallback. It adds real meaning beyond the bare schema titles.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (consult) and enumerates exactly what it retrieves: active project rules, prerequisite specs, known AI blind spots, and golden patterns. This clearly distinguishes it from the sibling write/list tools (brain_record_rule, brain_list_rules, brain_stats), which merely record or enumerate rather than synthesize guidance.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly frames when to call it: 'Call this before writing, designing, or refactoring code' β a concrete trigger condition. It does not, however, name alternatives or state when NOT to use it, so it falls short of the full when/when-not/alternatives bar.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_list_rulesB
List all active rules for the given project including global rules.
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | global |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It does disclose two useful traits β only *active* rules are returned and global rules are always merged into the result β but it does not state the read-only nature explicitly, nor anything about ordering, volume, or pagination.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single well-formed sentence with the scope front-loaded and zero filler. Nothing in it is redundant.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value detail is not needed, and the scope sentence covers the main ambiguity about global rules. The remaining gap is the absence of any usage/routing guidance for a tool sitting among six siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There is one parameter with 0% schema description coverage, so the schema explains nothing. The description adds partial meaning by framing the parameter as the project scope and clarifying that global rules are included regardless, but it does not explain the 'global' default or what happens when the argument is omitted.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb (List) and resource (rules) plus the scope (active rules for the given project, including global rules). It is clearly distinguishable from the write-side siblings like brain_record_rule, though it never names an alternative tool explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to call this versus siblings such as brain_consult or brain_stats, and no stated prerequisites or exclusions. Usage is only implied by the verb 'List'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_record_experienceA
VACCINATE AGAINST MISTAKES: Call this whenever you spent >= 2 attempts fixing an error, encountered an unexpected runtime pitfall, or when the user says 'grava isso' / 'aprende isso'.
Args: context: Stack/domain keywords (e.g., 'php mysql utf8mb4', 'docker windows networking') what_failed: The anti-pattern or rookie mistake the AI made fix_applied: The exact working solution or insight that solved it project: Project identifier or 'global' verified_snippet: (Optional) The working code block to also save as a Golden Pattern
| Name | Required | Description | Default |
|---|---|---|---|
| context | Yes | ||
| project | No | global | |
| fix_applied | Yes | ||
| what_failed | Yes | ||
| verified_snippet | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It implies persistence-for-future-use via the 'vaccinate' framing, but never states that the record is stored, later surfaced by brain_consult, deduplicated, or that it is an irreversible write; no auth, confirmation, or rate-limit context is given.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The trigger condition is front-loaded in one sentence, then a compact Args block; every line earns its place. The all-caps 'VACCINATE AGAINST MISTAKES' opener is rhetorical rather than informative, a minor style cost.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 5-param write tool with an output schema, the description covers triggers and all parameters adequately. The remaining gap is relational: verified_snippet 'also saves a Golden Pattern' overlaps with the brain_record_golden_pattern sibling, and the description never resolves which tool an agent should pick.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must carry all parameter meaning, and it does: it explains each of the five arguments, gives concrete context examples ('php mysql utf8mb4', 'docker windows networking'), defines project as an identifier or 'global' (matching the default), and marks verified_snippet optional while noting its dual role as a Golden Pattern.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a concrete verb+resource (record an experience) and enumerates the triggering situations: >=2 attempts fixing an error, an unexpected runtime pitfall, or the user saying 'grava isso'/'aprende isso'. It is clearly distinguishable from brain_list_rules or brain_stats, though the overlap with brain_record_golden_pattern is only hinted at rather than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Strong explicit trigger conditions ('Call this whenever you spent >= 2 attempts...') give an agent a clear activation rule. It does not state when NOT to use it, nor explicitly route between the near-siblings brain_record_rule and brain_record_golden_pattern, even though the verified_snippet argument touches the latter's territory.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_record_golden_patternB
Save a battle-tested code snippet that agents must copy/adopt instead of reinventing boilerplate.
Args: title: Short descriptive title context: Stack/domain keywords (e.g., 'php mysql pdo') code_snippet: The exact verified working code explanation: Explanation of why this pattern is preferred project: Project identifier or 'global'
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| context | Yes | ||
| project | No | global | |
| explanation | No | ||
| code_snippet | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It says the snippet must be 'exact verified working code' but never states whether re-recording the same title overwrites or duplicates, how patterns are later retrieved, or any permission/scope requirements for a write operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with a single high-signal sentence, followed by a tight Args list with no filler. It is appropriately sized for a five-parameter tool, though the Args glosses are thin relative to the space they occupy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be described. The remaining gap is behavioral: for a persistence tool with no annotations, the description says nothing about storage scope, overwrite semantics, or how the recorded pattern is subsequently surfaced to agents.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and the Args block does enumerate all five parameters. However most glosses merely restate the field names ('title: Short descriptive title', 'code_snippet: The exact verified working code'); only the context example ('php mysql pdo') and the 'global' project default add real semantic value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence gives a specific verb+resource: saving a 'battle-tested code snippet' as a reusable 'golden pattern'. It implies a distinct artifact type versus siblings like brain_record_experience or brain_record_rule, but never names or contrasts them, so the differentiation is inferential rather than explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
"agents must copy/adopt instead of reinventing boilerplate" hints at the trigger condition (you have verified boilerplate worth reusing), but there is no explicit when-to-use/when-not guidance and no routing to brain_record_experience or brain_record_rule for non-code knowledge.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_record_ruleB
Enforce a strict constraint that agents must always obey.
Args: rule: The constraint statement (e.g., 'All code comments and docs must be in English') category: Category like 'language', 'architecture', 'security', 'git', 'style', 'general' project: Project identifier or 'global' severity: 'CRITICAL', 'HIGH', 'MEDIUM', or 'LOW'
| Name | Required | Description | Default |
|---|---|---|---|
| rule | Yes | ||
| project | No | global | |
| category | No | general | |
| severity | No | CRITICAL |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It implies the rule persists and is obeyed by agents ('must always obey'), but says nothing about storage scope, whether rules are ever deleted or superseded, permission requirements, or what happens if a conflicting rule exists. For a mutation tool with zero annotation coverage this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence states the tool's effect, followed by a compact Args list. The parameter names repeat the schema keys, but the examples and severity enumeration earn their space, so there is little waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained. However, for an unannotated mutation tool the description leaves the agent without the persistence and conflict semantics it would need to call this confidently alongside brain_list_rules and brain_record_experience.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it largely does: it defines all four parameters, gives a concrete example for 'rule', lists candidate categories, explains that 'project' accepts an identifier or 'global', and enumerates the four valid severity values even though the schema declares no enum. It stops short of explaining default behavior (e.g., what 'global' scope means in practice).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a clear verb and resource ('Enforce a strict constraint') that maps to the tool name brain_record_rule, and the Args block confirms the recorded entity is a rule. It does not differentiate from siblings like brain_record_experience or brain_record_golden_pattern, which also record persistent agent knowledge, so an agent must infer the distinction from names alone.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no statement of when to record a rule versus the sibling tools, no preconditions, and no exclusions. The only usage signal is the adjective 'strict', which hints at durable/high-importance content but is not an actionable routing condition.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_require_specA
Register a specification file that the agent MUST read before working on matching topics.
Args: spec_path: Path to spec file (e.g., 'specs/design-tokens.md', 'docs/api.md') trigger_pattern: Comma-separated keywords triggering this requirement (e.g., 'design, ui, layout, componentes') instruction: Directive for the agent (e.g., 'Read design tokens before generating CSS') project: Project identifier or 'global'
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | global | |
| spec_path | Yes | ||
| instruction | No | ||
| trigger_pattern | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It does disclose the key trait - the registration creates a mandatory read requirement ('MUST read') rather than an advisory note - but says nothing about persistence scope, whether re-registering the same spec_path overwrites, how trigger matching is evaluated, or permission needs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded one-sentence purpose followed by a compact per-parameter list; no filler. The docstring formatting ('Args:') is slightly mechanical but every line carries usable information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values need not be explained, and all four params are documented. However, with no annotations and several sibling rule-recording tools, the description leaves unaddressed how this requirement persists and how it interacts with brain_record_rule, which an agent needs in order to choose correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and the Args block documents all four parameters with concrete examples ('design, ui, layout, componentes') and the intended value of project. It does not state that project defaults to 'global' explicitly, leaving that to the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Register a specification file') plus the distinguishing behavioral property that the agent MUST read it before matching topics. This separates it from siblings like brain_record_rule and brain_record_golden_pattern, though it never names those alternatives explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The 'MUST read before working on matching topics' clause implies when the tool is appropriate, but there is no explicit when-to-use/when-not guidance and no comparison to brain_record_rule or brain_record_golden_pattern, which an agent could easily confuse with this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
brain_statsB
Get current knowledge base statistics.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries the full burden. 'Get' implies a read operation and 'current' implies a snapshot, but it doesn't state whether it requires auth, what statistics are returned, or whether it's expensive. Has an output schema which covers returns, lowering the burden somewhat.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single short sentence, front-loaded with the action. Appropriate size for a no-param tool, though slightly terse on detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists so return values needn't be explained, and there are no params. But a no-annotation read tool with ambiguous statistics scope and no usage guidance leaves some gaps for an agent deciding when to call it versus brain_consult.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Zero parameters, so baseline 4 applies. No parameter semantics to add.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (Get) and resource (knowledge base statistics) with clear scope. It is distinguishable from siblings like brain_consult and brain_record_* which are query/write operations, though the description doesn't explicitly differentiate.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Only 'Get current knowledge base statistics' with no indication of when to use this versus brain_consult or brain_list_rules. No usage context, prerequisites, or alternatives named.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.0- First observed
brain_consult - First observed
brain_list_rules - First observed
brain_record_experience - First observed
brain_record_golden_pattern - First observed
brain_record_rule - First observed
brain_require_spec - First observed
brain_stats
TDQS
Scored across 7 tools
Most tools are clearly distinct (record_rule vs record_experience vs record_golden_pattern vs require_spec). However, brain_consult overlaps with brain_list_rules since consult already returns active rules, and record_experience with a verified_snippet partially duplicates record_golden_pattern, creating mild selection ambiguity.
All tools share a consistent brain_ prefix and snake_case verb_noun style (brain_record_rule, brain_list_rules, brain_require_spec). Minor deviations are brain_consult and brain_stats, which lack a noun object but remain readable and unambiguous.
Seven tools is well-scoped for a knowledge-base server covering retrieval, rule/spec/experience/pattern recording, and stats. Each tool maps to a distinct operation and none feels redundant or missing.
Write and read paths are covered (record rules/specs/experiences/patterns, consult, list_rules, stats), but there is no update or delete/retire operation for any stored artifact. Without lifecycle management, stale or wrong rules and vaccines cannot be corrected, which is a notable gap for a long-lived knowledge base.
Maintenance
Related MCP Connectors
Persistent cross-session memory shared by Codex, Claude Code, ChatGPT, and other AI agents.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Private memory for AI agents: save and recall facts across Claude Code, Codex, Cursor and ChatGPT.
Shared memory for AI coding agents. Save once, reuse from Cursor, Claude Code, Codex.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceProvides AI coding agents with a local-first, persistent memory layer so they can store and semantically recall project-specific and cross-project knowledge, conventions, and error patterns during sessions. It also optionally enables autonomous task queue execution and issue resolution driven by that same memory.-
- FlicenseNot gradedqualityAmaintenanceGives AI coding agents persistent, local-first memory so they can store decisions, preferences, error patterns, and cross-project guidelines and semantically recall the relevant context across sessions and projects, with no API keys required. Optionally also enables queued autonomous task execution that draws on that same stored context.-
- FlicenseNot gradedqualityAmaintenanceGives AI coding agents persistent, local-first memory so they can store, semantically search, and recall decisions, preferences, error patterns, and cross-project guidelines directly during a session. It also optionally queues tasks for autonomous execution against that same memory.-
- FlicenseNot gradedqualityAmaintenanceProvides AI coding agents with a local-first persistent memory layer they can read and write during sessions, storing decisions, preferences, error patterns, and research per project or globally. Enables semantic and keyword search, formatted context recall, and cross-project guideline surfacing without API keys or cloud storage.-