Logo di mcp-brain-tools

mcp-brain-tools

Community
j3k0

A powerful MCP memory using a knowledge graph powered by elastic search

Autorej3k0
Repositorymcp-brain-tools
LinguaTypeScript
Fork
7
Stelle
20
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
Link
  • Collega gli strumenti ai flussi di lavoro IA

    mcp-brain-tools mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    20 stelle e 7 fork nel repository collegato.

mcp-brain-tools

An MCP server that gives AI agents persistent memory with built-in freshness tracking and spaced repetition. Backed by Elasticsearch.

Unlike simple key-value memory stores, mcp-brain-tools tracks how old each piece of knowledge is, flags what needs review, and lets agents verify information to keep it fresh — inspired by how spaced repetition helps humans retain knowledge.

Features

  • Spaced repetition freshness — each entity has a review interval that doubles on verification (capped at 365 days). Confidence labels (fresh/normal/aging/stale/archival) tell agents what to trust.
  • Progressive search — queries return fresh results first, automatically widening to include older data only when needed.
  • Observations as entities — each observation gets its own freshness lifecycle, so "build is broken" (1-day review) and "founded in 2015" (365-day review) age independently.
  • Memory zones — isolate knowledge by project, team, or domain.
  • AI-powered filtering — optional Groq integration scores search results by relevance.
  • DRY by design — tool descriptions guide agents not to store what's already in code, git, or docs.

Setup

Prerequisites

  • Node.js >= 18
  • Docker (for Elasticsearch) or a remote Elasticsearch instance

Install and build

bash
npm install
npm run build

Start Elasticsearch

bash
npm run es:start

Or point to your own instance via ES_NODE environment variable.

Configure your MCP client

Add to your Claude Code, Claude Desktop, or other MCP client config:

json
{
  "mcpServers": {
    "memory": {
      "command": "node",
      "args": ["/path/to/mcp-brain-tools/dist/index.js"],
      "env": {
        "ES_NODE": "http://localhost:9200",
        "GROQ_API_KEY": "your-key-here"
      }
    }
  }
}

GROQ_API_KEY is optional — enables AI-powered search filtering and zone relevance scoring.

Install the auto-memory hook (Claude Code only)

The memory hook runs on every user message and automatically injects relevant context — no agent cooperation needed.

Add to ~/.claude/settings.json:

json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "node /path/to/mcp-brain-tools/dist/memory-hook.js"
          }
        ]
      }
    ]
  }
}

The hook uses the same ES_NODE, AI_API_KEY/GROQ_API_KEY, AI_API_BASE, and AI_MODEL env vars (set them in the env block of your settings, or export them in your shell profile).

AI_API_BASE defaults to Groq's endpoint but accepts any OpenAI-compatible API URL.

How it works

Entities and observations

Entities represent anything worth remembering — people, projects, decisions, facts. Each entity has:

  • A name and type
  • Spaced repetition fields: verifiedAt, reviewInterval, nextReviewAt
  • A confidence label computed from freshness: 1 - (daysSinceVerified / reviewInterval)

Observations are stored as separate entities linked via is_observation_of relations. Each observation has its own review cadence:

Entity: "iaptic-server" (type: Project, reviewInterval: 30 days)
  <- "iaptic-server: uses TypeScript" (reviewInterval: 180 days)
  <- "iaptic-server: migration in progress" (reviewInterval: 7 days)

Freshness lifecycle

  1. Entity created — confidence: "fresh", default review in 7 days
  2. Review date passes — confidence: "aging", needsReview: true
  3. Agent verifies (via verify_entity) — interval doubles, confidence resets to fresh
  4. Long overdue — confidence: "stale" then "archival", excluded from default search

Progressive search

When searching, the server uses three passes:

  1. freshness >= 0 — fresh and normal entities
  2. freshness >= -2 — adds aging and stale
  3. No filter — adds archival

This keeps results clean while ensuring nothing is permanently lost.

MCP Tools

