# Microsoft OneDrive — Pipedream Connect

> Microsoft OneDrive lets you store your personal files in one place, share them with others, and get to them from any device.

- API slug: `microsoft_onedrive` (use in MCP headers and tool keys)
- Auth: OAuth (Pipedream-managed)
- Categories: File Storage
- Website: https://onedrive.live.com
- Managed OAuth scopes: `User.Read` · `email` · `offline_access` · `openid` · `profile` · `Files.Read` · `Files.Read.All` · `Files.ReadWrite`
- This page (HTML): https://pipedream.com/apps/microsoft-onedrive
- Tools: 11 actions · 2 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: microsoft_onedrive`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "microsoft_onedrive",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Create Folder:
const result = await mcp.callTool({
  name: "microsoft_onedrive-create-folder",
  arguments: {
    parentFolderType: "Parent Folder Type",
    parentFolderId: "Parent Folder ID",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Microsoft OneDrive endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://graph.microsoft.com/v1.0/me

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9ncmFwaC5taWNyb3NvZnQuY29tL3YxLjAvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "microsoft_onedrive-create-folder",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_onedrive: { authProvisionId: "apn_xxxxxxx" },
    parentFolderType: "Parent Folder Type",
    parentFolderId: "Parent Folder ID",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (11)

### `microsoft_onedrive-create-folder` — Create Folder (Write)

Create a new folder in a drive. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/create-folder.md

### `microsoft_onedrive-create-link` — Create Link (Write)

Create a sharing link for a DriveItem. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/create-link.md

### `microsoft_onedrive-download-file` — Download File (Read-only)

Download a file stored in OneDrive. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/download-file.md

### `microsoft_onedrive-find-file-by-name` — Find File by Name (Read-only)

Search for a file or folder by name. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/find-file-by-name.md

### `microsoft_onedrive-get-file-by-id` — Get File by ID (Read-only)

Retrieves a file by ID. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/get-file-by-id.md

### `microsoft_onedrive-get-excel-table` — Get Table (Read-only)

Retrieve a table from an Excel spreadsheet stored in OneDrive See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/get-excel-table.md

### `microsoft_onedrive-list-files-in-folder` — List Files in Folder (Read-only)

Retrieves a list of the files and/or folders directly within a folder. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/list-files-in-folder.md

### `microsoft_onedrive-list-my-drives` — List My Drives (Read-only)

Get the signed-in user's drives. Returns a list of all the drives the user has access to, including the personal OneDrive. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/list-my-drives.md

### `microsoft_onedrive-list-shared-folder-reference-options` — List Shared Folder Reference Options (Read-only)

Retrieves available options for the Shared Folder Reference field.

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/list-shared-folder-reference-options.md

### `microsoft_onedrive-search-files` — Search Files (Read-only)

Search for files and folders in Microsoft OneDrive. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/search-files.md

### `microsoft_onedrive-upload-file` — Upload File (Write)

Upload a file to OneDrive. See the documentation

Full schema: https://pipedream.com/apps/microsoft-onedrive/actions/upload-file.md

## Triggers (2)

### `microsoft_onedrive-new-file-created` — New File Created (Instant) (Polling)

Emit new event when a new file is created in a OneDrive drive

Full schema: https://pipedream.com/apps/microsoft-onedrive/triggers/new-file-created.md

### `microsoft_onedrive-new-folder-created` — New Folder Created (Instant) (Polling)

Emit new event when a new folder is created in a OneDrive drive

Full schema: https://pipedream.com/apps/microsoft-onedrive/triggers/new-folder-created.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
