by lionello
Command line interface and MCP for OneDrive
# Add to your Claude Code skills
git clone https://github.com/lionello/onedrive-cliGuides for using mcp servers skills like onedrive-cli.
Last scanned: 7/18/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-07-18T06:04:03.433Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how onedrive-cli compares with popular alternatives.
onedrive-cli is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by lionello. Command line interface and MCP for OneDrive. It has 175 GitHub stars.
Yes. onedrive-cli passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/lionello/onedrive-cli" and add it to your Claude Code skills directory (see the Installation section above).
onedrive-cli is primarily written in JavaScript. It is open-source under lionello on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh onedrive-cli against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
30 days in the Featured rail · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
Cross-platform command line interface for OneDrive (Personal)
With npm:
npm install -g @lionello/onedrive-cli
That installs the command as onedrive, with onedrive-cli as an alias for it.
Or with nix-env:
nix-env -if https://github.com/lionello/onedrive-cli/archive/master.tar.gz -A package
Or from source:
git clone https://github.com/lionello/onedrive-cli.git
cd onedrive-cli
npm install
bin/onedrive login
Sign in once, then use the drive like a filesystem:
onedrive login # opens the Microsoft login page
onedrive df # check the connection and storage usage
onedrive ls # list your drive root
login opens your browser, then stores the access token it gets back in
~/.onedrive-cli-token (or $XDG_STATE_HOME if that is set). Tokens are valid
for one hour, so run login again when a command reports that the token
expired. Add -r for a read-only token.
usage: onedrive COMMAND [arguments]
Run onedrive help (or -h/--help) for this list at any time, and
onedrive --version for the installed version. The commands are:
album - list, create, or edit photo albums (ls/create/add/rm)cat - dumps the contents of a file to stdoutchmod - change sharing permissionscp - copies local file(s) to OneDrive or vice-versadf - shows OneDrive storage usage statsfind - find file(s) or folder(s) by name, optionally separated by NULgrep - full-text search across the drive, listing matching pathshelp - shows list of supported commandsln - create a link to the remote itemlogin - request/store an OAuth access tokenls - list the contents of a foldermcp - run a read-only MCP server over stdiomkdir - create a remote foldermv - move a local file to OneDrive or vice-versarm - delete a file or folder from OneDrivesendmail - send an invitation email for editing to recipientsstat - dump all information for particular file(s)wget - copy a remote URL to OneDrive (server side)onedrive ls Public
onedrive cat Documents/passwords | grep boa
onedrive wget http://mega.com/somehugepublicfile Documents/somehugepublicfile
find * -type f -print0 | xargs -0 -n1 -I{} onedrive cp "./{}" "Shared Favorites/{}"
onedrive find 'Pictures/Camera Roll' -regex 2015 -type f -print0 | xargs -0 onedrive mv -t :/Pictures/2015/
onedrive album create 'Summer 2026'
onedrive album add 'Summer 2026' 'Pictures/Camera Roll/IMG_1234.jpg'
onedrive albums # list all albums
onedrive albums 'Summer 2026' # list the photos in one album
Albums are OneDrive bundles:
they live outside the folder hierarchy and only reference the files, so
album rm removes a photo from the album without deleting the file.
Deleting an album itself is not supported by the API — use the OneDrive
web UI for that.
onedrive mcp starts a read-only Model Context Protocol
server over stdio, so an MCP client (Claude, etc.) can browse and read your
OneDrive. It reuses the stored access token, so login first — ideally with
login -r for a read-only token. The server only issues GET requests and
cannot modify the drive. It exposes these tools:
list_onedrive_folder - list the direct children of a foldersearch_onedrive_content - full-text search across the whole drivefind_onedrive_files - recursively find items by name globlist_onedrive_albums - list the photo albums, or the items in one albumread_onedrive_file - read a file's contents as textstat_onedrive_item - return full metadata for an itemonedrive_storage - report storage quota for the available drivesRegister it with your MCP client, e.g. in claude_desktop_config.json:
{
"mcpServers": {
"onedrive": {
"command": "onedrive",
"args": ["mcp"]
}
}
}
The onedrive utility needs an access token in order to read/write to your OneDrive storage.
Run onedrive login: it opens the Microsoft login page, and after you sign in the
callback page
hands the token straight back to the waiting command, which saves it to
~/.onedrive-cli-token. If the browser runs on another machine (or the handover
fails), the page shows the token so you can paste it at the prompt instead.
Tokens are valid for 1 hour.
Currently, a copy will fail if a file with the same it already exists. Change the name of the target, or use other means to delete/rename the existing file in your OneDrive.
You cannot copy folders. Specify a source file instead, or use wildcards.
The target file name cannot be determined from the source path. Specify a target file name.
The cp command supports both local->remote as well as remote->local copy.
To make it clear which path is remote and which is local, either use ./ as a prefix for
the local path, or use :/ as a prefix for the remote path. Either one will suffice.
The chmod command currently only supports -w or -rw. The former tried to downgrade write
shares to read-only, whereas the latter removes all shares for the given item(s). Octal modes are accepted (for example 644, 0700) as well as og-rw or g-w.
Tracked on the issue tracker, so this stays a pointer rather than a second source of truth:
createUploadSession)chmod: granting write access (+w)onedrive mcp)onedrive album)onedrive grep)onedrive rm)onedrive ln)async/awaitA Nix flake provides the package and a dev shell with all
dependencies. Run nix develop (or use Direnv's use flake)
for the shell, and nix build / nix run to build or run the CLI. The legacy
shell.nix still works with nix-shell.
After changing package-lock.json, refresh npmDepsHash in flake.nix:
nix run nixpkgs#prefetch-npm-deps -- package-lock.json
docs/index.html is generated from this README:
npm run readme