← Back to directory
O

OneDrive CLI

Community
Command line interface and read-only MCP server for OneDrive
GitHub source repository ↗
★ 171 Stars Category · Cloud Storage Very popular Source revision 5dc1d9e4da37
56FMRS · C
Reliability
8/20
Security and permissions
12/20
Maintenance
12/20
Documentation
13/20
Setup experience
11/20

onedrive-cli offers a cross-platform CLI for OneDrive Personal and a read-only MCP server, suitable for AI access to cloud files. It does not support OneDrive for Business, and it's a community project, not official. Users should handle tokens securely and prefer read-only tokens to reduce risk.

Read the FMRS scoring method →

onedrive-cli is a cross-platform command line tool for managing OneDrive (Personal). It also provides a read-only MCP server (over stdio) that lets MCP clients like Claude browse and read your OneDrive. The MCP server only issues GET requests and cannot modify the drive.

Tools

list_onedrive_folder
List direct children of a folder
search_onedrive_content
Full-text search across the whole drive
find_onedrive_files
Recursively find items by name glob
list_onedrive_albums
List photo albums or items in one album
read_onedrive_file
Read a file's contents as text
stat_onedrive_item
Return full metadata for an item
onedrive_storage
Report storage quota for the available drives

Setup

  1. Login to OneDrive: run onedrive login and follow the OAuth flow (recommend login -r for read-only token). 2. Add the server configuration to your MCP client (e.g., Claude Desktop) via claude_desktop_config.json with mcpServers. 3. The client will launch onedrive mcp automatically.
claude_desktop_config.json
{
  "mcpServers": {
    "onedrive": {
      "command": "onedrive",
      "args": [
        "mcp"
      ]
    }
  }
}

Fit and risk

Best for

  • Users who need AI access to personal OneDrive files
  • CLI enthusiasts
  • Scenarios requiring strictly read-only access

Not for

  • Write or modify scenarios
  • OneDrive for Business (not supported)
  • Enterprise-managed environments

Required permissions

  • Requires OAuth access token (read-only recommended)
  • Reads file contents, metadata, storage quota
  • Does not modify or delete any files

Risks and side effects

  • Token may be exposed, protect token file (~/.onedrive-cli-token)
  • MCP server only GET, but underlying token might have extra permissions; use read-only token
  • Upload not implemented, but other CLI commands can write; use read-only login for safety.

Troubleshooting

  1. Error 'Access token was not found; login first.': run `onedrive login` and complete OAuth.
  2. Token expires after 1 hour, re-login if needed.
  3. If MCP client fails to connect, ensure `onedrive` is in PATH and login was done.
  4. Verify JSON config file is valid.

Use cases

Let AI assistants browse and search your OneDrive files
Read documents, check storage usage
List albums and photos
Find files recursively

Supported clients

Claude DesktopFull support