memory-bank-mcp
by: movibe
MCP Server para gerenciar o Memory Bank
π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 π§
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:
- Use Memory Bank MCP with npx to avoid global installation:
npx @movibe/memory-bank-mcp --help
- Open Cursor Settings > Extensions > MCP
- Add MCP Server with:
- Name: Memory Bank MCP
- Command: npx
- Arguments:
@movibe/memory-bank-mcp --mode code
(or desired mode)
- Save and enable the MCP server
- 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
-
Code Mode π¨βπ»
Focus on code implementation and development.
Usage:npx @movibe/memory-bank-mcp --mode code
-
Architect Mode ποΈ
Focus on system design and architecture.
Usage:npx @movibe/memory-bank-mcp --mode architect
-
Ask Mode β
Focus on answering questions and providing information.
Usage:npx @movibe/memory-bank-mcp --mode ask
-
Debug Mode π
Focus on troubleshooting and problem-solving.
Usage:npx @movibe/memory-bank-mcp --mode debug
-
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
, andtest
modes.
Data Flow π
- AI assistant connects and initializes a Memory Bank
- Calls tools to read/write Memory Bank files
- 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.