memory bank mcp
Memory bank with Server as SSH support for central knowledge base
Memory bank with Server as SSH support for central knowledge base
A Model Context Protocol (MCP) server for managing Memory Banks, allowing AI assistants to store and retrieve information across sessions. Now with remote server support!
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.
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.
For more details, see Memory Bank Bug Fixes.
# Install from npm
npm install @aakarsh-sasi/memory-bank-mcp
# Or install globally
npm install -g @aakarsh-sasi/memory-bank-mcp
# Or run directly with npx (no installation required)
npx @aakarsh-sasi/memory-bank-mcp
You can run Memory Bank MCP directly without installation using npx:
# Run with default settings
npx @aakarsh-sasi/memory-bank-mcp
# Run with specific mode
npx @aakarsh-sasi/memory-bank-mcp --mode code
# Run with custom project path
npx @aakarsh-sasi/memory-bank-mcp --path /path/to/project
# Run with custom folder name
npx @aakarsh-sasi/memory-bank-mcp --folder custom-memory-bank
# Run with remote server
npx @aakarsh-sasi/memory-bank-mcp --remote --remote-user username --remote-host example.host.com --remote-path /home/username/memory-bank
# Show help
npx @aakarsh-sasi/memory-bank-mcp --help
For more detailed information about using npx, see npx-usage.md.
Memory Bank MCP now supports storing your Memory Bank on a remote server via SSH. This allows you to:
To set up SSH key authentication for the remote server:
# Using modern Ed25519 algorithm (recommended)
ssh-keygen -t ed25519 -C "[email protected]"
# OR using RSA if required for compatibility
ssh-keygen -t rsa -b 4096 -C "[email protected]"
# Start the agent
eval "$(ssh-agent -s)"
# Add your key
ssh-add ~/.ssh/id_ed25519 # or ~/.ssh/id_rsa if you used RSA
# Easiest method (if available)
ssh-copy-id [email protected]
# Alternative: manually copy your public key
cat ~/.ssh/id_ed25519.pub # copy the output
Then paste the key into the ~/.ssh/authorized_keys
file on the remote server.
ssh [email protected]
You should be able to log in without a password.
For more detailed SSH key setup instructions, see our SSH Keys Guide.
To use remote server mode, you need to provide the following parameters:
npx @aakarsh-sasi/memory-bank-mcp --remote
--ssh-key ~/.ssh/your_ssh_key
--remote-user username
--remote-host example.host.com
--remote-path /home/username/memory-bank
By default, the SSH key is assumed to be at ~/.ssh/your_ssh_key
. You can specify a different key using the --ssh-key
option.
# Using with a server at example.host.com
npx @aakarsh-sasi/memory-bank-mcp --remote
--remote-user username
--remote-host example.host.com
--remote-path /home/username/memory-bank
Cursor is an AI-powered code editor that supports the Model Context Protocol (MCP). To configure Memory Bank MCP in Cursor:
No need to install the package globally. You can use npx directly:
# Verify npx is working correctly
npx @aakarsh-sasi/memory-bank-mcp --help
Open Cursor Settings:
Go to Settings (⚙️) > Extensions > MCP
Click on "Add MCP Server"
Configure the MCP Server:
Name: Memory Bank MCP
@aakarsh-sasi/memory-bank-mcp --mode code
(or other mode as needed)For remote server:
- Arguments: @aakarsh-sasi/memory-bank-mcp --mode code --remote --remote-user username --remote-host example.host.com --remote-path /home/username/memory-bank
Save and Activate:
Click "Save"
Enable the MCP server by toggling it on
Verify Connection:
For detailed instructions and advanced usage with Cursor, see cursor-integration.md.
Once configured, you can interact with Memory Bank MCP in Cursor through AI commands:
/mcp memory-bank-mcp initialize_memory_bank path=./memory-bank
/mcp memory-bank-mcp track_progress action="Feature Implementation" description="Implemented feature X"
/mcp memory-bank-mcp log_decision title="API Design" context="..." decision="..."
/mcp memory-bank-mcp switch_mode mode=code
Memory Bank MCP supports different operational modes to optimize AI interactions for specific tasks:
Code Mode ??
Focus: Code implementation and development
npx @aakarsh-sasi/memory-bank-mcp --mode code
Best for: Writing, refactoring, and optimizing code
Architect Mode ?️
Focus: System design and architecture
npx @aakarsh-sasi/memory-bank-mcp --mode architect
Best for: Planning project structure, designing components, and making architectural decisions
Ask Mode ❓
Focus: Answering questions and providing information
npx @aakarsh-sasi/memory-bank-mcp --mode ask
Best for: Getting explanations, clarifications, and information
Debug Mode ?
Focus: Troubleshooting and problem-solving
npx @aakarsh-sasi/memory-bank-mcp --mode debug
Best for: Finding and fixing bugs, analyzing issues
Test Mode ✅
npx @aakarsh-sasi/memory-bank-mcp --mode test
You can switch modes in several ways:
npx @aakarsh-sasi/memory-bank-mcp --mode architect
memory-bank-mcp switch_mode mode=debug
/mcp memory-bank-mcp switch_mode mode=test
.clinerules-[mode]
file in your project to automatically switch to that mode when the file is detected.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:
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 stepsprogress.md
: History of project updates and milestonesdecision-log.md
: Record of important decisions with context and rationalesystem-patterns.md
: Architecture and code patterns used in the project
MCP Server: Provides tools and resources for AI assistants to interact with Memory Banks:
Runs as a standalone process
Provides a set of tools for managing Memory Banks
Mode System: Supports different operational modes:
code
: Focus on code implementationask
: Focus on answering questionsarchitect
: Focus on system designdebug
: Focus on debugging issuestest
: Focus on testingMemory Banks use a standardized structure to organize information:
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.
BREAKING CHANGE
or !:
)feat:
or feat(scope):
)For the complete history of changes, see the CHANGELOG.md file.
# 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
import { MemoryBankServer } from "@aakarsh-sasi/memory-bank-mcp";
// Create a new server instance
const server = new MemoryBankServer();
// Start the server
server.run().catch(console.error);
Please see CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Memory Bank MCP implements a status prefix system that provides immediate visibility into the operational state of the Memory Bank:
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.
For more details, see Memory Bank Status Prefix System.