Logo Memory Bank

Memory Bank

Cộng đồng
movibe

MCP Server para gerenciar o Memory Bank

Nhà phát hànhmovibe
Kho mãmemory-bank-mcp
Ngôn ngữTypeScript
Bản fork
12
Sao
46
Công cụ có sẵn
15
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Memory Bank cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 15 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    46 sao và 12 bản fork từ kho mã được liên kết.

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 a set of 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. When you specify a project path using the --path option, the Memory Bank will be created or accessed at <project_path>/memory-bank.

You can customize the name of the Memory Bank folder using the --folder option. For example, if you set --folder custom-memory, the Memory Bank will be created or accessed at <project_path>/custom-memory.

For more details on customizing the folder name, see Custom Memory Bank Folder Name.

Recent Improvements 🛠️

  • Customizable Folder Name: You can now specify a custom folder name for the Memory Bank
  • Consistent Directory Structure: Memory Bank now always uses the configured folder name in the project root
  • Enhanced Initialization: Memory Bank now works even when .clinerules files don't exist
  • Better Path Handling: Improved handling of absolute and relative paths
  • Improved Directory Detection: Better detection of existing memory-bank directories
  • More Robust Error Handling: Graceful handling of errors related to .clinerules files

For more details, see Memory Bank Bug Fixes.

Installation 🚀

bash
# 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 💻

You can run Memory Bank MCP directly without installation using npx:

bash
# 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

For more detailed information about using npx, see npx-usage.md.

Configuring in Cursor 🖱️

Cursor is an AI-powered code editor that supports the Model Context Protocol (MCP). To configure Memory Bank MCP in Cursor:

  1. Use Memory Bank MCP with npx:

    No need to install the package globally. You can use npx directly:

    bash
    # Verify npx is working correctly
    npx @movibe/memory-bank-mcp --help
  2. Open Cursor Settings:

    • Go to Settings (⚙️) > Extensions > MCP
    • Click on "Add MCP Server"
  3. Configure the MCP Server:

    • Name: Memory Bank MCP
    • Command: npx
    • Arguments: @movibe/memory-bank-mcp --mode code (or other mode as needed)
  4. Save and Activate:

    • Click "Save"
    • Enable the MCP server by toggling it on
  5. Verify Connection:

    • Open a project in Cursor
    • The Memory Bank MCP should now be active and available in your AI interactions

For detailed instructions and advanced usage with Cursor, see cursor-integration.md.

Using with Cursor 🤖

Once configured, you can interact with Memory Bank MCP in Cursor through 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 different operational modes to optimize AI interactions for specific tasks:

Available Modes

  1. Code Mode 👨‍💻

    • Focus: Code implementation and development
    • Usage: npx @movibe/memory-bank-mcp --mode code
    • Best for: Writing, refactoring, and optimizing code
  2. Architect Mode 🏗️

    • Focus: System design and architecture
    • Usage: npx @movibe/memory-bank-mcp --mode architect
    • Best for: Planning project structure, designing components, and making architectural decisions
  3. Ask Mode ❓

    • Focus: Answering questions and providing information
    • Usage: npx @movibe/memory-bank-mcp --mode ask
    • Best for: Getting explanations, clarifications, and information
  4. Debug Mode 🐛

    • Focus: Troubleshooting and problem-solving
    • Usage: npx @movibe/memory-bank-mcp --mode debug
    • Best for: Finding and fixing bugs, analyzing issues
  5. Test Mode ✅

    • Focus: Testing and quality assurance
    • Usage: npx @movibe/memory-bank-mcp --mode test
    • Best for: Writing tests, test-driven development

Switching Modes

You can switch modes in several ways:

  1. When starting the server:

    bash
    npx @movibe/memory-bank-mcp --mode architect
  2. During a session:

    bash
    memory-bank-mcp switch_mode mode=debug
  3. In Cursor:

    /mcp memory-bank-mcp switch_mode mode=test
  4. Using .clinerules files: Create a .clinerules-[mode] file in your project to automatically switch to that mode when the file is detected.

How Memory Bank MCP Works 🧠

Memory Bank MCP is built on the Model Context Protocol (MCP), which enables AI assistants to interact with external tools and resources. Here's how it works:

Core Components 🧩

  1. Memory Bank: A structured repository of information stored as markdown files:

    • product-context.md: Overall project information and goals
    • active-context.md: Current state, ongoing tasks, and next steps
    • progress.md: History of project updates and milestones
    • decision-log.md: Record of important decisions with context and rationale
    • system-patterns.md: Architecture and code patterns used in the project
  2. MCP Server: Provides tools and resources for AI assistants to interact with Memory Banks:

    • Runs as a standalone process
    • Communicates with AI assistants through the MCP protocol
    • Provides a set of tools for managing Memory Banks
  3. Mode System: Supports different operational modes:

    • code: Focus on code implementation
    • ask: Focus on answering questions
    • architect: Focus on system design
    • debug: Focus on debugging issues
    • test: Focus on testing

