@patrick-rodgers/claude-onedrive-memory
v0.2.1
Published
Persistent memory for Claude using OneDrive - MCP server with resources
Maintainers
Readme
OneDrive Memory for Claude
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.
🚀 Installation
Claude Code (Recommended)
One command to install:
claude plugin add @patrick-rodgers/claude-onedrive-memoryThat's it! The plugin installs automatically with:
- ✅ Session hooks (auto-recalls context on startup)
- ✅ Slash commands (
/remember,/recall,/memory-status) - ✅ All 17 memory tools
- ✅ No configuration needed
Claude Desktop
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.
Prerequisites
- 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.
Optional Configuration
1. Auto-Approve Tool Calls (No Prompts)
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.
2. Make This Your Default Memory System
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.
✨ Features
- 🧠 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
📚 How It Works
Storage
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.mdEach 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...Automatic Project Scoping
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.
🛠️ Available Tools
Core Operations (9 tools)
| 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 |
Advanced Operations (7 tools)
| 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 |
📦 MCP Resources
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
🎨 Claude Code Plugin Features
When used with Claude Code, this plugin includes additional features:
🪝 Automatic Session Hooks
- Session Start - Automatically recalls project context when you start a new session
- No need to manually ask Claude to remember—it happens automatically
⌨️ Slash Commands
/remember- Quick memory creation/recall- Search memories/memory-status- Check system status
📖 Skills
- Rich documentation and guidance available via skills system
- Type
/memoryto access memory skill documentation
💡 Usage Examples
Basic Memory Operations
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: trueSearch memories:
Tool: recall
query: "authentication"
category: "decision"
limit: 5Get smart project context:
Tool: get_context
limit: 5
verbose: trueAdvanced Operations
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: trueGet statistics:
Tool: get_statisticsExport memories:
Tool: export_memories
format: "json"
category: "project"📋 Memory Categories
| 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.
🎯 Best Practices
When to Remember
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
Memory Content Tips
- 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
Session Start Routine
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
🔧 Development
Build
npm install
npm run buildTest with MCP Inspector
npm testThis launches the MCP Inspector where you can manually invoke tools and see responses.
Local Development
- 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)
⚙️ Storage Configuration
Automatic Detection
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/
Multiple OneDrive Accounts
If you have multiple OneDrive accounts, the status tool will show all detected folders and prompt you to select one:
Tool: statusThen select your preferred folder:
Tool: configure_storage
action: "list" # Show available OneDrive foldersTool: configure_storage
action: "select"
index: 1 # Select first folder (1-based index)Custom Storage Location
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
Reset to Auto-Detection
Tool: configure_storage
action: "reset"🐛 Troubleshooting
"Could not find OneDrive folder"
- 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
Multiple OneDrive Accounts
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
Memories Not Syncing
- 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
📄 License
MIT
Warranty Disclaimer
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.
🙏 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
