Memory Bank MCP is a structured documentation system that helps teams create, manage, and access project knowledge through the Model Context Protocol. It generates and maintains interconnected Markdown documents capturing different aspects of your project, from high-level goals to technical details and daily progress.
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
# Create .env file with your Gemini API key (optional)
echo "GEMINI_API_KEY=your_api_key_here" > .env
# Start in development mode
npm run dev
# Build the project
npm run build
# Start in production mode
npm run start
To integrate Memory Bank with the Model Context Protocol, 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 index.js file, and add your Gemini API key if applicable.
{
"memoryBank": {
"command": "node",
"args": ["/Users/username/memory-bank-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "AIzaSyXXXXXXXXXXXXXXXXXXXXXXXX"
}
}
}
Memory Bank provides several tools via the Model Context Protocol:
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 generationlocation
(string, optional): Absolute path where memory-bank folder will be createdExample:
await callTool({
name: "initialize_memory_bank",
arguments: {
goal: "Building a self-documenting AI-powered software development assistant",
location: "/Users/username/Documents/projects/ai-assistant"
}
});
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 documentregenerate
(boolean, default: false): Whether to regenerate the document using AIExample:
await callTool({
name: "update_document",
arguments: {
documentType: "projectbrief",
content: "# Project Brief\n\n## Purpose\nTo develop an advanced and user-friendly AI..."
}
});
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"
}
});
Exports all Memory Bank documents.
Parameters:
format
(enum, default: "folder"): Export format, either "json" or "folder"outputPath
(string, optional): Custom output path for the exportExample:
await callTool({
name: "export_memory_bank",
arguments: {
format: "json",
outputPath: "/Users/username/Documents/exports"
}
});
Memory Bank organizes project knowledge into six core document types:
projectbrief.md
): Core document defining project objectives, scope, and visionproductContext.md
): Documents product functionality from a user perspectivesystemPatterns.md
): Establishes system architecture and component relationshipstechContext.md
): Specifies technology stack and implementation detailsactiveContext.md
): Tracks current tasks, open issues, and development focusprogress.md
): Documents completed work, milestones, and project historyThere 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.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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.
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.