MCP HubMCP Hub
movibe

memory-bank-mcp

by: movibe

MCP Server para gerenciar o Memory Bank

24created 08/03/2025
Visit
management
memory

πŸ“ŒOverview

Purpose: To provide a Model Context Protocol (MCP) server for AI assistants, enabling efficient management of Memory Banks for storing and retrieving information across sessions.

Overview: The Memory Bank Server equips AI assistants with essential tools to interact with structured repositories of information called Memory Banks, which help maintain context and monitor progress over multiple sessions.

Key Features:

  • Memory Bank Management: Allows users to initialize, find, and manage Memory Banks effectively.

  • File Operations: Facilitates reading and writing files within Memory Banks, ensuring easy data manipulation.

  • Progress Tracking: Enables tracking and logging progress within Memory Banks to maintain a comprehensive history of changes.

  • Decision Logging: Records critical decisions along with their context and alternatives for future reference.

  • Active Context Management: Maintains and updates current context dynamically, ensuring continuity.

  • Mode Support: Supports mode-specific behaviors through detection of .clinerules files.

  • UMB Command: Provides a temporary update mechanism for Memory Bank files without permanent alterations.

  • Robust Error Handling: Ensures graceful handling of errors, maintaining functionality even during issues.

  • Status Prefix System: Offers immediate insight into the operational state of the Memory Bank for transparency and troubleshooting.


Memory Bank MCP 🧠

NPM Version
License: MIT
Tests

A Model Context Protocol (MCP) server for managing Memory Banks, allowing AI assistants to store and retrieve information across sessions.

Overview πŸ“‹

Memory Bank Server provides tools and resources for AI assistants to interact with Memory Banks. Memory Banks are structured repositories of information that help maintain context and track progress across multiple sessions.

Features ✨

  • Memory Bank Management: Initialize, find, and manage Memory Banks
  • File Operations: Read and write files in Memory Banks
  • Progress Tracking: Track progress and update Memory Bank files
  • Decision Logging: Log important decisions with context and alternatives
  • Active Context Management: Maintain and update active context information
  • Mode Support: Detect and use .clinerules files for mode-specific behavior
  • UMB Command: Update Memory Bank files temporarily with the UMB command
  • Robust Error Handling: Gracefully handle errors and continue operation when possible
  • Status Prefix System: Immediate visibility into Memory Bank operational state

Directory Structure πŸ“

By default, Memory Bank uses a memory-bank directory in the root of your project. Specifying a project path with --path will create or use <project_path>/memory-bank.

Custom folder names can be set with --folder. For example, --folder custom-memory uses <project_path>/custom-memory.

Recent Improvements πŸ› οΈ

  • Customizable Folder Name
  • Consistent Directory Structure
  • Enhanced Initialization (works without .clinerules files)
  • Improved Path Handling
  • Better Directory Detection
  • More Robust Error Handling

Installation πŸš€

# Install from npm
npm install @movibe/memory-bank-mcp

# Or install globally
npm install -g @movibe/memory-bank-mcp

# Or run directly with npx (no installation required)
npx @movibe/memory-bank-mcp

Usage with npx πŸ’»

Run Memory Bank MCP without installation:

# Run with default settings
npx @movibe/memory-bank-mcp

# Run with specific mode
npx @movibe/memory-bank-mcp --mode code

# Run with custom project path
npx @movibe/memory-bank-mcp --path /path/to/project

# Run with custom folder name
npx @movibe/memory-bank-mcp --folder custom-memory-bank

# Show help
npx @movibe/memory-bank-mcp --help

Configuring in Cursor πŸ–±οΈ

Cursor is an AI-powered code editor that supports MCP. To configure Memory Bank MCP in Cursor:

  1. Use Memory Bank MCP with npx to avoid global installation:
    npx @movibe/memory-bank-mcp --help
    
  2. Open Cursor Settings > Extensions > MCP
  3. Add MCP Server with:
    • Name: Memory Bank MCP
    • Command: npx
    • Arguments: @movibe/memory-bank-mcp --mode code (or desired mode)
  4. Save and enable the MCP server
  5. Open a project in Cursor; Memory Bank MCP will be active.

Interacting with Memory Bank MCP in Cursor

