---
title: "OneDrive Integration"
description: "Manage OneDrive files, folders, and sharing"
---
The OneDrive integration provides access to manage OneDrive files, folders, and sharing through the Integrate MCP server.

## Installation

The OneDrive integration is included with the SDK:

```typescript
import { onedriveIntegration } from "integrate-sdk/server";
```

## Setup

### 1. Create an OneDrive OAuth App

1. Go to [Azure Portal — App Registrations](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps)
2. Create a new OAuth application
3. Configure your redirect URI
4. Note your Client ID and Client Secret

### 2. Configure the Integration on Your Server

Add the OneDrive integration to your server configuration. The integration automatically reads `ONEDRIVE_CLIENT_ID` and `ONEDRIVE_CLIENT_SECRET` from your environment variables:

```typescript
import { createMCPServer, onedriveIntegration } from "integrate-sdk/server";

export const { client: serverClient } = createMCPServer({
  apiKey: process.env.INTEGRATE_API_KEY,
  integrations: [
    onedriveIntegration({
    }),
  ],
});
```

You can override the environment variables by passing explicit values:

```typescript
onedriveIntegration({
  clientId: process.env.CUSTOM_ONEDRIVE_ID,
  clientSecret: process.env.CUSTOM_ONEDRIVE_SECRET,
});
```

### 3. Client-Side Usage

The default client automatically includes all integrations. You can use it directly:

```typescript
import { client } from "integrate-sdk";

await client.authorize("onedrive");
const result = await client.onedrive.listFiles({});

console.log(result);
```

If you're using a custom client, add the integration to the integrations array:

```typescript
import { createMCPClient, onedriveIntegration } from "integrate-sdk";

const customClient = createMCPClient({
  integrations: [onedriveIntegration()],
});
```

## Configuration Options

<AutoTypeTable
  path="../src/integrations/onedrive.ts"
  name="OneDriveIntegrationConfig"
/>


## Tools

### `onedrive_create_folder`

Create folder

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveCreateFolderParams"
/>

### `onedrive_delete_file`

Delete a file or folder permanently

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveDeleteFileParams"
/>

### `onedrive_download_file`

Get the download URL for a file

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveDownloadFileParams"
/>

### `onedrive_get_file`

Get metadata for a file or folder

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveGetFileParams"
/>

### `onedrive_list_files`

List files and folders in OneDrive

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveListFilesParams"
/>

### `onedrive_list_permissions`

List permissions

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveListPermissionsParams"
/>

### `onedrive_remove_permission`

Remove permission

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveRemovePermissionParams"
/>

### `onedrive_search_files`

Search across all files in OneDrive

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveSearchFilesParams"
/>

### `onedrive_share_file`

Create a sharing link for a file or folder

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveShareFileParams"
/>

### `onedrive_upload_file`

Upload a file to OneDrive

<AutoTypeTable
  path="generated/tool-params/onedrive.ts"
  name="OnedriveUploadFileParams"
/>

## Notes

- Category: Storage
- Authentication mode: OAuth
