This project implements the core functionality of the Roo Code Memory Bank system as a Model Context Protocol (MCP) server. It allows AI assistants to maintain project context across sessions by interacting with a file-based memory bank using structured MCP tools.
This MCP server provides the following tools:
read_memory_bank: When called without thefile_namesargument (or with an empty array), this tool lists available.mdfiles in the memory bank directory. When an array offile_namesis provided, it reads and returns the content of each specified file.- Input:
{ "file_names"?: string[] } - Output:
{ "content": Array<{ type: string; text: string }> }wheretextis a JSON string:{ "files": string[] }(for listing files) or{ "files": { [fileName: string]: string | null } }(for reading specific files).
- Input:
append_memory_bank: Appends one or more timestamped entries to specified memory bank files, optionally under specific markdown headers. Each entry can target a different file.- Input:
{ "entries": Array<{ "file_name": string, "entry": string, "section_header"?: string }> } - Output:
{ "content": Array<{ type: string; text: string }> }wheretextis a JSON string:{ "results": Array<{ file: string; status: string; message: string }> }.
- Input:
- Node.js (v18 or later recommended)
- npm (usually included with Node.js)
- An MCP client environment (like the one used by Cline) capable of managing and launching MCP servers.
- Clone the repository:
git clone https://github.com/IncomeStreamSurfer/roo-code-memory-bank-mcp-server.git cd roo-code-memory-bank-mcp-server - Install dependencies:
npm install
- Build the project:
This compiles the TypeScript code into JavaScript in the
npm run build
dist/directory.
To make this server available to your AI assistant (like Cline), you need to add its configuration to your MCP settings file (e.g., cline_mcp_settings.json).
Find the mcpServers object in your settings file and add the following entry:
{
"mcpServers": {
// ... other server configurations ...
"roo-code-memory-bank-mcp": {
"autoApprove": [
"read_memory_bank",
"append_memory_bank"
],
"disabled": false,
"timeout": 60,
"command": "node", // Or "cmd.exe" with "/c node ..." on Windows if needed
"args": [
// IMPORTANT: Replace this path with the actual absolute path
// to the compiled index.js file on your system
"/path/to/your/cloned/repo/roo-code-memory-bank-mcp-server/dist/index.js"
],
"env": {},
"transportType": "stdio"
}
// ... other server configurations ...
}
}Important: Replace /path/to/your/cloned/repo/ with the correct absolute path to where you cloned the repository on your machine. Ensure the path separator is correct for your operating system (e.g., use backslashes \ on Windows).
You don't typically need to run the server manually. The MCP client (like Cline) will automatically start the server using the command and args specified in the configuration file when one of its tools is called for the first time.
If you want to test it manually, you can run npm start from the project directory.
The AI assistant interacts with the server using the defined tools. The typical workflow involves:
- Reading relevant files (
read_memory_bank) to gain context. - Appending entries (
append_memory_bank) as decisions are made or progress occurs.
The memory-bank/ directory will be created in the same directory where the server process is started (which should be the root of this project directory when launched via the MCP client configuration).
Set these instructions inside Roo
You must use MCPs where needed
I have a specific MCP flow:
Use context7 to find any relevant documentation pieces you will need for this process, ensure to feed any relevant knoweldege to any relevant subtasks - use context7 at all times to do research on important documentation if you're unsure of something Use google maps mcp in order to search for + - this will allow us to find the basic businesses we need to accomplish our task Use brave search mcp to find URLs to scrape Use fetch mcp with fetch_txt and fetch_markdown to find text and images on pages in order to convert into JSON files and create something in-depth Use openrouter search to find general sentiment of topics, reviews, etc.
Utilize the roo-code-memory-bank-mcp server to maintain project context:
- At the start of a task or significant subtask, use
read_memory_bankfor relevant files (e.g.,productContext.md,activeContext.md) to load the current project context. - Incorporate this loaded context into your planning and execution.
- When making significant decisions, progress updates, or architectural changes, use
append_memory_bankto record the information in the appropriate file (decisionLog.md,progress.md, etc.), ensuring context persistence.