Examples of AI commands:

  • Initialize a Memory Bank:
    /mcp memory-bank-mcp initialize_memory_bank path=./memory-bank
  • Track Progress:
    /mcp memory-bank-mcp track_progress action="Feature Implementation" description="Implemented feature X"
  • Log Decision:
    /mcp memory-bank-mcp log_decision title="API Design" context="..." decision="..."
  • Switch Mode:
    /mcp memory-bank-mcp switch_mode mode=code

MCP Modes and Their Usage πŸ”„

Memory Bank MCP supports multiple operational modes for AI interactions:

Modes

  1. Code Mode πŸ‘¨β€πŸ’»
    Focus on code implementation and development.
    Usage: npx @movibe/memory-bank-mcp --mode code

  2. Architect Mode πŸ—οΈ
    Focus on system design and architecture.
    Usage: npx @movibe/memory-bank-mcp --mode architect

  3. Ask Mode ❓
    Focus on answering questions and providing information.
    Usage: npx @movibe/memory-bank-mcp --mode ask

  4. Debug Mode πŸ›
    Focus on troubleshooting and problem-solving.
    Usage: npx @movibe/memory-bank-mcp --mode debug

  5. Test Mode βœ…
    Focus on testing and quality assurance.
    Usage: npx @movibe/memory-bank-mcp --mode test

Switching Modes

  • When starting the server:
    npx @movibe/memory-bank-mcp --mode architect
    
  • During a session:
    memory-bank-mcp switch_mode mode=debug
    
  • In Cursor:
    /mcp memory-bank-mcp switch_mode mode=test
    
  • Using .clinerules files: Create .clinerules-[mode] files to auto-switch mode.

How Memory Bank MCP Works 🧠

Memory Bank MCP is based on the Model Context Protocol (MCP), enabling AI assistants to interact with external tools.

Core Components 🧩

  • Memory Bank: Structured markdown files storing project info:

    • product-context.md
    • active-context.md
    • progress.md
    • decision-log.md
    • system-patterns.md
  • MCP Server: Standalone process communicating with AI assistants via MCP, managing Memory Banks.

  • Mode System: Supports code, ask, architect, debug, and test modes.

Data Flow πŸ”„

  1. AI assistant connects and initializes a Memory Bank
  2. Calls tools to read/write Memory Bank files
  3. Maintains context across sessions for recall of decisions and progress

Memory Bank Structure πŸ“‚

  • Product Context: Project overview, goals, technologies, architecture
  • Active Context: Current state, ongoing tasks, issues, next steps
  • Progress: Chronological project updates
  • Decision Log: Key decisions with context and alternatives
  • System Patterns: Architecture, code, and documentation patterns

Advanced Features πŸš€

  • UMB Command: Temporarily update Memory Bank files during a session
  • Mode Detection: Automatic mode switching based on input
  • File Migration: Tools to migrate between file naming conventions
  • Language Standardization: All Memory Bank files are in English

Versioning πŸ“Œ

This project follows Semantic Versioning and uses Conventional Commits.

  • Major: Breaking changes (BREAKING CHANGE or !:)
  • Minor: New features (feat:)
  • Patch: Bug fixes, documentation

Usage πŸ“

Command Line Tool πŸ’»

memory-bank-mcp initialize_memory_bank path=./memory-bank

memory-bank-mcp track_progress action="Feature Implementation" description="Implemented feature X"

memory-bank-mcp log_decision title="API Design" context="..." decision="..."

memory-bank-mcp switch_mode mode=code

Library πŸ“š

import { MemoryBankServer } from "@movibe/memory-bank-mcp";

const server = new MemoryBankServer();

server.run().catch(console.error);

Contributing πŸ‘₯

See CONTRIBUTING.md for guidelines on contributing and code of conduct.

License πŸ“„

This project is licensed under the MIT License.

Memory Bank Status System 🚦

Memory Bank MCP uses a status prefix system to indicate the operational state:

Status Indicators

  • [MEMORY BANK: ACTIVE]: Memory Bank is available and providing context
  • [MEMORY BANK: INACTIVE]: Memory Bank is unavailable or not configured
  • [MEMORY BANK: UPDATING]: Memory Bank is being updated (e.g., during UMB use)

Benefits

  • Transparency on AI context awareness
  • Easy troubleshooting for configuration issues
  • Clear understanding of response context availability

This README provides all necessary information to install, use, and contribute to Memory Bank MCP.