Skip to main content
Glama
Nextcloud Control Plane MCP Server

Nextcloud Control Plane MCP Server

by TheNovaNodes
module_type: mcp-server
status: active
protocol: mcp
primary_capability: nextcloud-administration
requires: docker, python>=3.10
works_with: nextcloud
last_verified: 2026-08-30

Nextcloud Control Plane MCP Server

Status: Active | Last Verified Date: 2026-08-30

Provides a Model Context Protocol (MCP) server for managing and administering Nextcloud instances via dockerized OCC commands.

What it does / does not do

What it does: Provides an MCP server that securely interfaces with a local Dockerized Nextcloud deployment via OCC (php occ) commands. It allows AI agents to retrieve Nextcloud system status, view/manage trusted domains, perform database optimizations, export Deck Kanban data, and execute arbitrary OCC commands. What it does not do: It does not run Nextcloud itself; it only controls a running Nextcloud Docker container (default: nextcloud_app_1). It interfaces via Docker Exec, not over HTTP via Nextcloud's Provisioning API.

Related MCP server: Nextcloud MCP Server

Why an agent would use it

Agents can use this to administer, configure, troubleshoot, and maintain a Nextcloud instance without requiring SSH access or manual GUI interaction, fully automating tasks like adding trusted domains when network topology changes, optimizing the database after upgrades, or exporting Deck boards.

Architecture and dependencies

  • Language: Python 3.10+

  • Protocol: Model Context Protocol (FastMCP)

  • Integrations: Executes commands against the local Docker daemon via asyncio.create_subprocess_exec.

  • Dependencies: mcp>=1.0.0, local Docker CLI.

Compatibility

  • Linux, macOS, or any host with a functional Docker CLI.

  • Compatible with any MCP client (Claude Desktop, Antigravity).

  • Designed for Nextcloud containers running with the www-data user.

Quick start and health check

pip install -e .
nextcloud-mcp-control

Health Check: Once connected via an MCP client, call the get_status tool to verify successful OCC communication with the container.

Configuration and environment variables

Variable

Description

Default

NC_CONTAINER_NAME

Target Nextcloud Docker container name

nextcloud_app_1

No other external environment variables are required beyond the host's standard Docker configuration.

Complete MCP tool/API table with side effects

Tool/API

Description

Side Effects

get_status()

Gets Nextcloud system status via occ status --output=json.

None: Read-only operation.

get_trusted_domains()

Lists configured trusted domains in Nextcloud.

None: Read-only operation.

add_trusted_domain(domain: str)

Adds a new trusted domain to Nextcloud configuration.

Modifies State: Updates config/config.php inside the Nextcloud container.

optimize_db()

Runs missing indices, missing columns, missing primary keys, and filecache bigint conversions.

Modifies State: Alters database schema and indices.

export_deck(user_id: str = "admin")

Exports Nextcloud Deck boards and cards for a specific user via occ deck:export.

None: Read-only operation.

run_occ(command: str)

Executes arbitrary OCC command inside the Nextcloud container.

Variable: Depending on the specific OCC command invoked.

Security model and trust boundaries

  • Trust Boundary: The server assumes the host running it has authorization to execute docker exec against the configured Nextcloud container. The MCP server runs with the same permissions as the user executing it.

  • Security Risks: The run_occ tool allows executing arbitrary administrative commands against the Nextcloud instance, which could be destructive (e.g., occ maintenance:install, occ app:disable, etc.). Agents with access to this MCP server have full administrative control over the Nextcloud container.

  • Design Philosophy & Upstream Reconciliation: This repository is a specialized, security-hardened reference implementation for TheNovaNodes ecosystem. Unlike some generic or upstream production Docker images (e.g., ghcr.io/cbcoutinho/...) which may blindly expose 90+ tools, this Control Plane intentionally exposes only a strictly minimized subset of critical tools. This deliberate reduction in the attack surface prevents autonomous agents from unintentionally triggering destructive commands, while still preserving manual execution capability via run_occ if explicitly required. (Fixes #3)

Tests and exact commands

Run the test suite using pytest:

pytest

Operations, logs, backup/restore, rollback

  • Operations & Logs: Logs are output to standard error via Python's logging module.

  • Backup/Restore: Since this server is stateless and interfaces with Nextcloud, standard Nextcloud backup procedures apply (database dump and file backup). No state is stored within the MCP server itself.

  • Rollback: To rollback changes made by add_trusted_domain, use run_occ to manually config:system:delete trusted_domains <index>.

Generic MCP-client example

Add this to your mcp_config.json or claude_desktop_config.json:

{
  "mcpServers": {
    "nextcloud-control": {
      "command": "python",
      "args": ["-m", "nextcloud_mcp_control.server"]
    }
  }
}

Limitations and roadmap

  • Operates on a single Nextcloud container per server instance (configurable via NC_CONTAINER_NAME).

  • Part of the TheNovaNodes and Antigravity Agent Ecosystem.

License

Refer to the repository license for details.

Available Tools

5 tools
add_trusted_domainA

Adds a new trusted domain to Nextcloud config. First checks current trusted domains to assign the next available index.

Args: domain: Domain name or IP address to add (e.g. 'cloud.example.com' or '192.168.1.100')

Inputs: domain (required). Returns: result

get_statusA

Gets the Nextcloud system status via OCC status --output=json.

Inputs: no named parameters. Returns: result

get_trusted_domainsA

Lists configured trusted domains in Nextcloud via OCC config:system:get trusted_domains.

Inputs: no named parameters. Returns: result

optimize_dbA

Runs database optimization commands on Nextcloud:

  • db:add-missing-indices

  • db:add-missing-columns

  • db:add-missing-primary-keys

  • db:convert-filecache-bigint

Inputs: no named parameters. Returns: result

run_occA

Executes arbitrary OCC command inside the Nextcloud container (nextcloud-app).

Args: command: The occ command string, e.g. "status --output=json" or "app:list"

Inputs: command (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clear and distinct role: run_occ is a generic executor, while get_status, get_trusted_domains, add_trusted_domain, and optimize_db are specific conveniences. Although run_occ can technically perform the others' tasks, the descriptions make the boundaries clear and no two tools appear interchangeable.

    Naming Consistency5/5

    All tools follow a consistent snake_case verb_noun pattern (run_occ, get_status, get_trusted_domains, add_trusted_domain, optimize_db). The verbs clearly indicate the action and the nouns the target, making the naming predictable and uniform.

    Tool Count5/5

    With 5 tools, the server is well-scoped for a focused Nextcloud control plane. Each tool serves a distinct administrative purpose, and the count is neither too sparse nor excessive for the stated domain.

    Completeness5/5

    The presence of run_occ ensures full coverage of all possible occ commands, so there are no missing operations for the domain. The specific wrappers cover common tasks like status, trusted domains, and DB optimization, and any other need can be fulfilled via run_occ.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to interact with Nextcloud instances through 30 tools across Notes, Calendar, Contacts, Tables, and WebDAV file operations, featuring a powerful unified search system for finding files without exact paths.
      21 npm
      38
      AGPL 3.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Connects AI assistants to Nextcloud instances with 90+ tools for managing notes, calendars, contacts, files, recipes, and more through natural language conversations. Supports semantic search and multiple deployment options.
      6,408 PyPI
      410
      AGPL 3.0
    • A
      license
      B
      quality
      C
      maintenance
      Enables system automation and control including command execution, process management, network tools, environment variables, disk usage, and service status.
      11
      MIT

    Appeared in Searches