Skip to main content
Glama
Nextcloud MCP Server

Nextcloud MCP Server

by a-lagutov

Nextcloud MCP Server

English · Русский

MCP server for any Nextcloud instance. Files, search, upload/download (files and whole folders), shares and public links, favorites, trash bin. Works with any MCP client (Claude Code, Claude Desktop, Cursor, etc.).

Uses only official APIs: WebDAV (/remote.php/dav) and OCS (files_sharing). Requires Node.js ≥ 20.12.

Tools (23)

Tool

What it does

login

Sign in through the browser (Login Flow v2, SSO works); the app password is saved

disk_info

Used / available quota

list_files

Folder contents (sort, limit/offset)

get_file_info

Metadata: size, dates, MIME, file ID, permissions, web link

search_files

Server-side search by name (substring, case-insensitive) in a folder tree, MIME filter

recent_files

Files modified in the last N days

create_folder

Create a folder (with parents)

copy / move

Copy / move, rename

delete

Delete (several paths per call; to the trash bin)

upload_file

Upload a local file (chunked upload for files > 10 MB)

upload_folder

Upload a local folder recursively, in parallel

download

Download a file or a whole folder to this machine

read_file

Read a text file (first 200 KB)

set_favorite

Add / remove a favorite

create_share

Public link (password, expiry, label) or share with a user / group / email

list_shares

My shares (all, of a path; with subfiles — everything inside a folder at any depth)

list_shared_with_me

What others shared with me

update_share / delete_share

Change / remove a share

list_trash / restore_from_trash / clear_trash

Trash bin

Paths are relative to your files root: /, /Projects/logo.svg. A Files app link works as a path too: https://cloud.example.com/apps/files/files/123?dir=/Projects/.

Related MCP server: pCloud MCP

Installation

git clone https://github.com/a-lagutov/nextcloud-mcp.git
cd nextcloud-mcp
npm install
npm run build

Claude Code:

claude mcp add nextcloud -s user -- node /absolute/path/to/nextcloud-mcp/dist/index.js

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "nextcloud": { "command": "node", "args": ["/absolute/path/to/nextcloud-mcp/dist/index.js"] }
  }
}

Login

The server starts with no configuration. Ask Claude "log in to Nextcloud at https://cloud.example.com", or run npm run login -- --server https://cloud.example.com. The server address is remembered, so later logins need no server_url:

  1. The server's login page opens in your default browser — sign in as usual (SSO included) and click "Grant access".

  2. Nextcloud issues an app password for this server; it is saved to ~/.config/nextcloud-mcp/credentials.json (mode 600) and works at once, no restart.

The login tool waits up to 2 minutes, then returns the login link and finishes in the background (the link is valid for 20 minutes). To switch to another server, pass a new server_url / --server.

Without a browser (Docker, SSH): create an app password in Nextcloud → Settings → Security → "Create new app password", then pass login_name + app_password to login, or npm run login -- --user <LOGIN> --password <APP_PASSWORD>.

⚠️ The app password gives full access to your files. Revoke it at any time: Settings → Security → Devices & sessions (it is named nextcloud-mcp (<host>)).

Environment variables (optional)

They override the saved values — for example in Docker/CI.

Variable

Purpose

NEXTCLOUD_URL

Server URL, e.g. https://cloud.example.com

NEXTCLOUD_USER

Login name

NEXTCLOUD_APP_PASSWORD

App password

NEXTCLOUD_USER_ID

Internal user ID, if it differs from the login name (otherwise call login once)

Limitations

  • search_files searches names only, not file contents; at most 500 results per call.

  • list_files gets the whole folder in one PROPFIND and pages locally, so huge folders take a moment.

  • Deleting from a folder shared with you puts the item in the owner's trash bin, not yours.

License

MIT

Available Tools

23 tools
clear_trashA

Permanently delete one item from the trash bin, or empty the whole trash bin. Irreversible.

Inputs: trash_id.

copyB

Copy a file or folder. A destination ending with '/' means 'into this folder, same name'.

Inputs: to (required), from (required), overwrite.

create_folderB

Create a folder (missing parent folders are created too)

Inputs: path (required).

create_shareA

Share a file or folder: a public link (default), or with a user, group or email address. Returns the link for public shares.

Inputs: path (required), note, type, label, +4 more.

deleteA

Delete files or folders (they go to the trash bin of their owner; restore with restore_from_trash)

