Persistent memory for Claude using your local OneDrive folder. This MCP server enables Claude to remember project context, decisions, preferences, and learnings across sessionsβautomatically synced via OneDrive.
One command to install:
claude mcp add claude-onedrive-memory -- npx @patrick-rodgers/claude-onedrive-memoryThis registers the MCP server with Claude Code. All 17 memory tools will be available in your next session.
Add to your MCP configuration:
{
"mcpServers": {
"claude-onedrive-memory": {
"command": "npx",
"args": ["@patrick-rodgers/claude-onedrive-memory"]
}
}
}Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Restart Claude Desktop after adding the configuration.
- Node.js 18+ (Download)
- OneDrive (optional) - For automatic sync across devices. If not installed, you can configure a custom storage location using the
configure_storagetool.
The plugin automatically requests permissions for all its tools. When installed, Claude Code will ask once to approve access, then all memory operations will work without additional prompts.
To replace Claude's built-in memory globally, add to ~/.claude/CLAUDE.md:
## Memory System
ALWAYS use the OneDrive Memory MCP tools for ALL memory operations:
- remember - Store information
- recall - Search memories
- get_context - Get project context
- list, forget, update - Manage memories
Do NOT use any other memory system. This is my preferred memory implementation.This tells Claude to route all memory operations through this plugin.
- π§ 17 Memory Tools - Complete toolkit for storing, searching, linking, and managing memories
- π¦ MCP Resources - Browse memories as resources (
memory://list,memory://{id}, etc.) - π― Smart Context - Automatically detects project patterns and recalls relevant memories
- π Memory Relationships - Link related memories and visualize connections
- π·οΈ Batch Operations - Tag, untag, or delete multiple memories at once
- π Analytics - Statistics, relationship graphs, and export capabilities
- βοΈ OneDrive Sync - No authentication needed, uses your existing OneDrive client
- π Flexible Storage - Use OneDrive or any custom folder location
- π Works Offline - Memories stored locally first, synced when online
- π Human-Readable - Memories are markdown files you can view/edit directly
Memories are stored in your OneDrive folder:
OneDrive/Apps/ClaudeMemory/
index.json # Quick lookup index
memories/
project/
2024-02-05-codebase-structure.md
decision/
2024-02-05-database-choice.md
Each memory is a markdown file with YAML frontmatter:
---
id: abc123
category: project
tags: [react, typescript]
created: 2024-02-05T10:30:00Z
updated: 2024-02-05T10:30:00Z
projectId: github.com/user/repo
---
This codebase uses React 18 with TypeScript...Memories are automatically scoped to your current git repository. When you store a memory, it's tagged with the project context. When you search, you get project-relevant results first.
| Tool | Description |
|---|---|
remember |
Store a new memory with category, tags, priority, and TTL |
recall |
Search and retrieve memories with intelligent ranking |
list |
List all memories with optional category/project filters |
forget |
Delete a memory by ID (supports partial matching) |
update |
Update memory content or tags |
get_context |
Smart context based on current project and file patterns |
cleanup |
Remove expired memories (with dry-run preview) |
status |
Check OneDrive detection and system status |
configure_storage |
Select OneDrive folder or set custom storage location |
| Tool | Description |
|---|---|
link_memories |
Create or remove bidirectional links between memories |
get_related |
Get all memories linked to a specific memory |
merge_memories |
Merge multiple memories into one |
batch_tag |
Add or remove tags from multiple memories |
batch_delete |
Delete multiple memories with filters (always use dry-run first!) |
get_statistics |
Comprehensive memory statistics and health metrics |
visualize_graph |
Generate mermaid diagram of memory relationships |
export_memories |
Export to JSON or Markdown for backup/analysis |
Browse memories as resources:
memory://list- All memories as JSONmemory://{id}- Specific memory as Markdownmemory://project/{project-id}- Memories for a specific projectmemory://category/{category}- Memories by category
When used with Claude Code, this plugin includes additional features:
- Session Start - Automatically recalls project context when you start a new session
- No need to manually ask Claude to rememberβit happens automatically
/remember- Quick memory creation/recall- Search memories/memory-status- Check system status
- Rich documentation and guidance available via skills system
- Type
/memoryto access memory skill documentation
Store project information:
Tool: remember
category: "project"
content: "This is a React TypeScript app. Main entry point is /src/index.tsx. Components in /src/components, API calls in /src/api"
tags: ["react", "typescript", "architecture"]
Store a decision:
Tool: remember
category: "decision"
content: "Using Zustand for state management instead of Redux. It's simpler, has less boilerplate, and the team is already familiar with it."
tags: ["architecture", "state-management"]
Store user preferences:
Tool: remember
category: "preference"
content: "User prefers functional components with hooks. Avoid class components. Use named exports over default exports."
global: true
Search memories:
Tool: recall
query: "authentication"
category: "decision"
limit: 5
Get smart project context:
Tool: get_context
limit: 5
verbose: true
Link related memories:
Tool: link_memories
id1: "abc123"
id2: "def456"
operation: "link"
Merge duplicate memories:
Tool: merge_memories
ids: ["abc123", "def456", "ghi789"]
title: "Combined React Component Guidelines"
Batch tag memories:
Tool: batch_tag
tag: "refactoring"
operation: "add"
category: "task"
dryRun: true
Get statistics:
Tool: get_statistics
Export memories:
Tool: export_memories
format: "json"
category: "project"
| Category | Use For |
|---|---|
project |
Codebase structure, architecture, key files, tech stack |
decision |
Architectural choices, library selections, approach decisions with rationale |
preference |
User's coding style, naming conventions, formatting preferences |
learning |
Gotchas, bug fixes, discoveries, things that need special handling |
task |
Current work, next steps, blockers, TODOs |
You can also use custom category names.
Claude should proactively remember when discovering:
- Project structure, architecture, or key files
- Important decisions and their rationale
- User preferences for coding style, naming, formatting
- Gotchas, bugs, or things that "just work this way"
- Ongoing tasks, blockers, or next steps
- Be specific and actionable - "API uses JWT tokens in Authorization header" not "uses tokens"
- Include the why - "Chose PostgreSQL for ACID compliance in financial data"
- Reference file paths - "Main entry point is /src/index.ts, routes defined in /src/routes/"
- Note gotchas explicitly - "GOTCHA: Must run npm install in /packages/shared first"
- Update outdated memories - Use
forgetandrememberto replace outdated information
With Claude Code (automatic): The plugin's session hook automatically recalls project context when you start a new session. No manual action needed!
With Claude Desktop (manual): At the beginning of a session, you can ask Claude to:
- Call
get_contextto get smart project-relevant memories - Call
recallwithcategory: "preference"to get user preferences - Call
recallwithcategory: "task"to check for ongoing work
npm install
npm run buildnpm testThis launches the MCP Inspector where you can manually invoke tools and see responses.
- Clone the repository:
git clone https://github.com/patrick-rodgers/claude-onedrive-memory.git
cd claude-onedrive-memory- Install and build:
npm install
npm run build- Configure Claude to use local build (see Installation section above)
By default, the MCP server automatically detects your OneDrive folder using:
- Environment variables (
OneDriveCommercial,OneDriveConsumer,OneDrive) - Home directory scan for
OneDrive - *orOneDrivefolders
Memories are stored in: OneDrive/Apps/ClaudeMemory/
If you have multiple OneDrive accounts, the status tool will show all detected folders and prompt you to select one:
Tool: status
Then select your preferred folder:
Tool: configure_storage
action: "list" # Show available OneDrive folders
Tool: configure_storage
action: "select"
index: 1 # Select first folder (1-based index)
You can use any folder location instead of OneDrive:
Tool: configure_storage
action: "custom"
path: "/Users/you/Documents/ClaudeMemory"
Note:
- OneDrive folders get
/Apps/ClaudeMemoryappended automatically - Custom paths are used directly without any subfolder
Your preference is saved to ~/.claude/odsp-memory/config.json
Tool: configure_storage
action: "reset"
- Make sure OneDrive is installed and signed in
- Check that sync is enabled (look for OneDrive icon in system tray)
- On Windows, check if
%OneDriveCommercial%or%OneDrive%environment variables are set - Use the
statustool to see detection details - Or use
configure_storageto set a custom location
If you have multiple OneDrive accounts (e.g., work and personal):
- Use
statustool to see all detected folders - Use
configure_storagewithaction: "select"to choose one - The server prioritizes work/school accounts by default
- Check OneDrive sync status in system tray
- Ensure you have internet connectivity
- Look for sync errors in OneDrive settings
- The memories are stored locally first and will sync when OneDrive is ready
MIT
This software is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
Contributions are welcome! Please feel free to submit a Pull Request.