MCP Hub
Back to servers

memory-bank-mcp

An MCP server that gives AI assistants persistent memory across sessions. It stores project context, decisions, and progress in structured markdown files as well as a knowledge graph and sequential thinking for better memory storage.

glama
Forks
1
Updated
Mar 1, 2026

Memory Bank MCP

NPM Version Semgrep CE scan License: MIT

An MCP server that gives AI assistants persistent memory across sessions. It stores project context, decisions, and progress in structured markdown files — locally or on a remote server via SSH.

Related repos:

Quick Start

# Run directly (no install needed)
npx @diazstg/memory-bank-mcp

# Or install globally
npm install -g @diazstg/memory-bank-mcp

Via Smithery (Claude Desktop)

npx -y @smithery/cli install @diazstg/memory-bank-mcp --client claude

Configuration

Add to your editor's MCP config (.vscode/mcp.json, Cursor, Claude Desktop, etc.):

{
  "servers": {
    "memory-bank-mcp": {
      "command": "npx",
      "args": ["-y",
          "@diazstg/memory-bank-mcp",
          "--username",
          "your-username"
      ],
      "type": "stdio"
    }
  }
}

Tip: Including --username is highly recommended for proper progress tracking.

Common Options

npx @diazstg/memory-bank-mcp --username "github-user"   # Username for progress tracking (recommended)
npx @diazstg/memory-bank-mcp --mode code                # Set operational mode
npx @diazstg/memory-bank-mcp --path /my/project         # Custom project path
npx @diazstg/memory-bank-mcp --folder my-memory         # Custom folder name (default: memory-bank)
npx @diazstg/memory-bank-mcp --help                     # All options

Remote Server (SSH)

Store your Memory Bank on a remote server:

npx @diazstg/memory-bank-mcp --remote \
  --remote-user username \
  --remote-host example.com \
  --remote-path /home/username/memory-bank \
  --ssh-key ~/.ssh/id_ed25519

See Remote Server Guide.

How It Works

Memory Bank stores project context as markdown files in a memory-bank/ directory:

FilePurpose
product-context.mdProject overview, goals, tech stack
active-context.mdCurrent state, ongoing tasks, next steps
progress.mdChronological record of updates
decision-log.mdDecisions with context and rationale
system-patterns.mdArchitecture and code patterns

The AI assistant reads these files at the start of each session and updates them as work progresses, maintaining continuity across conversations.

MCP Tools

ToolDescription
initialize_memory_bankCreate a new Memory Bank
get_memory_bank_statusCheck current status
read_memory_bank_fileRead a specific file
write_memory_bank_fileWrite/update a file
track_progressAdd a progress entry
log_decisionRecord a decision
update_active_contextUpdate current context
switch_modeChange operational mode
graph_upsert_entityCreate or update a knowledge graph entity
graph_add_observationAdd an observation to an entity
graph_link_entitiesCreate a relation between entities
graph_searchSearch entities by name or type
graph_open_nodesGet full details of specific entities
graph_compactCompact the event log

Modes

ModeFocus
codeImplementation and development
architectSystem design and planning
askQ&A and information retrieval
debugTroubleshooting and diagnostics
testTesting and quality assurance

Modes can be set via CLI (--mode code), tool call (switch_mode), or .mcprules-[mode] files. See Usage Modes.

As a Library

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

const server = new MemoryBankServer();
server.run().catch(console.error);

Documentation

TopicLink
Getting Startednpx usage, build with Bun, custom folder
GuidesRemote server, usage modes, status system, debug MCP
IntegrationsVS Code/Copilot, Claude Code, Cursor, Cline, Roo Code, generic MCP
ReferenceMCP protocol, rules format, file naming
DevelopmentArchitecture, testing, logging

Alternative: HTTP + PostgreSQL + Redis

The feature/http-postgres-redis-supabase branch provides a cloud-native variant that replaces stdio/local-filesystem with HTTP Streamable MCP transport, PostgreSQL (via Supabase) for storage, and Redis for caching. It is deployed exclusively via Docker and is not published to npm. See the branch README for setup instructions.

Contributing

See CONTRIBUTING.md.

License

See LICENSE.

Reviews

No reviews yet

Sign in to write a review