Connect your AI Agents to OneDrive in minutes

Available tools
advanced_search
Perform advanced search with filters and content search
search_by_content_type
Search for files by content type and properties
get_file_activity
Get activity history for files and folders
search_recent_files
Search for recently created or modified files
get_my_drive
Get the user's default OneDrive
get_drive
Get information about a specific drive by ID
list_my_drives
List all drives available to the user
get_root_folder
Get the root folder of a drive
get_special_folder
Get a special folder (Documents, Photos, etc.)
get_drive_usage
Get storage usage information for a drive
get_drive_owner
Get owner information for a drive
get_item
Get a drive item by ID or path

How to set up Merge Agent Handler
In an mcp.json file, add the configuration below, and restart Cursor.
Learn more in the official documentation ↗
1{
2 "mcpServers": {
3 "agent-handler": {
4 "url": "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
5 "headers": {
6 "Authorization": "Bearer yMt*****"
7 }
8 }
9 }
10}
11Open your Claude Desktop configuration file and add the server configuration below. You'll also need to restart the application for the changes to take effect.
Make sure Claude is using the Node v20+.
Learn more in the official documentation ↗
1{
2 "mcpServers": {
3 "agent-handler": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "mcp-remote@latest",
8 "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
9 "--header",
10 "Authorization: Bearer ${AUTH_TOKEN}"
11 ],
12 "env": {
13 "AUTH_TOKEN": "yMt*****"
14 }
15 }
16 }
17}Open your Windsurf MCP configuration file and add the server configuration below.
Click on the refresh button in the top right of the Manage MCP server page or in the top right of the chat box in the box icon.
Learn more in the official documentation ↗
1{
2 "mcpServers": {
3 "agent-handler": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "mcp-remote@latest",
8 "https://ah-api.merge.dev/api/v1/tool-packs/<tool-pack-id>/registered-users/<registered-user-id>/mcp",
9 "--header",
10 "Authorization: Bearer ${AUTH_TOKEN}"
11 ],
12 "env": {
13 "AUTH_TOKEN": "<ah-production-access-key>"
14 }
15 }
16 }
17 }In Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows), run "MCP: Open User Configuration".
You can then add the configuration below and press "start" right under servers. Enter the auth token when prompted.
Learn more in the official documentation ↗
1{
2 "inputs": [
3 {
4 "type": "promptString",
5 "id": "agent-handler-auth",
6 "description": "Agent Handler AUTH_TOKEN", // "yMt*****" when prompt
7 "password": true
8 }
9 ],
10 "servers": {
11 "agent-handler": {
12 "type": "stdio",
13 "command": "npx",
14 "args": [
15 "-y",
16 "mcp-remote@latest",
17 "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
18 "--header",
19 "Authorization: Bearer ${input:agent-handler-auth}"
20 ]
21 }
22 }
23}FAQs on using Merge's OneDrive MCP server
FAQs on using Merge's OneDrive MCP server
How can I use the OneDrive MCP server?
Here are just a few popular use cases:
- External sharing governance: Your agent can monitor files shared via external links, automatically enforce expiration dates on sensitive documents, revoke access after project completion, and alert security teams when confidential files are shared with non-approved domains
- Meeting preparation automation: Your agent can scan upcoming calendar events, identify relevant OneDrive files based on meeting topics and attendees, compile them into a briefing folder, and share pre-read materials with participants 24 hours before meetings
- Collaborative conflict prevention: Your agent can detect when multiple users are editing the same file simultaneously, notify editors of potential conflicts, suggest lock mechanisms for critical sections, and automatically merge non-conflicting changes while flagging areas needing manual review
- License optimization: Your agent can analyze storage usage and file access patterns across your organization, identify users with large storage footprints but minimal activity, recommend appropriate license tier adjustments, and generate cost-saving reports for IT administrators
- Cross-platform documentation sync: Your agent can monitor OneDrive files that are referenced in project management tools or wikis, automatically update linked documents when source files change, and maintain a changelog of cross-platform dependencies to prevent broken references
What are popular tools for OneDrive’s MCP server?
Here are some popular tools across resource types:
Drives
- <code class="blog_inline-code">list_my_drives</code>
- <code class="blog_inline-code">get_my_drive</code>
- <code class="blog_inline-code">get_drive_usage</code>
- <code class="blog_inline-code">get_drive_owner</code>
Items
- <code class="blog_inline-code">search_items</code>
- <code class="blog_inline-code">download_item</code>
- <code class="blog_inline-code">move_item</code>
- <code class="blog_inline-code">update_item</code>
Permissions
- <code class="blog_inline-code">grant_permission</code>
- <code class="blog_inline-code">update_permission</code>
- <code class="blog_inline-code">get_permission</code>
- <code class="blog_inline-code">delete_permission</code>
What makes Merge Agent Handler’s OneDrive MCP server better than alternative OneDrive MCP servers?
Merge Agent Handler provides platform-level capabilities that go beyond a standalone MCP server:
- Enterprise-grade security and DLP: All OneDrive tool inputs and outputs pass through a security gateway that can block, redact, or mask sensitive data using default or custom rules. This helps prevent data leakage without requiring manual review
- Authentication handled end-to-end: Merge supports guided authentication flows, credential management, and both individual and shared authentication models for MCP connectors like OneDrive. This removes the need to build and maintain auth logic yourself
- Real-time observability and auditability: Every OneDrive tool call is logged with full context, enabling real-time monitoring, debugging, and a complete audit trail. Logs are also fully-searchable, making it easier to review and manage agent behavior over time
- Tool Pack management at scale: OneDrive tools can be bundled with other connectors into Tool Packs and dynamically loaded per agent or use case, allowing fine-grained control over what your agents can access
Can I set custom security rules for OneDrive tool calls in Merge Agent Handler?
Yes, you can set a wide range of custom security rules. Here are just a few examples:
- Passport and national ID numbers: Block any <code class="blog_inline-code">upload_file</code> or <code class="blog_inline-code">update_file_content</code> tool calls that contain passport numbers, driver's license IDs, or national identification numbers in OneDrive documents before they're synced to the cloud
- Medical record numbers: Redact protected health information (PHI) including medical record numbers, diagnosis codes, and patient identifiers when agents retrieve documents via <code class="blog_inline-code">read_file_content</code> or <code class="blog_inline-code">download_file</code> from OneDrive health compliance folders
- IP addresses and network credentials: Prevent agents from creating or updating OneDrive files that contain internal IP addresses, VPN credentials, firewall configurations, or network topology diagrams that could expose infrastructure vulnerabilities
- Customer PII bundles: Mask combinations of customer data (street addresses, dates of birth, account numbers) when agents search or retrieve files via <code class="blog_inline-code">search_files</code> or <code class="blog_inline-code">list_folder_contents</code>, showing only tokenized references (e.g., CUST-***-4892)
- Proprietary source code: Block <code class="blog_inline-code">move_file</code> or <code class="blog_inline-code">copy_file</code> tool calls that attempt to transfer files containing proprietary code, trade secrets, or confidential algorithms from secured team folders to personal OneDrive directories
- Time-based access restrictions: Prevent <code class="blog_inline-code">download_file</code> or <code class="blog_inline-code">get_file_metadata</code> operations on files tagged as "highly confidential" during off-hours (e.g., 6 PM - 8 AM) or on weekends, ensuring sensitive document access only occurs during business hours
How can I start using Merge Agent Handler’s OneDrive MCP server?
Here are the steps to start using Merge Agent Handler's OneDrive MCP server:
1. Sign up for Agent Handler. You can create a free Merge Agent Handler account here.
2. Create a Tool Pack (a collection of connectors your agent can access). In the dashboard, go to Tool Packs, click "Create New Tool Pack," and select the OneDrive connector from the available connectors. You can also name your Tool Pack (e.g., "OneDrive Access Pack").
3. Create a Registered User (an identity that executes actions on behalf of your agent). Navigate to the Registered Users section in the dashboard and click "Create Registered User."
You'll need to provide:
- Origin User ID: A unique identifier for this user in your system (e.g., a UUID)
- Origin User Name: A human-readable name (e.g., "John Smith")
- (Optional) Shared Credential Group: If multiple users should share the same credentials, you can group them together
Agent Handler will return a Registered User ID that you'll use in step 4.
4. Collect your configuration details. You'll need three pieces of information:
- Tool Pack ID: Found in your Tool Pack's URL or settings
- Registered User ID: Found in the Registered Users section
- API Key: Generate this from your Agent Handler account settings (typically starts with a prefix like "cx-")
5. Configure your IDE or AI platform. Add the MCP server configuration to your development environment (Cursor, Claude Desktop, Windsurf, VS Code, etc.) using the Tool Pack ID, Registered User ID, and API Key
6. Verify the connection. Open your AI assistant or agent interface. You should see the OneDrive tools available in the tools/context menu
7. Start using OneDrive tools. Test with prompts like "List my recent OneDrive files" or "Create a new folder in OneDrive called Project Documents."
Explore other MCP servers built and managed by Merge







Ready to try it out?
Whether you're an engineer experimenting with agents or a product manager looking to add tools, you can get started for free now

