OneDrive Storage
Overview
Section titled “Overview”The OneDrive storage provider enables file operations via Microsoft Graph API. Supports personal OneDrive, OneDrive for Business, and SharePoint document libraries.
Prerequisites
Section titled “Prerequisites”- Microsoft Azure account
- Azure Active Directory (Entra ID) tenant
- App registration with Microsoft Graph permissions
-
Register an application in Azure AD
Go to Azure Portal > Azure Active Directory > App registrations > New registration:
- Name:
satware AI OnlyOffice MCP - Supported account types: Single tenant or Multitenant
- Redirect URI:
http://localhost:8080/oauth/callback(for delegated auth) - Note the Application (client) ID and Directory (tenant) ID
- Name:
-
Create a client secret
Go to Certificates & secrets > New client secret. Copy the secret value immediately (it won’t be shown again).
-
Configure API permissions
Go to API permissions > Add a permission > Microsoft Graph:
- Select Application permissions
- Add:
Files.ReadWrite.All,User.Read.All - Click Grant admin consent
- Select Delegated permissions
- Add:
Files.ReadWrite,Files.ReadWrite.All
Authentication Types
Section titled “Authentication Types”Application (recommended for servers)
Section titled “Application (recommended for servers)”Best for automated systems without user interaction:
{ "type": "onedrive", "tenantId": "your-tenant-id", "clientId": "your-client-id", "clientSecret": "your-client-secret", "authType": "application", "userId": "user@contoso.com"}Delegated (interactive)
Section titled “Delegated (interactive)”For applications acting on behalf of a user:
{ "type": "onedrive", "tenantId": "your-tenant-id", "clientId": "your-client-id", "authType": "delegated"}Configuration
Section titled “Configuration”| Parameter | Required | Description |
|---|---|---|
type |
Yes | Must be "onedrive" |
tenantId |
Yes | Azure AD Tenant ID |
clientId |
Yes | Application (client) ID |
clientSecret |
No | Client secret (required for application auth) |
authType |
No | "application" or "delegated" (default: "delegated") |
userId |
No | User ID/UPN (required for application auth) |
driveId |
No | Specific drive ID (for SharePoint) |
basePath |
No | Base path prefix |
SharePoint Document Library
Section titled “SharePoint Document Library”{ "type": "onedrive", "tenantId": "xxx-xxx-xxx", "clientId": "yyy-yyy-yyy", "clientSecret": "your-secret", "authType": "application", "driveId": "b!xxxxx-drive-id", "basePath": "/Shared Documents"}Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
STORAGE_TYPE |
Set to onedrive |
AZURE_TENANT_ID |
Azure AD Tenant ID |
AZURE_CLIENT_ID |
Application ID |
AZURE_CLIENT_SECRET |
Client secret |
Related
Section titled “Related”- Storage Overview - All 7 providers
- Credential Management - Encrypted credential storage