mcp-brain-tools logo

mcp-brain-tools

Community
j3k0

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

Publisherj3k0
Repositorymcp-brain-tools
LanguageTypeScript
Forks
7
Stars
20
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    mcp-brain-tools exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    20 stars and 7 forks from the linked repository.

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

Installation

TypingMind
Prerequisites:

Node.js 18+

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

Use mcp-brain-tools MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once mcp-brain-tools is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add mcp-brain-tools as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the mcp-brain-tools MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "j3k-mcp-brain-tools": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-brain-tools"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the mcp-brain-tools MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the mcp-brain-tools MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use mcp-brain-tools to help me with this task?
mcp-brain-tools
Sure. I read it.
Here is what I found using mcp-brain-tools.

Frequently asked questions

What is the mcp-brain-tools MCP server used for?

mcp-brain-tools is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use mcp-brain-tools MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use mcp-brain-tools with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use mcp-brain-tools MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With mcp-brain-tools connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect mcp-brain-tools MCP to TypingMind?

mcp-brain-tools runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does mcp-brain-tools MCP provide in TypingMind?

mcp-brain-tools exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use mcp-brain-tools MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If mcp-brain-tools requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