MCP Hub
Back to servers

thinking-memory-bank

A specialized MCP server that integrates the RooCode Memory Bank pattern with Sequential Thinking to provide persistent project context and structured reasoning.

Tools
4
Updated
Jan 10, 2026

Quick Install

npx -y thinking-memory-bank

Thinking Memory Bank MCP Server

A custom MCP server that combines the 'RooCode Memory Bank' pattern with the 'Sequential Thinking' methodology to provide structured context persistence with dynamic reasoning capabilities.

Overview

The Thinking Memory Bank MCP server is a specialized implementation that integrates two powerful paradigms:

  1. RooCode Memory Bank: A structured approach to maintaining project context across sessions using specialized Markdown files organized in a consistent structure.

  2. Sequential Thinking: A step-by-step reasoning methodology that breaks down complex problems into manageable thoughts that can be revised, branched, and extended dynamically.

By combining these approaches, the server provides AI assistants with:

  • Persistent context storage organized in a structured format
  • Reasoning capabilities that can leverage and update this context
  • Specialized tools for initializing, updating, and querying memory
  • Integration of sequential thinking with memory operations

Installation

For Users

Once published to npm, install via npx (no installation required):

npx thinking-memory-bank

For Development

# Clone the repository
git clone https://github.com/herdeybayor/thinking-memory-bank.git
cd thinking-memory-bank

# Install dependencies
npm install

# Build the project
npm run build

Publishing to npm

If you want to publish your own version, see PUBLISHING.md for a complete guide.

Usage

Starting the Server

The MCP server can be started using the following command:

npm start

This will launch the server on stdio, ready to receive MCP protocol messages.

MCP Tool Usage

The server provides the following MCP tools:

Initialize Memory Bank

Creates the memory bank structure for a new project:

{
  "toolName": "initialize_memory_bank",
  "params": {
    "projectName": "My Project",
    "projectDescription": "A description of my project",
    "initialContext": "Additional context information"
  }
}

Update Memory

Updates a specific memory file with new information:

{
  "toolName": "update_memory",
  "params": {
    "memoryType": "activeContext",
    "content": "New information to add",
    "operation": "append",
    "reason": "Adding current session goals"
  }
}

Query Memory

Retrieves relevant information from memory:

{
  "toolName": "query_memory",
  "params": {
    "query": "What are the project goals?",
    "memoryTypes": ["productContext", "activeContext"]
  }
}

Sequential Thinking

Performs a step in a sequential thinking process with optional memory integration:

{
  "toolName": "sequential_thinking",
  "params": {
    "thought": "First, we need to understand the requirements...",
    "thoughtNumber": 1,
    "totalThoughts": 5,
    "nextThoughtNeeded": true,
    "contextQuery": "What are the current requirements?",
    "updateMemory": true
  }
}

Architecture

The Thinking Memory Bank combines several components:

┌─────────────────────────┐
│   MCP Server Interface  │
└───────────┬─────────────┘
            │
            ▼
┌─────────────────────────┐
│      Tool Handlers      │
└───────┬───────────┬─────┘
        │           │
        ▼           ▼
┌───────────┐  ┌───────────┐
│  Memory   │  │ Thinking  │
│  Manager  │  │  Engine   │
└───────────┘  └───────────┘

Memory Bank Structure

The memory bank is organized with the following files:

  • activeContext.md: Current session state and goals
  • productContext.md: Overall project knowledge and context
  • decisionLog.md: Record of decisions and their rationale
  • progress.md: Documentation of completed work and future tasks
  • systemPatterns.md: Recurring patterns and standards in the project

Memory Operations

Three operations are supported for memory updates:

  • Append: Add new content to the end of a file
  • Replace: Completely replace a file's content
  • Merge: Intelligently update specific sections of a file

Development

Project Structure

src/
├── index.ts              # Main entry point
├── memory/               # Memory management
│   ├── memory-manager.ts # Memory file operations
│   └── memory-manager.test.ts
├── thinking/             # Sequential thinking
│   └── thinking-engine.ts
├── tools/                # MCP tool definitions
│   ├── tool-definitions.ts
│   ├── tool-handlers.ts
│   └── tool-handlers.test.ts
├── types/                # Type definitions
│   └── memory.ts
└── mcp/                  # MCP server implementation
    └── mock-mcp-sdk.ts   # Mock SDK implementation

Testing

Run the test suite with:

npm test

References

This project is based on the following:

Using with Roo Code

The Thinking Memory Bank MCP server is designed to integrate smoothly with Roo Code. Here's how to set it up:

1. Configuration in VS Code

Add the following to your VS Code mcp.json configuration file:

Option A: Using Published npm Package (Recommended)

{
  "servers": {
    "thinking-memory-bank": {
      "command": "npx",
      "args": ["-y", "thinking-memory-bank"]
    }
  }
}

Option B: Using Local Development Version

{
  "servers": {
    "thinking-memory-bank": {
      "command": "node",
      "args": ["/absolute/path/to/thinking-memory-bank/dist/index.js"]
    }
  }
}

You can open this file through:

  • Command Palette (Ctrl+Shift+P) → "MCP: Open User Configuration"
  • Or add it to .vscode/mcp.json in your workspace

2. Interacting with Memory Bank in Roo Code

Once configured, you can use the Memory Bank tools within your Roo Code conversations:

Initializing a Memory Bank

When starting a new project:

I'd like to initialize a memory bank for this project. It's a React application for managing inventory.

Roo will use the initialize_memory_bank tool to create the memory structure.

Updating Memory

To explicitly update memory with specific information:

Please update our project context with this information: The application needs to support both desktop and mobile views, with responsive design principles.

Retrieving Context

To have Roo utilize previously stored knowledge:

What were our design decisions regarding the state management approach?

Roo will use the query_memory tool to retrieve this information.

Sequential Thinking with Memory

For complex problems requiring step-by-step analysis:

Let's work through how to implement the authentication flow, considering the security requirements we established earlier.

Roo will combine sequential thinking with memory queries to provide context-aware reasoning.

3. Memory Bank Maintenance

You can explicitly manage the memory bank with commands like:

UMB (Update Memory Bank) - Used to manually trigger memory updates
Review memory - View the contents of specific memory files

4. Best Practices

  • Initialize the memory bank at the start of a project
  • Periodically review memory contents to ensure accuracy
  • Use explicit memory update requests for crucial information
  • Let sequential thinking handle routine updates automatically

License

MIT

Reviews

No reviews yet

Sign in to write a review