Data Flow 🔄

  1. Initialization: The AI assistant connects to the MCP server and initializes a Memory Bank
  2. Tool Calls: The AI assistant calls tools provided by the MCP server to read/write Memory Bank files
  3. Context Maintenance: The Memory Bank maintains context across sessions, allowing the AI to recall previous decisions and progress

Memory Bank Structure 📂

Memory Banks use a standardized structure to organize information:

  • Product Context: Project overview, objectives, technologies, and architecture
  • Active Context: Current state, ongoing tasks, known issues, and next steps
  • Progress: Chronological record of project updates and milestones
  • Decision Log: Record of important decisions with context, alternatives, and consequences
  • System Patterns: Architecture patterns, code patterns, and documentation patterns

Advanced Features 🚀

  • UMB Command: Temporarily update Memory Bank files during a session without committing changes
  • Mode Detection: Automatically detect and switch modes based on user input
  • File Migration: Tools for migrating between different file naming conventions
  • Language Standardization: All Memory Bank files are generated in English for consistency

Versioning 📌

This project follows Semantic Versioning and uses Conventional Commits for commit messages. The version is automatically bumped and a changelog is generated based on commit messages when changes are merged into the main branch.

  • Major version is bumped when there are breaking changes (commit messages with BREAKING CHANGE or !:)
  • Minor version is bumped when new features are added (commit messages with feat: or feat(scope):)
  • Patch version is bumped for all other changes (bug fixes, documentation, etc.)

For the complete history of changes, see the CHANGELOG.md file.

Usage 📝

As a Command Line Tool 💻

bash
# Initialize a Memory Bank
memory-bank-mcp initialize_memory_bank path=./memory-bank

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

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

# Switch mode
memory-bank-mcp switch_mode mode=code

As a Library 📚

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

// Create a new server instance
const server = new MemoryBankServer();

// Start the server
server.run().catch(console.error);

Contributing 👥

Please see CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

Memory Bank Status System 🚦

Memory Bank MCP implements a status prefix system that provides immediate visibility into the operational state of the Memory Bank:

Status Indicators

Every response from an AI assistant using Memory Bank MCP begins with one of these status indicators:

  • [MEMORY BANK: ACTIVE]: The Memory Bank is available and being used to provide context-aware responses
  • [MEMORY BANK: INACTIVE]: The Memory Bank is not available or not properly configured
  • [MEMORY BANK: UPDATING]: The Memory Bank is currently being updated (during UMB command execution)

This system ensures users always know whether the AI assistant is operating with full context awareness or limited information.

Benefits

  • Transparency: Users always know whether the AI has access to the full project context
  • Troubleshooting: Makes it immediately obvious when Memory Bank is not properly configured
  • Context Awareness: Helps users understand why certain responses may lack historical context

For more details, see Memory Bank Status Prefix System.

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "Memory Bank MCP": {
      "command": "npx",
      "args": [
        "-y",
        "@movibe/memory-bank-mcp",
        "--mode",
        "code"
      ]
    }
  }
}

Công cụ có sẵn

  • initialize_memory_bank

    Initialize a Memory Bank in the specified directory

  • set_memory_bank_path

    Set a custom path for the Memory Bank

  • debug_mcp_config

    Debug the current MCP configuration

  • read_memory_bank_file

    Read a file from the Memory Bank

  • write_memory_bank_file

    Write to a Memory Bank file

  • list_memory_bank_files

    List Memory Bank files

  • get_memory_bank_status

    Check Memory Bank status

  • migrate_file_naming

    Migrate Memory Bank files from camelCase to kebab-case naming convention

  • track_progress

    Track progress and update Memory Bank files

  • update_active_context

    Update the active context file

  • log_decision

    Log a decision in the decision log

  • switch_mode

    Switches to a specific mode

  • get_current_mode

    Gets information about the current mode

  • process_umb_command

    Processes the Update Memory Bank (UMB) command

  • complete_umb

    Completes the Update Memory Bank (UMB) process

Dùng MCP Memory Bank với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Memory Bank, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Memory Bank làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Memory Bank.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "memory-bank": {
      "command": "npx",
      "args": [
        "-y",
        "@movibe/memory-bank-mcp"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Memory Bank, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Memory Bank.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Memory Bank giúp tôi làm việc này không?
Memory Bank
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Memory Bank.

Câu hỏi thường gặp

Máy chủ MCP Memory Bank dùng để làm gì?

Memory Bank là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Memory Bank với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Memory Bank với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Memory Bank với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Memory Bank, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Memory Bank với TypingMind?

Memory Bank hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Memory Bank cung cấp những công cụ nào trong TypingMind?

Memory Bank cung cấp 15 công cụ MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Memory Bank không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Memory Bank yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