Skip to main content

Model Context Protocol (MCP) server for Nextcloud integration - enables AI assistants to interact with Nextcloud data

Project description

Nextcloud MCP Server

Nextcloud MCP Server

Docker Image

A production-ready MCP server that connects AI assistants to your Nextcloud instance.

Enable Large Language Models like Claude, GPT, and Gemini to interact with your Nextcloud data through a secure API. Create notes, manage calendars, organize contacts, work with files, and more - all through natural language conversations.

This is a dedicated standalone MCP server designed for external MCP clients like Claude Code and IDEs. It runs independently of Nextcloud (Docker, VM, Kubernetes, or local) and provides deep CRUD operations across Nextcloud apps.

[!NOTE] Looking for AI features inside Nextcloud? Nextcloud also provides Context Agent, which powers the Assistant app and runs as an ExApp inside Nextcloud. See docs/comparison-context-agent.md for a detailed comparison of use cases.

Quick Start

Run the server locally with uvx (no installation required):

NEXTCLOUD_HOST=https://your.nextcloud.instance.com \
NEXTCLOUD_USERNAME=your_username \
NEXTCLOUD_PASSWORD=your_app_password \
  uvx nextcloud-mcp-server run --transport stdio

Or add it directly to your MCP client configuration (e.g. claude_desktop_config.json or .claude/settings.json):

{
  "mcpServers": {
    "nextcloud": {
      "command": "uvx",
      "args": ["nextcloud-mcp-server", "run", "--transport", "stdio"],
      "env": {
        "NEXTCLOUD_HOST": "https://your.nextcloud.instance.com",
        "NEXTCLOUD_USERNAME": "your_username",
        "NEXTCLOUD_PASSWORD": "your_app_password"
      }
    }
  }
}

[!TIP] Generate an app password in Nextcloud under Settings > Security > Devices & sessions instead of using your login password.

Docker

For full features including semantic search, run with Docker:

# 1. Create a minimal configuration
cat > .env << EOF
NEXTCLOUD_HOST=https://your.nextcloud.instance.com
NEXTCLOUD_USERNAME=your_username
NEXTCLOUD_PASSWORD=your_app_password
EOF

# 2. Start the server
docker run -p 127.0.0.1:8000:8000 --env-file .env --rm \
  ghcr.io/cbcoutinho/nextcloud-mcp-server:latest

# 3. Test the connection
curl http://127.0.0.1:8000/health/ready

# 4. Connect to the endpoint
http://127.0.0.1:8000/mcp

Docker Compose Profiles (for development/testing):

docker compose --profile single-user up -d       # Port 8000
docker compose --profile multi-user-basic up -d   # Port 8003
docker compose --profile oauth up -d              # Port 8001
docker compose --profile login-flow up -d         # Port 8004

Next Steps:

Key Features

  • 110+ MCP Tools - Comprehensive API coverage across 10 Nextcloud apps
  • MCP Resources - Structured data URIs for browsing Nextcloud data
  • Semantic Search (Experimental) - Optional vector-powered search for Notes, Files, News items, and Deck cards (requires Qdrant + Ollama)
  • Document Processing - OCR and text extraction from PDFs, DOCX, images with progress notifications
  • Flexible Deployment - Docker, Kubernetes (Helm chart), VM, or local installation
  • Production-Ready Auth - Basic Auth with app passwords (recommended) or OAuth2/OIDC (experimental)
  • Multiple Transports - streamable-http (default) and stdio

Supported Apps

App Tools Capabilities
Notes 7 Full CRUD, keyword search, semantic search
Calendar 20+ Events, todos (tasks), recurring events, attendees, availability
Contacts 8 Full CardDAV support, address books
Files (WebDAV) 12 Filesystem access, OCR/document processing
Deck 15 Boards, stacks, cards, labels, assignments
Cookbook 13 Recipe management, URL import (schema.org)
Tables 5 Row operations on Nextcloud Tables
Sharing 10+ Create and manage shares
News 8 Feeds, folders, items, feed health monitoring
Collectives 16 Full CRUD on collectives, pages, and tags
Semantic Search 2+ Vector search for Notes, Files, News items, and Deck cards (experimental, opt-in, requires infrastructure)

Want to see another Nextcloud app supported? Open an issue or contribute a pull request!

Authentication

