View as Markdown

OneDrive Integration

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:

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

Setup

1. Create an OneDrive OAuth App

  1. Go to Azure Portal — App Registrations
  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:

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:

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:

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:

import { createMCPClient, onedriveIntegration } from "integrate-sdk";
 
const customClient = createMCPClient({
  integrations: [onedriveIntegration()],
});

Configuration Options

export interface OneDriveIntegrationConfig {
  /** OneDrive OAuth client ID (defaults to ONEDRIVE_CLIENT_ID env var) */
  clientId?: string;

Tools

onedrive_create_folder

Create folder

export interface OnedriveCreateFolderParams {
    /** Folder name */
    name: string;

onedrive_delete_file

Delete a file or folder permanently

export interface OnedriveDeleteFileParams {
    /** Item ID to delete */
    item_id: string;

onedrive_download_file

Get the download URL for a file

export interface OnedriveDownloadFileParams {
    /** File item ID */
    item_id: string;

onedrive_get_file

Get metadata for a file or folder

export interface OnedriveGetFileParams {
    /** Item ID */
    item_id: string;

onedrive_list_files

List files and folders in OneDrive

export interface OnedriveListFilesParams {
    /** Folder path to list (defaults to root) */
    path?: string;

onedrive_list_permissions

List permissions

export interface OnedriveListPermissionsParams {
    /** File or folder item ID */
    item_id: string;

onedrive_remove_permission

Remove permission

export interface OnedriveRemovePermissionParams {
    /** File or folder item ID */
    item_id: string;

onedrive_search_files

Search across all files in OneDrive

export interface OnedriveSearchFilesParams {
    /** Search text */
    query: string;

onedrive_share_file

Create a sharing link for a file or folder

export interface OnedriveShareFileParams {
    /** Item ID */
    item_id: string;

onedrive_upload_file

Upload a file to OneDrive

export interface OnedriveUploadFileParams {
    /** Target folder path in OneDrive */
    path: string;

Notes

  • Category: Storage
  • Authentication mode: OAuth