Inputs: paths (required).

delete_shareA

Remove a share or public link (ID from list_shares); the file itself stays

Inputs: share_id (required).

disk_infoA

Storage info of the Nextcloud account: used and available quota, server and user

Inputs: no named parameters.

downloadB

Download a file or a whole folder (recursively, parallel) to this machine. local_path is the target file, or an existing folder / path ending with '/' to download into.

Inputs: path (required), local_path (required), overwrite.

get_file_infoB

Detailed metadata of a file or folder: size, dates, type, file ID, permissions, web link

Inputs: path (required).

list_filesA

List files and folders at a path. Paths are relative to the user's files root, e.g. '/' or '/Projects'. A Files app link (…/apps/files/files/123?dir=/folder) works too.

Inputs: path, sort, limit, offset.

list_shared_with_meA

List files and folders other users shared with the current user (paths where they appear)

Inputs: no named parameters.

list_sharesA

List shares made by the user: all, or of one path; with subfiles also every share inside a folder at any depth

Inputs: path, subfiles.

list_trashA

List items in the trash bin, newest first

Inputs: limit.

loginA

Sign in to Nextcloud with Login Flow v2: opens the server's login page in the default browser, the user signs in (SSO works), and an app password is issued and saved. Waits up to 2 minutes, then keeps waiting in the background and returns the login URL. Call this when other tools report that the user is not logged in. Without a browser, pass login_name and app_password (Settings → Security → App passwords).

Inputs: login_name, server_url, app_password.

moveB

Move or rename a file or folder. A destination ending with '/' means 'into this folder, same name'.

Inputs: to (required), from (required), overwrite.

read_fileB

Read a text file (txt, md, json, csv, svg, …) and return its contents (first 200 KB)

Inputs: path (required).

recent_filesB

Files modified recently, newest first (server-side search by modification date)

Inputs: days, limit, folder.

restore_from_trashA

Restore an item from the trash bin to its original location (id from list_trash)

Inputs: trash_id (required).

search_filesA

Server-side search by name (case-insensitive substring) in a folder tree, newest first. Optional MIME filter. Without query lists everything matching the filter.

Inputs: limit, query, folder, mime_type.

set_favoriteB

Mark or unmark a file/folder as favorite

Inputs: path (required), favorite.

update_shareB

Change a share: permissions, password, expiry date, label or note (ID from list_shares)

Inputs: share_id (required), note, label, password, +2 more.

upload_fileA

Upload a local file. Big files are uploaded in chunks. A destination ending with '/' keeps the local name.

Inputs: path (required), local_path (required), overwrite.

upload_folderA

Upload a whole local folder recursively in one call (parallel). The folder is created inside path under its own name. Existing files are skipped unless overwrite=true.

Inputs: path (required), local_path (required), overwrite.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 23 tools

    Disambiguation4/5

    Most tools target clearly distinct resources and actions: file reads, metadata, search, upload/download, folder creation, move/copy/delete, sharing, and trash operations. A few pairs could be confused at first glance (read_file vs. download, get_file_info vs. disk_info), but descriptions clarify the boundaries well.

    Naming Consistency4/5

    The set mostly follows verb_noun patterns such as list_files, get_file_info, create_share, update_share, and restore_from_trash. There are some deviations—single-verb names like delete, copy, move, download, login—and noun-first names like disk_info and recent_files, but the naming remains readable and predictable.

    Tool Count4/5

    23 tools is on the high side, but the server covers a broad domain: file browsing, reading, upload/download, folder operations, sharing, favorites, trash, login, and storage info. Nearly every tool maps to a distinct operation, so the count is reasonable rather than bloated.

    Completeness4/5

    Core file and folder lifecycle operations are well covered, including listing, metadata, search, upload, download, copy/move/delete, sharing CRUD, and trash restore/empty. Minor gaps remain, such as no dedicated listing of favorites or direct text-file edit/write operation, but these are largely workable through existing tools.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to browse, read, write, search, and share files in a pCloud account over HTTPS, including folder management, trash access, and public link creation.
      1
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      A native Nextcloud app that exposes the instance as an MCP server so Claude and other MCP clients can read, search, and (with admin-granted permissions) edit files, notes, calendars, Deck cards, and Talk conversations. It runs inside Nextcloud with OAuth or app-password sign-in, applying each user's own Nextcloud permissions and admin-controlled per-operation grants.
      22
      AGPL 3.0