Memory Bank MCP server

Structured documentation system that generates and maintains interconnected Markdown documents capturing project knowledge from high-level goals to technical details, with advanced search capabilities across all documents.
Back to servers
Setup instructions
Provider
tuncer-byte
Release date
Apr 15, 2025
Language
TypeScript
Stats
94 stars

Memory Bank MCP is a structured project knowledge management server that implements the Model Context Protocol (MCP). It creates and maintains interconnected Markdown documents for your projects, making all aspects of project knowledge accessible to AI agents and tools through a standardized interface.

Installation

To install Memory Bank MCP, follow these steps:

# Clone the repository
git clone https://github.com/tuncer-byte/memory-bank-mcp.git
cd memory-bank-mcp

# Install dependencies
npm install

# (Optional) Create .env file with your Gemini API key
echo "GEMINI_API_KEY=your_api_key_here" > .env

Running the Server

Memory Bank MCP is designed to run as an MCP server that interfaces with MCP-compatible clients.

Development Mode

npm run dev

Production Mode

npm run build
npm run start

MCP Integration

To connect Memory Bank MCP to your MCP client, add the following configuration to your mcp.json file:

{
  "memoryBank": {
    "command": "node",
    "args": ["/path/to/memory-bank-mcp/dist/index.js"],
    "env": {
      "GEMINI_API_KEY": "your_gemini_api_key_here"
    }
  }
}

Replace /path/to/memory-bank-mcp/dist/index.js with the absolute path to your built file, and include your Gemini API key if needed.

Available MCP Tools

Memory Bank MCP provides several tools that can be called via the MCP protocol:

Initialize Memory Bank

Creates a new Memory Bank structure with all document templates.

Parameters:

  • goal (string): Project goal description (min 10 characters)
  • geminiApiKey (string, optional): Gemini API key for document generation
  • location (string, optional): Absolute path where memory-bank folder will be created

Example:

await callTool({
  name: "initialize_memory_bank",
  arguments: {
    goal: "Building a self-documenting AI-powered software development assistant",
    location: "/Users/username/Documents/projects/ai-assistant"
  }
});

Update Document

Updates a specific document in the Memory Bank.

Parameters:

  • documentType (enum): One of: projectbrief, productContext, systemPatterns, techContext, activeContext, progress
  • content (string, optional): New content for the document
  • regenerate (boolean, default: false): Whether to regenerate the document using AI

Example:

await callTool({
  name: "update_document",
  arguments: {
    documentType: "projectbrief",
    content: "# Project Brief\n\n## Purpose\nTo develop an advanced and user-friendly AI..."
  }
});

Query Memory Bank

Searches across all documents with context-aware relevance ranking.

Parameters:

  • query (string): Search query (min 5 characters)

Example:

await callTool({
  name: "query_memory_bank",
  arguments: {
    query: "system architecture components"
  }
});

Export Memory Bank

Exports all Memory Bank documents.

Parameters:

  • format (enum, default: "folder"): Export format, either "json" or "folder"
  • outputPath (string, optional): Custom output path for the export

Example:

await callTool({
  name: "export_memory_bank",
  arguments: {
    format: "json",
    outputPath: "/Users/username/Documents/exports"
  }
});

Document Structure

Memory Bank organizes project knowledge into six core document types:

  1. Project Brief: Defines project objectives, scope, and vision
  2. Product Context: Documents product functionality from a user perspective
  3. System Patterns: Establishes system architecture and component relationships
  4. Tech Context: Specifies technology stack and implementation details
  5. Active Context: Tracks current tasks, open issues, and development focus
  6. Progress: Documents completed work, milestones, and project history

Each document type serves a specific purpose in maintaining comprehensive project knowledge that can be queried and utilized by AI agents through the MCP interface.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "memory-bank" '{"command":"node","args":["/path/to/memory-bank-mcp/dist/index.js"],"env":{"GEMINI_API_KEY":"your_gemini_api_key_here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "memory-bank": {
            "command": "node",
            "args": [
                "/path/to/memory-bank-mcp/dist/index.js"
            ],
            "env": {
                "GEMINI_API_KEY": "your_gemini_api_key_here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "memory-bank": {
            "command": "node",
            "args": [
                "/path/to/memory-bank-mcp/dist/index.js"
            ],
            "env": {
                "GEMINI_API_KEY": "your_gemini_api_key_here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later