[!IMPORTANT] OAuth2/OIDC is experimental and requires a manual patch to the user_oidc app:

  • Required patch: Bearer token support (issue #1221)
  • Impact: Without the patch, most app-specific APIs fail with 401 errors
  • Recommendation: Use Basic Auth for production until upstream patches are merged

See docs/oauth-upstream-status.md for patch status and workarounds.

Recommended: Basic Auth with app-specific passwords provides secure, production-ready authentication. See docs/authentication.md for setup details and OAuth configuration.

Authentication Modes

The server supports four authentication modes:

Single-User (BasicAuth):

  • One set of credentials shared by all MCP clients
  • Simple setup: username + app password in environment variables
  • All clients access Nextcloud as the same user
  • Best for: Personal use, development, single-user deployments

Multi-User (BasicAuth Pass-Through):

  • MCP clients send credentials via Authorization header
  • Server passes through to Nextcloud (stateless by default)
  • Optional offline access for background operations (ENABLE_MULTI_USER_BASIC_AUTH=true)
  • Best for: Multi-user setups without OAuth infrastructure

Multi-User (OAuth):

  • Each MCP client authenticates separately with their own Nextcloud account
  • Per-user scopes and permissions (clients only see tools they're authorized for)
  • More secure: tokens expire, credentials never shared with server
  • Best for: Teams, multi-user deployments, production environments with multiple users
  • Requires: Patches to the user_oidc app (experimental)

Multi-User (Login Flow v2):

  • Uses Nextcloud's native Login Flow v2 to obtain per-user app passwords
  • No OAuth patches required — works with stock Nextcloud
  • Each user authenticates via browser, server manages app passwords
  • Best for: Multi-user deployments without OAuth infrastructure (ENABLE_LOGIN_FLOW=true)
  • Experimental: See ADR-022 for details

See docs/authentication.md for detailed setup instructions.

Semantic Search

The server provides an experimental RAG pipeline to enable Semantic Search that enables MCP clients to find information in Nextcloud based on meaning rather than just keywords. Instead of matching "machine learning" only when those exact words appear, it understands that "neural networks," "AI models," and "deep learning" are semantically related concepts.

Example:

  • Keyword search: Query "car" only finds notes containing "car"
  • Semantic search: Query "car" also finds notes about "automobile," "vehicle," "sedan," "transportation"

This enables natural language queries and helps discover related content across your Nextcloud notes.

[!NOTE] Semantic Search is experimental and opt-in:

  • Disabled by default (ENABLE_SEMANTIC_SEARCH=false)
  • Currently supports Notes app only (multi-app support planned)
  • Requires additional infrastructure: vector database + embedding service
  • Answer generation (nc_semantic_search_answer) requires MCP client sampling support

See docs/semantic-search-architecture.md for architecture details and docs/configuration.md for setup instructions.

Documentation

Getting Started

Features

Advanced Topics

Examples

Create a Note

AI: "Create a note called 'Meeting Notes' with today's agenda"
→ Uses nc_notes_create_note tool

Import Recipes

AI: "Import the recipe from https://www.example.com/recipe/chocolate-cake"
→ Uses nc_cookbook_import_recipe tool with schema.org metadata extraction

Schedule Meetings

AI: "Schedule a team meeting for next Tuesday at 2pm"
→ Uses nc_calendar_create_event tool

Manage Files

AI: "Create a folder called 'Project X' and move all PDFs there"
→ Uses nc_webdav_create_directory and nc_webdav_move tools

Semantic Search (Experimental, Opt-in)

AI: "Find notes related to machine learning concepts"
→ Uses nc_semantic_search to find semantically similar notes (requires Qdrant + Ollama setup)

Note: For AI-generated answers with citations, use nc_semantic_search_answer (requires MCP client with sampling support).

Contributing

Contributions are welcome!

Security

MseeP.ai Security Assessment

This project takes security seriously:

  • Production-ready Basic Auth with app-specific passwords
  • OAuth2/OIDC support (experimental, requires upstream patches)
  • Per-user access tokens
  • No credential storage in OAuth mode
  • Regular security assessments

Found a security issue? Please report it privately to the maintainers.

License

This project is licensed under the AGPL-3.0 License. See LICENSE for details.

Star History

Star History Chart

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nextcloud_mcp_server-0.72.4.tar.gz (369.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nextcloud_mcp_server-0.72.4-py3-none-any.whl (444.0 kB view details)

Uploaded Python 3

File details

Details for the file nextcloud_mcp_server-0.72.4.tar.gz.

File metadata

  • Download URL: nextcloud_mcp_server-0.72.4.tar.gz
  • Upload date:
  • Size: 369.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nextcloud_mcp_server-0.72.4.tar.gz
Algorithm Hash digest
SHA256 fc1f64e0a43049956c6aec709e4b3cf74fb0479e392d3154bb459ee7a0551f45
MD5 60560a28dbd7121a0d7c1c75807d74fa
BLAKE2b-256 86013b70b3b8f963f7376592d3b9f6e9791cb90678e990d00180555e02534698

See more details on using hashes here.

File details

Details for the file nextcloud_mcp_server-0.72.4-py3-none-any.whl.

File metadata

  • Download URL: nextcloud_mcp_server-0.72.4-py3-none-any.whl
  • Upload date:
  • Size: 444.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nextcloud_mcp_server-0.72.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a93c3cf521ee5fce9de2b959ab51f8a182edd5b9bb2b27f2f98eed7e402a8991
MD5 26ffb83c04245e8514047d018b34a27e
BLAKE2b-256 8a892128bfc33f04c93a3bf10da11ec8fcda56323642d6dd286f91a5b6ec3b11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page