Sponsored by Deepsite.site

Cline Memory Bank

Created By
dazeb9 months ago
A memory system for Cline that tracks progress between conversations. Avoid large token usage!
Content

Cline Memory Bank

A Model Context Protocol server that provides persistent project context management for AI-assisted development.

Table of Contents

Overview

The Memory Bank MCP server helps maintain consistent project context across development sessions by providing structured tools and resources for managing:

  • Project context and technical details
  • Current session state and tasks
  • Progress tracking and milestones
  • Technical decisions and rationale

Persistent Memory System

One of the most powerful features of this project is its ability to maintain context across different coding sessions. Think of it as giving your AI assistant a "memory" that doesn't forget what you've been working on, even when you close VSCode and come back later.

How It Works

Imagine you're working on a complex project that spans multiple days or weeks. Normally, each time you start a new coding session, you'd need to re-explain your project's context to the AI assistant. With the Memory Bank:

  • Your AI assistant remembers previous discussions and decisions
  • Maintains understanding of your project's architecture and goals
  • Keeps track of ongoing tasks and progress
  • Remembers your coding preferences and project conventions

Key Benefits

  1. Continuity Across Sessions

    • No need to re-explain your project every time
    • Pick up exactly where you left off
    • Maintains consistent understanding of your codebase
  2. Smart Context Management

    • Automatically tracks important technical decisions
    • Records project progress and milestones
    • Maintains documentation of your development journey
  3. Enhanced Productivity

    • Faster project onboarding for each session
    • More consistent and contextual AI assistance
    • Reduces repetitive explanations
  4. Project History

    • Keeps track of why certain decisions were made
    • Maintains a log of completed features and changes
    • Helps new team members understand project evolution

The Memory Bank seamlessly integrates with the Cline VSCode Extension, requiring no additional setup from you once configured. It works quietly in the background, ensuring your AI assistant always has the context it needs to provide relevant and helpful assistance.

Installation

Prerequisites

  • Node.js (v16 or later)
  • VS Code with Cline extension installed
  • TypeScript (for development)

Setup Steps

  1. Clone and build the server:
# Clone the repository
git clone https://github.com/dazeb/cline-memory-bank
cd cline-memory-bank

# Install dependencies
npm install

# Build the server
npm run build

# Make globally available (optional)
npm link
  1. Configure Cline Extension:

Add the following to your Cline MCP settings (~/.config/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):

{
  "mcpServers": {
    "memory-bank": {
      "command": "node",
      "args": [
        "/path/to/memory-bank-server/build/index.js"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Replace /path/to/memory-bank-server with the actual path to your server installation.

Features

Tools

  1. initialize_memory_bank

    • Creates Memory Bank structure for a new project
    • Creates required markdown files with initial templates
    use_mcp_tool('memory-bank', 'initialize_memory_bank', {
      projectPath: '/path/to/project'
    });
    
  2. update_context

    • Updates active context with current session information
    • Tracks mode, tasks, and session state
    use_mcp_tool('memory-bank', 'update_context', {
      projectPath: '/path/to/project',
      content: {
        currentSession: {
          date: '2025-03-13',
          mode: 'development',
          task: 'Implementing new feature'
        }
      }
    });
    
  3. record_decision

    • Records technical decisions with rationale
    • Maintains history of architectural choices
    use_mcp_tool('memory-bank', 'record_decision', {
      projectPath: '/path/to/project',
      decision: {
        title: 'Authentication System',
        description: 'Implementing JWT-based authentication',
        rationale: 'Better scalability and stateless operation',
        alternatives: [
          'Session-based auth',
          'OAuth only'
        ]
      }
    });
    
  4. track_progress

    • Updates project progress and milestones
    • Manages task status and blockers
    use_mcp_tool('memory-bank', 'track_progress', {
      projectPath: '/path/to/project',
      progress: {
        completed: ['Setup project', 'Initialize database'],
        inProgress: ['Implement auth', 'Create API routes'],
        blocked: ['Deploy to production']
      }
    });
    

Resources

  1. memory://project/context

    • Project overview and technical stack
    • Architecture principles and guidelines
  2. memory://active/context

    • Current session state and tasks
    • Active considerations and notes
  3. memory://progress

    • Project milestones and task tracking
    • Work status and blockers
  4. memory://decisions

    • Technical decisions and rationale
    • Architecture choices and alternatives

System Prompt Suggestion

Add to Cline system prompt under settings.

Before proceeding with any task:
1. Check active context (memory://active/context) to understand:
   - Current project state
   - Ongoing tasks
   - Recent decisions

2. Review project context (memory://project/context) for:
   - Technical stack details
   - Project guidelines
   - Architecture decisions

3. Consult decision log (memory://decisions) when:
   - Making architectural choices
   - Implementing new features
   - Modifying existing patterns

4. Update progress tracking (memory://progress):
   - Mark completed items
   - Add new in-progress tasks
   - Note blocked items

Key Rules:
- Always check memory bank before starting new tasks
- Record significant technical decisions with rationale
- Keep active context updated with current work
- Track progress changes in real-time
- Reference previous decisions when making related changes

File Structure

When initialized, the Memory Bank creates the following structure in your project:

project-root/
└── memory-bank/
    ├── projectContext.md    # Technical stack and guidelines
    ├── activeContext.md     # Current session state
    ├── progress.md         # Project progress tracking
    └── decisionLog.md      # Technical decisions

Using with Cline

Simply ask Cline to initialize the memory bank.

  1. Initialize a new Memory Bank:

    use_mcp_tool('memory-bank', 'initialize_memory_bank', {
      projectPath: process.cwd()  // or specific path
    });
    
  2. Access project context:

    access_mcp_resource('memory-bank', 'memory://project/context');
    
  3. Update session context:

    use_mcp_tool('memory-bank', 'update_context', {
      projectPath: process.cwd(),
      content: {
        currentSession: {
          date: new Date().toISOString().split('T')[0],
          mode: 'development',
          task: 'Current task description'
        }
      }
    });
    
  4. Record technical decisions:

    use_mcp_tool('memory-bank', 'record_decision', {
      projectPath: process.cwd(),
      decision: {
        title: 'Decision Title',
        description: 'What was decided',
        rationale: 'Why it was decided'
      }
    });
    

Development

To modify or enhance the server:

  1. Update source in src/index.ts
  2. Run tests: npm test
  3. Build: npm run build
  4. Restart Cline extension to load changes

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT © dazeb

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Tavily Mcp
DeepChatYour AI Partner on Desktop