nextcloud-mcp

nextcloud-mcp

A Model Context Protocol server that enables Claude to list, read, write, create, delete, and search files on a self-hosted Nextcloud instance via WebDAV, with additional Obsidian vault-aware operations for frontmatter, tags, backlinks, and wikilinks.

Category
访问服务器

README

Nextcloud MCP Server

A custom MCP (Model Context Protocol) server that gives Claude the ability to list, read, write, create folders in, delete, and search files in a self-hosted Nextcloud instance over WebDAV.

Works with Claude Desktop out of the box (local/stdio), with an optional HTTP/Docker version for remote setups.

Tools it exposes

File operations

Tool Description
list_files(path) List files/folders at a path
read_file(path) Read a text file's contents
write_file(path, content) Create or overwrite a text file
create_folder(path) Create a folder
delete_item(path) Delete a file or folder (permanent beyond trash retention)
search_files(query, path) Recursively search filenames

Obsidian vault operations

These understand Markdown notes as an Obsidian vault, not just plain files — parsing frontmatter, [[wikilinks]], and #tags the way Obsidian itself would. Built for the common setup where your vault syncs through Nextcloud (via the Nextcloud desktop client) rather than living in a local-only folder, which is what most Obsidian-focused MCP servers assume.

Tool Description
get_frontmatter(path) Read a note's YAML frontmatter as JSON
update_frontmatter(path, fields) Merge new fields into a note's frontmatter without touching the body
list_by_tag(tag, path) Find every note carrying a tag, frontmatter or inline
get_backlinks(note, path) Find every note that links to a given note
resolve_link(link_text, path) Resolve a wikilink to the actual file it points to, fuzzy-matched like Obsidian does
graph_neighbors(note, path, depth) List notes connected to a given note by links, out to N hops

Which version should I use?

  • server_stdio.py — Recommended for most people. Claude Desktop launches this locally as a subprocess and it talks to Nextcloud over your LAN/Tailscale/VPN directly. No public exposure needed.
  • server.py — An HTTP version for running as a standalone service (e.g. in Docker). Only needed if you want to add this as a remote custom connector in Claude — which requires the server to be reachable via a public HTTPS URL (e.g. behind a Cloudflare Tunnel or reverse proxy), since custom connectors are reached from Anthropic's cloud infrastructure, not your local device.

Setup — Claude Desktop (local, recommended)

  1. Clone this repo and install dependencies for the Python interpreter Claude Desktop will use:

    git clone https://github.com/yourusername/nextcloud-mcp.git
    cd nextcloud-mcp
    pip install -r requirements.txt
    
  2. Create a Nextcloud app password: in Nextcloud, go to Settings → Security → App passwords, create one (e.g. named claude-mcp), and save it somewhere safe. Don't use your real account password.

  3. Edit your Claude Desktop config file (claude_desktop_config.json):

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json

    Copy the contents of claude_desktop_config.example.json, and update:

    • args to the absolute path of server_stdio.py on your machine
    • NEXTCLOUD_URL, NEXTCLOUD_USER, NEXTCLOUD_PASSWORD to your own values
  4. Fully restart Claude Desktop (quit from the system tray/menu bar, not just close the window).

You should now see Nextcloud tools available in your conversations.

Setup — HTTP/Docker (remote custom connector)

  1. Copy .env.example to .env and fill in your Nextcloud URL, username, and app password.
  2. Build and run:
    docker compose up -d --build
    
  3. Expose the container's port (default 8765) via a public HTTPS URL — for example a Cloudflare Tunnel, Tailscale Funnel, or a reverse proxy with TLS. A private LAN address alone will not be reachable by Claude's custom connector setup.
  4. In Claude, add a custom connector pointing at https://your-public-url/mcp.

Troubleshooting

  • ModuleNotFoundError: No module named 'mcp.server.fastmcp' — you likely installed mcp version 2.x, which restructured the package. This project pins mcp>=1.6.0,<2.0.0 in requirements.txt; reinstall with that constraint.
  • ModuleNotFoundError for requests or mcp even after installing — if you have multiple Python versions installed, make sure you install dependencies against the exact interpreter Claude Desktop launches (check Claude Desktop's MCP logs for the interpreter path if unsure).
  • Server doesn't show up in Claude Desktop — make sure you fully restarted the app after editing the config, and double-check the args path is absolute and correct for your OS.

Security notes

  • Always use a scoped Nextcloud app password, not your real account password — revoke it anytime via Settings → Security → Devices & Sessions.
  • delete_item() is permanent beyond Nextcloud's trash retention. Use with care, especially since Claude can call it directly during a conversation.
  • Never commit your .env file or real credentials — .gitignore is already set up to exclude .env.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选