Onedrive CLI logo

Onedrive CLI

Read-only stdio MCP access to browse, search, inspect, and read files from a personal OneDrive.

Install Onedrive CLI

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "onedrive-cli": {
      "command": "npx",
      "args": [
        "-y",
        "@lionello/onedrive-cli"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @lionello/onedrive-cli

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

onedrive-cli provides a cross-platform command-line interface and a read-only MCP server for Microsoft OneDrive Personal. Its `mcp` command runs over stdio and reuses an OAuth access token saved by the CLI's browser-based login flow. MCP clients can list folders, search content, find files, inspect metadata, read text files, browse albums, and check storage usage. Reach for it when an agent needs controlled, read-only access to a personal OneDrive rather than file mutations.

Use cases

  • Browse OneDrive folders from an MCP client
  • Search drive contents by text or filename
  • Read text files into an agent workflow
  • Inspect file metadata and storage usage
  • Manage OneDrive files from a terminal

Key features

  • Read-only MCP server over stdio
  • Full-text drive search
  • Recursive filename and glob search
  • OneDrive album browsing
  • OAuth browser login with stored token
  • Filesystem-style CLI operations

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

15/15 checks healthy over the last 31d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · @lionello/onedrive-cli (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars179Stargazers on the source repository.
npm downloads196Package downloads in the last 30 days.
Last commit8d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.

How Onedrive CLI works

What onedrive-cli does

onedrive-cli connects command-line workflows and MCP clients to Microsoft OneDrive Personal. The CLI treats the remote drive in a filesystem-like way, with commands for listing folders, reading files, searching by name or content, copying and moving files, creating folders, deleting items, managing sharing permissions, and checking storage usage.

It also supports OneDrive photo albums. Albums are separate collections that reference files rather than containing them, so removing a photo from an album does not remove the underlying file. The CLI can list, create, and edit albums, including adding and removing photos.

The MCP interface is intentionally read-only. It exposes OneDrive data to an MCP client without providing operations that modify the drive.

How it works

Install the package with npm, Nix, or from a source checkout. The installed command is onedrive; onedrive-cli is available as an alias. Run onedrive login to open Microsoft's login page. After authentication, the command receives an OAuth access token through a local callback flow and stores it in ~/.onedrive-cli-token, or under $XDG_STATE_HOME when that variable is set.

Start the MCP endpoint with onedrive mcp. It communicates over standard input and output, allowing an MCP client to launch it as a local process. The MCP process reuses the token saved by login, so authentication must happen before connecting the client. Tokens expire after one hour; running login again refreshes access. The -r option requests a read-only token and is appropriate for MCP use.

A Claude Desktop configuration can launch the server with the onedrive command and the mcp argument.

Setup and configuration

Install globally with:

Terminal
npm install -g @lionello/onedrive-cli

Then authenticate and verify access:

sh
onedrive login
onedrive df
onedrive ls

For a source installation, clone the repository, run npm install, and use bin/onedrive login. A Nix installation and development environment are also available. Set XDG_STATE_HOME if the token should be stored in an XDG state directory instead of the default location.

Register the stdio process in an MCP client using a command entry equivalent to:

config.json
{
  "mcpServers": {
    "onedrive": {
      "command": "onedrive",
      "args": ["mcp"]
    }
  }
}

Tools and capabilities

The MCP server provides these operations:

  • list_onedrive_folder lists the direct contents of a folder.
  • search_onedrive_content performs full-text search across the drive.
  • find_onedrive_files recursively finds items by name glob.
  • list_onedrive_albums lists albums or the items in a selected album.
  • read_onedrive_file returns a file's contents as text.
  • stat_onedrive_item returns complete item metadata.
  • onedrive_storage reports storage quota for available drives.

The command-line interface adds write and transfer operations, including local-to-remote and remote-to-local copies, moves, folder creation, deletion, sharing-link creation, invitation emails, permission changes, and server-side URL downloads. It also includes cat, grep, find, ls, stat, and storage reporting commands.

Limitations and notes

The MCP endpoint only issues GET requests and cannot change files, folders, permissions, or albums. OneDrive Personal is the supported service; OneDrive for Business is not included in the supported scope.

Authentication tokens last one hour, so an expired-token error requires another login. The CLI's copy command does not copy folders directly, and a copy fails when the destination already contains an item with the same name. Local and remote paths can be disambiguated with ./ and :/ prefixes.

Album deletion is not supported through the API and must be performed in the OneDrive web interface. The chmod command supports specific sharing-mode forms rather than unrestricted octal permission semantics.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Onedrive CLI

onedrive-cli is an MCP server that connects MCP clients to Microsoft OneDrive Personal. Its read-only tools list folders, search drive content, find files by name, browse albums, read text files, inspect item metadata, and report storage usage. It runs locally over stdio and reuses the CLI's stored OAuth token.

Install it globally with `npm install -g @lionello/onedrive-cli`, then run `onedrive login` and configure your MCP client to launch `onedrive mcp`. The package can also be installed with Nix or built from a source checkout.

Run `onedrive login` to open Microsoft's login page and save an OAuth token locally. The token is stored in `~/.onedrive-cli-token`, or under `$XDG_STATE_HOME` when set, and expires after one hour. Use `login -r` when requesting a read-only token for MCP access.

No, the MCP server is read-only and only issues GET requests. It can browse, search, read, inspect, and report storage information, while the separate CLI supports operations such as copying, moving, creating, and deleting items.

Yes, Claude Desktop can launch it as a stdio MCP server. Add an MCP entry with `command` set to `onedrive` and `args` set to `["mcp"]`, then authenticate with `onedrive login` before using the connection.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewOnedrive CLI AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/onedrive-cli?style=directory)](https://allmcps.com/mcp/onedrive-cli)
HTML Embed
<a href="https://allmcps.com/mcp/onedrive-cli"><img src="https://allmcps.com/api/badge/onedrive-cli?style=directory" alt="Onedrive CLI on AllMCPs" /></a>