Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

An intelligent context management layer for the Brain Knowledge Management System, implementing semantic routing and human-in-the-loop workflows.

README.md

MCP Brain Manager

An intelligent context management layer for the Brain Knowledge Management System, implementing semantic routing and human-in-the-loop workflows.

Overview

The MCP Brain Manager provides:

  • Enhanced Session Management - Automatic context loading and mode selection
  • Semantic Routing - Intelligent classification of user intent
  • Human-in-the-Loop Updates - Proposed changes require confirmation
  • Project Stack - Seamless switching between multiple projects
  • Project Templates - Structured starting points for different project types
  • Analytics & Insights - Pattern analysis and productivity metrics

Installation

cd mcp-brain-manager
npm install
npm run build

Configuration

Add to your MCP settings:

{
  "mcpServers": {
    "brain-manager": {
      "command": "node",
      "args": ["/path/to/mcp-brain-manager/dist/index.js"],
      "description": "Intelligent Brain system management"
    }
  }
}

Available Tools

Core Management

manager_init

Initialize enhanced brain session with context loading. ``typescript manager_init({ message: "Let's continue working on the API" }) // Returns: mode, confidence, last session info, current project ``

propose_update

Create a reviewable update proposal. ``typescript propose_update({ updateType: "progress", updates: { completedTasks: ["Setup auth"], newTasks: ["Add tests"], currentFocus: "Testing" } }) // Returns: proposal ID, confirmation prompt, proposed changes ``

confirm_update

Apply a proposed update after review. ``typescript confirm_update({ updateId: "uuid-here", modifications: { / optional changes / } }) ``

Project Management

switch_project

Switch to different project with context preservation. ``typescript switch_project({ projectName: "new-project", createIfNotExists: true, template: "software" }) ``

return_to_previous

Pop previous project from stack. ``typescript return_to_previous() ``

generate_dashboard

Create Obsidian-compatible project dashboard. ``typescript generate_dashboard({ projectName: "my-project", includeAnalytics: true }) ``

Intelligence Features

semantic_classify

Classify user intent with reasoning. ``typescript semantic_classify({ message: "I want to analyze the performance metrics", context: { lastProject: "api-project" } }) // Returns: mode, confidence, reasoning ``

analyze_patterns

Analyze work patterns for insights. ``typescript analyze_patterns({ timeframe: "week", focusArea: "productivity" }) ``

Usage Examples

Starting a Session

// First message of the day
await manager_init({ 
  message: "Let's continue with the chat app" 
})

// Response:
{
  "mode": "project_continuation",
  "confidence": 0.85,
  "reasoning": "Continuation signal detected with active project",
  "lastSession": {
    "project": "chat-app",
    "lastActivity": "Implemented websocket server"
  }
}

Recording Progress

// Propose an update
const proposal = await propose_update({
  updateType: "progress",
  updates: {
    completedTasks: ["Implement websockets"],
    newTasks: ["Add reconnection logic"],
    currentFocus: "Connection stability"
  }
})

// Review and confirm
await confirm_update({ updateId: proposal.id })

Making Decisions

await propose_update({
  updateType: "decision",
  updates: {
    decision: "Use Socket.IO instead of raw WebSockets",
    rationale: "Better browser compatibility and reconnection",
    impact: "Need to refactor existing code"
  }
})

Project Templates

Available templates:

  • software - Software development projects
  • research - Research and investigation
  • ml - Machine learning projects
  • writing - Writing and documentation
  • custom - Blank slate

Security Guidelines

Data Storage Restrictions

NEVER store the following in the state table:

  • API keys (OpenAI, Anthropic, etc.)
  • Passwords or authentication tokens
  • OAuth tokens or refresh tokens
  • Private SSH keys or certificates
  • Database connection strings with credentials
  • Any form of authentication credentials
  • Personal identification information (SSN, credit cards, etc.)

Sensitive Data Handling

If you need to work with sensitive data:

  1. Environment Variables - Keep API keys in environment variables
  2. External Config - Use separate config files (not tracked in git)
  3. Monitex Integration - For future encrypted storage needs:
   // Future implementation
   await manager_init({ 
     message: "Start work",
     encrypted: true  // Triggers Monitex password prompt
   })

Validation Rules

The brain-manager includes automatic validation to prevent accidental storage of sensitive data:

  • Detects common API key patterns (sk-, pk-, api-, key-, token-)
  • Blocks storage of strings matching credential patterns
  • Warns when attempting to store potential sensitive data

Safe Data for State Table

Safe to store:

  • Project metadata and descriptions
  • Task lists and progress tracking
  • Decision records and rationales
  • File paths and project structure
  • Timestamps and activity logs
  • Non-sensitive configuration options
  • Public URLs and documentation links

Never store:

  • Any form of credentials or secrets
  • Private/sensitive project data
  • Customer data or PII
  • Proprietary algorithms or trade secrets

Architecture

mcp-brain-manager/
├── src/
│   ├── index.ts           # MCP server entry point
│   ├── brain-manager.ts   # Core management logic
│   ├── semantic-router.ts # Intent classification
│   └── template-manager.ts # Project templates
├── dist/                  # Compiled output
└── package.json

Integration with Brain Tools

This manager coordinates with existing brain tools:

  • Uses brain:brain_init for initialization
  • Stores contexts with brain:state_set/get
  • Saves narratives with brain:brain_remember/recall
  • Creates dashboards with brain:obsidian_note

Development

# Watch mode
npm run watch

# Run tests
npm test

# Build for production
npm run build

Future Enhancements

  1. True Semantic Routing - Call Claude for classification instead of patterns
  2. Context Compression - Automatic summarization for large projects
  3. Collaboration Mode - Share contexts between users
  4. Voice Integration - Natural language project updates
  5. Auto-categorization - Intelligent task and decision grouping

Troubleshooting

Q: Semantic classification seems wrong? A: You can provide feedback to improve: ``javascript await semantic_classify({ message: "your message", context: { / ... / } }) // If wrong, explicitly state: "switch to research mode" ``

Q: How to see all projects? A: Use the brain tools directly: ``javascript brain:state_list({ category: "project" }) ``

Q: Update proposal expired? A: Proposals expire after 5 minutes. Create a new one.

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.