OneDrive Live MCP on Cloudflare
A read-only remote MCP server that searches and reads files from a personal Microsoft OneDrive folder via Cloudflare Workers, enabling live access without a local workstation or tunnel.
README
OneDrive Live MCP on Cloudflare
A private, read-only remote MCP server that lets ChatGPT search and read a selected folder in a personal Microsoft OneDrive account without a local workstation, tunnel, or recurring corpus snapshot.
ChatGPT
-> remote MCP over HTTPS
-> Cloudflare Worker
-> Microsoft Graph
-> one configured OneDrive folder tree
The server searches OneDrive live and downloads only the files requested for reading. It does not expose upload, edit, move, share, or delete tools.
Features
- Live Microsoft Graph search across filenames, metadata, and Microsoft-indexed contents.
- Folder browsing under one configured root.
- On-demand bounded reads rather than a full local index.
- Direct PPTX slide and speaker-note extraction.
- Cloudflare Workers AI conversion for PDF, Office, image, HTML, XML, CSV, ODT/ODS, and other supported formats.
- Plain-text and source-code decoding without AI conversion.
- Microsoft OAuth delegated permissions limited to
Files.ReadandUser.Read. - Immutable Microsoft-account allow-list.
- Exact allowed-root path enforcement on search, listing, and reads.
- Strongly consistent one-time OAuth state in a Durable Object.
- Microsoft tokens encrypted before Durable Object storage.
- Optional converted-text cache in Workers KV.
MCP tools
onedrive_statussearch_onedrivelist_onedrive_folderread_onedrive_file
All tools are annotated as read-only.
Quick start
-
Clone the repository and install dependencies:
npm ci npx wrangler login -
Create a Workers KV namespace:
npx wrangler kv namespace create OAUTH_KV -
Edit
wrangler.jsonc:- replace
REPLACE_WITH_KV_NAMESPACE_ID; - replace
REPLACE_WITH_ALLOWED_ONEDRIVE_FOLDERwith the exact folder path, such asWorkorWork/Projects; - optionally rename the Worker and connector.
- replace
-
Follow the complete deployment guide:
An optional deployment-agent prompt is available at docs/CODEX_DEPLOY_PROMPT.md.
-
Validate locally before deployment:
npm run check
Configuration
Tracked configuration in wrangler.jsonc:
| Variable | Purpose | Default |
|---|---|---|
CONNECTOR_NAME |
Human-readable consent/app name | OneDrive Live MCP |
ONEDRIVE_ROOT |
Exact allowed OneDrive folder path | required |
MAX_FILE_MB |
Maximum downloaded file size | 20 |
MAX_READ_CHARS |
Maximum characters returned per tool call | 50000 |
CACHE_TTL_SECONDS |
Converted-text cache lifetime; 0 disables it |
604800 |
Cloudflare Worker secrets:
MICROSOFT_CLIENT_IDMICROSOFT_CLIENT_SECRETCOOKIE_ENCRYPTION_KEYOWNER_MICROSOFT_ID
Never commit these values.
Data handling
There is no full OneDrive snapshot. Search and folder listing are live. A requested file is downloaded only when read_onedrive_file is called.
By default, converted text up to 10 million characters is cached in Workers KV for seven days using a key derived from the file ID and eTag. Set CACHE_TTL_SECONDS to 0 to disable document-content caching.
See SECURITY.md for the threat model and storage boundaries.
Supported documents
Direct decoding:
- text, Markdown, JSON, YAML, TOML, INI, logs;
- common programming and shell-script formats;
- PPTX slides and speaker notes.
Cloudflare Workers AI conversion:
- PDF;
- DOCX;
- XLS/XLSX/XLSM/XLSB;
- CSV;
- HTML and XML;
- ODT and ODS;
- common image formats;
- other formats supported by the Cloudflare conversion API.
Conversion availability and usage limits depend on the Cloudflare account.
Development
npm run dev
npm run type-check
npm test
npm run check
For local secrets, copy .dev.vars.example to .dev.vars. The real .dev.vars file is ignored by Git.
Repository layout
src/ Worker, OAuth, Graph, MCP, and extraction code
test/ OAuth state and CSRF tests
docs/ Deployment, architecture, and troubleshooting
scripts/ Configuration validation
.github/workflows/ CI
wrangler.jsonc Cloudflare bindings and non-secret settings
Important limitations
- This implementation targets personal Microsoft accounts through the
consumersOAuth tenant. - OneDrive live search depends on Microsoft indexing, so newly uploaded content may not appear immediately.
- The configured root is enforced by application code; Microsoft
Files.Readitself is account-wide. - The Worker must remain deployed and the Microsoft authorization must remain valid.
- This repository does not include write-capable tools.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。