ToolDescription
create_entitiesCreate entities with optional observations and reviewInterval
update_entitiesUpdate existing entities
delete_entitiesDelete entities (with optional cascade)
add_observationsAdd observations as separate entities with own freshness
verify_entityConfirm entity is still accurate, extend review interval
search_nodesSearch with progressive freshness filtering
open_nodesGet specific entities by name with freshness metadata
get_recentGet recently accessed entities
create_relationsCreate relationships between entities
delete_relationsRemove relationships
inspect_knowledge_graphAI-powered entity retrieval with tentative answers
inspect_filesAI-powered file content inspection
list_zonesList memory zones (with AI relevance scoring)
create_zone / delete_zoneManage memory zones
copy_entities / move_entitiesTransfer entities between zones
merge_zonesMerge zones with conflict resolution
zone_statsGet entity/relation counts for a zone
mark_importantBoost entity relevance score
get_time_utcGet current UTC time

Environment variables

VariableDefaultDescription
ES_NODEhttp://localhost:9200Elasticsearch URL
ES_USERNAME—Elasticsearch username
ES_PASSWORD—Elasticsearch password
GROQ_API_KEY—Groq API key for AI filtering
GROQ_MODELSopenai/gpt-oss-120b,llama-3.3-70b-versatileComma-separated model list
KG_INDEX_PREFIXknowledge-graphElasticsearch index prefix
KG_DEFAULT_ZONEdefaultDefault memory zone
DEBUGfalseEnable debug logging

Recommended agent instructions

For agents to actively use the memory server, add something like this to your CLAUDE.md (or equivalent instructions file):

markdown
## Memory

Use MCP Memory (`mcp__memory__*` tools) — a shared knowledge graph across all agents, projects, and computers.

**When to SAVE (immediately, before moving on):**
- Something you tried didn't work (non-transient) → save what failed and why, so no agent repeats it
- A decision was made (architectural, design, workflow) → save the decision and the reason
- The user corrects you or gives explicit instructions → save the rule
- You learn something non-obvious that took effort to discover → save it

**When to SEARCH (before starting, not after failing):**
- **At the start of every non-trivial task** — search before thinking, not after hitting a wall
- About to try an approach that might have been attempted before → search first
- User references something from a past session → search before asking

**Rules:**
- Skip anything easy to find in code, git log, or docs
- Use the project name as the zone for project-specific knowledge; `default` for general knowledge
- Keep entries short — the AI filters server-side, so be generous rather than selective
- Short `reviewInterval` (e.g. 3–7 days) for volatile facts; longer (30–180) for stable ones

The key insight: agents need explicit trigger-based instructions ("when X, do Y"), not just descriptions of what the tool does.

Development

bash
npm run build          # Compile TypeScript
npm run dev            # Watch mode
npm run test:jest      # Run Jest tests
npm run es:start       # Start Elasticsearch
npm run es:stop        # Stop Elasticsearch
npm run es:reset       # Wipe data and restart
npm run import         # Import from JSON
npm run export         # Export to JSON

License

MIT

Installazione

TypingMind
Prerequisiti:

Node.js 18+

{
  "mcpServers": {
    "j3k-mcp-brain-tools": {
      "command": "",
      "args": []
    }
  }
}

Usa MCP mcp-brain-tools con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso mcp-brain-tools, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi mcp-brain-tools come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di mcp-brain-tools.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "j3k-mcp-brain-tools": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-brain-tools"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di mcp-brain-tools, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di mcp-brain-tools.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare mcp-brain-tools per aiutarmi con questa attività?
mcp-brain-tools
Certo. Ho letto.
Ecco cosa ho trovato con mcp-brain-tools.

Domande frequenti

A cosa serve il server MCP mcp-brain-tools?

mcp-brain-tools è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare mcp-brain-tools MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare mcp-brain-tools con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP mcp-brain-tools con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando mcp-brain-tools, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego mcp-brain-tools MCP a TypingMind?

mcp-brain-tools funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre mcp-brain-tools MCP in TypingMind?

mcp-brain-tools mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare mcp-brain-tools MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se mcp-brain-tools richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