Getting OneDrive Working with Self-Hosted AI Agents: A Survival Story
February 18, 2026 | Last updated: February 18, 2026
Categories: story, onedrive, multcloud, automation, openclaw
This post was co-created with Clawsistant, my OpenClaw AI agent. Yes, an AI and a human brainstormed this mess together.
If you read my previous post, you know how to set up Google APIs for your AI agent. What I didn't mention? Getting Google Drive working was the easy part. The real adventure was OneDrive.
This is the story of how I finally got my AI agent to access files from OneDrive — and why I ended up using a third-party service to make it happen.
The Problem
I store a lot of important files on OneDrive: tax documents, resumes, work-related PDFs, family photos. My AI agent needed access to these files for tasks like:
- Finding and summarizing documents
- Organizing files
- Accessing work materials while working remotely
Simple enough, right? Just set up the OneDrive API like we did with Google. How hard could it be?
The Answer: Very Hard
Attempt 1: Microsoft Graph API
Microsoft provides the OneDrive API through Microsoft Graph. In theory, it's similar to Google APIs:
- Create an Azure App registration
- Configure OAuth permissions
- Get client credentials
- Connect to your agent
The reality: Microsoft's developer ecosystem feels like it was designed by a committee that never talked to each other. Here's what went wrong:
- Consent issues: Even with a personal Microsoft account, the OAuth flow kept failing with cryptic error messages
- Permission scopes are confusing: Files.Read, Files.Read.All, Files.ReadWrite — which one do I need?
- Token refresh problems: Unlike Google's relatively stable token system, Microsoft's refresh tokens have all sorts of edge cases
- No straightforward "service account" option: For personal accounts, you're stuck with delegated permissions, not the application permissions you'd use in an enterprise setup
Attempt 2: rclone
rclone is the gold standard for command-line cloud storage sync. It's free, open-source, and supports OneDrive out of the box.
The setup involves:
- Installing rclone
- Running
rclone configto authorize OneDrive - Using rclone commands to sync/mount folders
The problem: rclone works great for a human typing commands, but integrating it with an AI agent? That's tricky. The agent would need to:
- Execute shell commands
- Handle the OAuth flow interactively
- Manage mounted filesystems
It's doable, but it adds complexity. I wanted something cleaner.
Attempt 3: Other Options
I also looked at:
- onedrive-docker — Docker containers that sync OneDrive locally. Good, but still requires server resources and maintenance.
- ownCloud/Nextcloud — Self-hosted alternatives. Overkill for my use case.
- Direct WebDAV — OneDrive doesn't natively support WebDAV anymore.
The Solution: MultCloud
After weeks of frustration, I discovered MultCloud — a service that lets you manage multiple cloud storage providers from one interface.
Here's why it won:
- Easy setup: Connect OneDrive and Google Drive (or other clouds) with a few clicks
- Built-in sync: Schedule automatic sync between clouds
- Agent-friendly: The AI agent talks to Google Drive (which we already set up), and files are automatically synced from OneDrive
- Reliable: No more OAuth headaches
How It Works
- Sign up for MultCloud (free tier available, paid for more features)
- Add OneDrive — authorize access to your OneDrive account
- Add Google Drive — authorize access
- Create a sync job — choose which OneDrive folders to sync to Google Drive
- Schedule it — sync hourly, daily, or in real-time
The Trade-offs
Is MultCloud perfect? No. Here's the reality:
| Pros | Cons |
|---|---|
| Simple to set up | Third-party dependency |
| Works reliably | Subscription cost (or one-time deal) |
| No OAuth headaches | Data passes through their servers |
| Supports 80+ clouds | Free tier has limits |
For me, the trade-off was worth it. My time is valuable, and MultCloud lets me focus on actually using my AI agent rather than debugging OAuth flows.
What I'd Do Differently
If I were starting fresh today, here's my advice:
- Start with MultCloud from day one if you need multi-cloud access
- Don't waste time on Microsoft Graph unless you have a business need
- Use rclone if you want a free, self-hosted solution and don't mind the CLI
- Consider the sync approach: One-way sync (OneDrive → Google Drive) is simpler than two-way
Lessons Learned
This whole saga taught me a few things:
- Not all clouds are equal: Google's developer experience is far ahead of Microsoft's
- Workarounds are valid: Sometimes the "elegant" solution isn't worth the headache
- AI agents need stable APIs: The less friction in cloud access, the more useful the agent
- Third-party services exist for a reason: MultCloud fills a real gap
What's Next
Now that my AI agent has access to both Google Drive and OneDrive (via sync), the automation possibilities have opened up. I can:
- Search across both clouds
- Get file summaries
- Automate document organization
Next, I'm working on more advanced automation — maybe automatic file categorization or intelligent document routing. Stay tuned!