Cloudreve MCP Server
This MCP server enables file management and local caching for Cloudreve v4 through OAuth authentication, allowing operations like listing, uploading, downloading, and sharing files via natural language in MCP-compatible clients.
README
Cloudreve v4 MCP
Standalone Model Context Protocol server for Cloudreve v4. It authenticates with a registered OAuth application (authorization code + PKCE), then exposes file and local-cache tools over stdio for Cursor and other MCP clients.
Not published on npm — run it with npx from GitHub (github:SanderCokart/cloudreve-mcp).
Features
- OAuth authorize / status / logout with secure local token storage
- File tools: list, resolve id, properties, download URL, download, upload, create directory, rename, move, copy, delete, source URL, share URL
- Local cache helpers: list, write text, presign, download-to-cache, upload-from-cache
- Cloudreve v4 File URIs (
cloudreve://my/...) with friendly/pathinputs
Prerequisites
- Node.js 20+
- A Cloudreve v4 site (this MCP uses
/api/v4/...) - An OAuth app created in Cloudreve admin
Register an OAuth app
In Cloudreve admin → OAuth applications, create an app with:
| Field | Value |
|---|---|
| App name | e.g. Cursor Cloudreve MCP |
| Client secret | Generate and store securely |
| Redirect URI | http://127.0.0.1:53682/callback (must match CLOUDREVE_REDIRECT_URI) |
| Scopes | At least openid, profile, offline_access, plus file scopes such as Files.Read, Files.Write, Shares.Read, Shares.Write (exact names depend on your Cloudreve build) |
Copy the Client ID and Client Secret. Do not commit them to git or share them publicly.
offline_accessis required to receive a refresh token.
Cursor MCP setup
Add to ~/.cursor/mcp.json (Windows: %USERPROFILE%\.cursor\mcp.json):
{
"mcpServers": {
"cloudreve": {
"command": "npx",
"args": [
"-y",
"github:SanderCokart/cloudreve-mcp"
],
"env": {
"CLOUDREVE_BASE_URL": "https://cloud.example.com",
"CLOUDREVE_CLIENT_ID": "YOUR_CLIENT_ID",
"CLOUDREVE_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"CLOUDREVE_REDIRECT_URI": "http://127.0.0.1:53682/callback",
"CLOUDREVE_SCOPES": "openid profile offline_access Files.Read Files.Write Shares.Read Shares.Write"
}
}
}
}
Replace https://cloud.example.com and the OAuth placeholders with your own values. Endpoint overrides are optional; they are derived from CLOUDREVE_BASE_URL when omitted.
Reload MCP servers / restart Cursor, then call the authorize tool once. A browser window opens; after you approve, tokens are saved locally and other tools work.
Run from the terminal
npx -y github:SanderCokart/cloudreve-mcp
Set the same environment variables as in the Cursor env block before running.
Prefer
github:SanderCokart/cloudreve-mcpover the GitHub.tar.gzarchive URL. The archive install skips the package build on some platforms (notably Windows), so thecloudreve-mcpbinary is missing.
Environment
| Variable | Required | Description |
|---|---|---|
CLOUDREVE_BASE_URL |
Yes | Your Cloudreve site, e.g. https://cloud.example.com |
CLOUDREVE_CLIENT_ID |
Yes | OAuth Client ID |
CLOUDREVE_CLIENT_SECRET |
Yes | OAuth Client Secret |
CLOUDREVE_AUTH_ENDPOINT |
No | Authorization endpoint (default: {BASE}/session/authorize) |
CLOUDREVE_TOKEN_ENDPOINT |
No | Token endpoint (default: {BASE}/api/v4/session/oauth/token) |
CLOUDREVE_REFRESH_ENDPOINT |
No | Refresh endpoint (default: {BASE}/api/v4/session/token/refresh) |
CLOUDREVE_USERINFO_ENDPOINT |
No | User-info endpoint (default: {BASE}/api/v4/session/oauth/userinfo) |
CLOUDREVE_REDIRECT_URI |
No | Default http://127.0.0.1:53682/callback |
CLOUDREVE_SCOPES |
No | Space-separated scopes (see defaults above) |
CLOUDREVE_DOWNLOAD_ROOT |
No | Local download root |
CLOUDREVE_CACHE_ROOT |
No | Local cache root |
CLOUDREVE_TOKEN_STORE |
No | Path to tokens JSON (mode 0600) |
Tokens are stored under the platform config dir by default:
- Windows:
%APPDATA%/cloudreve-mcp/tokens.json - macOS:
~/Library/Application Support/cloudreve-mcp/tokens.json - Linux:
~/.config/cloudreve-mcp/tokens.json
First-run flow
sequenceDiagram
participant Cursor
participant MCP as CloudreveMCP
participant Browser
participant Cloudreve
Cursor->>MCP: authorize
MCP->>Browser: open /session/authorize (PKCE)
Browser->>Cloudreve: user login + consent
Cloudreve->>MCP: redirect code to localhost callback
MCP->>Cloudreve: POST /api/v4/session/oauth/token
Cloudreve->>MCP: access_token + refresh_token
MCP->>MCP: persist tokens (0600)
Cursor->>MCP: list_files / download_file / ...
MCP->>Cloudreve: Bearer access_token on /api/v4/*
Install from source (contributors)
git clone https://github.com/SanderCokart/cloudreve-mcp.git
cd cloudreve-mcp
npm install
npm run build
For local Cursor config, point command at node and args at the built dist/index.js, and set the same env block as above.
Copy .env.example for a local checklist of variables (do not commit a filled .env).
Tool notes
- Paths may be
/docs/a.mdor fullcloudreve://my/docs/a.md upload_file.remote_pathmust include the filenamedownload_file.local_pathis relative toCLOUDREVE_DOWNLOAD_ROOTand cannot escape it- Upload supports local / relay policies fully; OneDrive and generic pre-signed chunk uploads are best-effort
- Cache tools operate only under
CLOUDREVE_CACHE_ROOT
Development
npm run typecheck
npm test
npm run dev
License
Apache-2.0
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.