You signed in with another tab or window. Reload
to refresh your session. You signed out in another tab or window. Reload
to refresh your session. You switched accounts on another tab or window. Reload
to refresh your session. Dismiss alert
t3ta / memory-bank-mcp-server Public
7 stars
0 forks
Branches
Tags
Activity
Notifications
You must be signed in to change notification settings
develop
Go to file
Code
| Name | | Name | Last commit message | Last commit date |
| --- | --- | --- | --- |
| Latest commit
-------------
History
-------
395 Commits
| | |
| .github | | .github | | |
| .husky | | .husky | | |
| debug-tools/bin | | debug-tools/bin | | |
| docs | | docs | | |
| scripts | | scripts | | |
| src | | src | | |
| tests | | tests | | |
| .clinerules | | .clinerules | | |
| .dockerignore | | .dockerignore | | |
| .gitignore | | .gitignore | | |
| .prettierignore | | .prettierignore | | |
| .prettierrc | | .prettierrc | | |
| .tool-versions | | .tool-versions | | |
| LICENSE | | LICENSE | | |
| README.md | | README.md | | |
| eslint.config.js | | eslint.config.js | | |
| jest.config.ts | | jest.config.ts | | |
| package-lock.json | | package-lock.json | | |
| package.json | | package.json | | |
| script.js | | script.js | | |
| tsconfig.esm.json | | tsconfig.esm.json | | |
| tsconfig.json | | tsconfig.json | | |
| tsconfig.test.json | | tsconfig.test.json | | |
| yarn.lock | | yarn.lock | | |
| View all files | | |
A Memory Bank implementation for managing project documentation and context across sessions. This server helps Claude maintain consistent project knowledge through global and branch-specific memory banks. Version 2.2.1 enhances JSON Patch support and adds workspace options along with numerous improvements.
This project is inspired by Cline Memory Bank
from the nickbaumann98/cline_docs
repository, which provides an excellent foundation for managing Claude's memory in software projects.
npx memory-bank-mcp-server
With options:
npx memory-bank-mcp-server --language ja --verbose
If you prefer to install globally:
npm install -g memory-bank-mcp-server
memory-bank-mcp-server --help
The package also includes a CLI tool for direct memory bank operations from your terminal.
npx memory-bank read-global architecture.md
npx memory-bank write-global tech-stack.md -f ./tech-stack.md
npx memory-bank read-branch feature/login activeContext.md
npx memory-bank recent-branches
npm install -g memory-bank-mcp-server
memory-bank --help
<path>
: Read a document from the global memory bank<path> [content]
: Write a document to the global memory bank<branch> <path>
: Read a document from a branch memory bank<branch> <path> [content]
: Write a document to a branch memory bank<branch>
: Read all core files from a branch memory bank[limit]
: Get recent branchesMemory Bank 2.0 introduces a new JSON-based architecture for all documents, providing:
JSON documents follow this structure:
{
"schema": "memory_document_v2",
"metadata": {
"id": "unique-id",
"title": "Document Title",
"documentType": "document_type",
"path": "relative/path.json",
"tags": ["tag1", "tag2"],
"lastModified": "2025-03-17T00:00:00Z",
"createdAt": "2025-03-17T00:00:00Z",
"version": 1
},
"content": {
// Document type-specific content
}
}
read_context
command for fetching combined informationThe codebase has been refactored to follow clean architecture principles:
The Global Memory Bank manages project-wide knowledge that persists across all branches:
Example structure:
docs/global-memory-bank/
├── architecture.json # System architecture
├── coding-standards.json # Coding conventions
├── domain-models.json # Domain model definitions
├── glossary.json # Terminology
├── tech-stack.json # Technology stack
├── user-guide.json # User guide
└── tags/ # Information organization
Note: Only .json format is supported.
Branch Memory Banks store context specific to feature or fix branches:
Example structure:
docs/branch-memory-bank/feature-login/
├── branchContext.json # Branch purpose and stories
├── activeContext.json # Current work state
├── systemPatterns.json # Technical decisions
└── progress.json # Implementation status
Note: Only .json format is supported.
write_branch_memory_bank
path
(string): Document pathcontent
(string, optional): Document content (full replacement)patches
(array, optional): JSON Patch operations to apply (cannot be used with content)branch
(string, required): Branch namedocs
(string, optional): Path to docs directoryread_branch_memory_bank
Read a document from the current branch's memory bank
path
(string): Document pathbranch
(string, required): Branch namedocs
(string, optional): Path to docs directorywrite_global_memory_bank
Write a document to the global memory bank
path
(string): Document pathcontent
(string, optional): Document content (full replacement)patches
(array, optional): JSON Patch operations to apply (cannot be used with content)docs
(string, optional): Path to docs directoryread_global_memory_bank
Read a document from the global memory bank
path
(string): Document pathdocs
(string, optional): Path to docs directoryread_context
Read all context information (rules, branch memory bank, global memory bank) at once
branch
(string): Branch name (required)language
(string): Language code ('en', 'ja', or 'zh', default: 'ja')docs
(string, optional): Path to docs directoryread_rules
Read the memory bank rules in specified language
language
(string): Language code ("en", "ja", or "zh")Add one of these configurations to your claude_desktop_config.json:
{
"mcpServers": {
"memory-bank": {
"command": "npx",
"args": ["-y", "memory-bank-mcp-server"],
"env": {
"MEMORY_BANK_ROOT": "/path/to/docs",
"MEMORY_BANK_LANGUAGE": "ja"
}
}
}
}
{
"mcpServers": {
"memory-bank": {
"command": "memory-bank-mcp-server",
"env": {
"MEMORY_BANK_ROOT": "/path/to/docs",
"MEMORY_BANK_LANGUAGE": "ja"
}
}
}
}
Configuration options:
WORKSPACE_ROOT
: Root directory for the project workspace (default: current directory)MEMORY_BANK_ROOT
: Root directory for memory bank storage (default: docs
in workspace)MEMORY_BANK_LANGUAGE
: Default language for templates ("en", "ja", or "zh", default: "en")You can specify the docs directory when starting the server:
{
"mcpServers": {
"memory-bank": {
"command": "npx",
"args": ["-y", "memory-bank-mcp-server", "--docs", "/path/to/docs"],
"env": {
"MEMORY_BANK_LANGUAGE": "ja"
}
}
}
}
Alternatively, with the read_context
and other MCP tools, you can work with different projects in the same session:
read_context(branch: "feature/my-branch", docs: "/path/to/other/docs")
Path resolution follows this priority order:
Here's a recommended system prompt for utilizing the memory bank:
Follow these steps for each interaction:
1. Branch Context:
- Always begin by checking the current git branch
- For feature/ or fix/ branches, load the branch memory bank
- Initialize memory bank with templates if not present
2. Memory Bank Access:
- Read relevant documentation from global and branch memory banks
- Keep context of project-wide standards and branch-specific work
- Maintain documentation structure and organization
3. Documentation Updates:
- Update branch memory bank when:
a) Making code changes
b) Adding new features
c) Making technical decisions
d) Discovering new patterns
- Update global memory bank for project-wide changes
- Use JSON Patch for targeted updates when appropriate
4. Memory Bank Maintenance:
- Keep documentation organized and up-to-date
- Use proper templates and structures
- Tag documents appropriately
- Maintain clear hierarchies
Clone and install dependencies:
git clone <repository-url>
cd memory-bank-mcp-server
npm install
Run in development mode:
npm run dev
Build:
npm run build
This project uses GitHub Actions for continuous integration and deployment:
Tests are automatically run on:
develop
and master
branchesdevelop
and master
branchesThe test workflow runs against multiple Node.js versions (16.x, 18.x, 20.x) to ensure compatibility.
When code is merged to the master
branch:
To bump the version before a release:
develop
)This will create a commit with the updated version number in package.json.
This project is licensed under the MIT License. See the LICENSE file for details.
No description, website, or topics provided.
No packages published
You can’t perform that action at this time.