From 165ec492aa9bc07a4b014007149655a1ab2111d8 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Sat, 25 Apr 2026 13:05:58 +0200 Subject: [PATCH 1/3] feat: add Claude Desktop extension (.mcpb) for single-user stdio mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a `mcpb/` directory containing a Claude Desktop Extension bundle that lets users install nextcloud-mcp-server from Claude Desktop without needing HTTPS — the extension uses stdio transport (already supported via `nextcloud_mcp_server/stdio.py`) so no network connection or TLS is required. Bundle contents: - `manifest.json` — extension metadata, user_config fields for NEXTCLOUD_HOST, NEXTCLOUD_USERNAME, and NEXTCLOUD_PASSWORD (sensitive, stored in OS keychain) - `run.sh` — shell wrapper that locates `uvx` across common install paths (official uv installer at ~/.local/bin, Homebrew at /opt/homebrew/bin, etc.) since Claude Desktop uses a restricted PATH - `.gitignore` — excludes the built *.mcpb artifact Build the distributable with: npm install -g @anthropic-ai/mcpb cd mcpb && mcpb pack Co-Authored-By: Claude Sonnet 4.6 --- mcpb/.gitignore | 1 + mcpb/manifest.json | 53 ++++++++++++++++++++++++++++++++++++++++++++++ mcpb/run.sh | 14 ++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 mcpb/.gitignore create mode 100644 mcpb/manifest.json create mode 100644 mcpb/run.sh diff --git a/mcpb/.gitignore b/mcpb/.gitignore new file mode 100644 index 00000000..d557af47 --- /dev/null +++ b/mcpb/.gitignore @@ -0,0 +1 @@ +*.mcpb diff --git a/mcpb/manifest.json b/mcpb/manifest.json new file mode 100644 index 00000000..fdb140b1 --- /dev/null +++ b/mcpb/manifest.json @@ -0,0 +1,53 @@ +{ + "manifest_version": "0.2", + "name": "nextcloud-mcp", + "version": "0.72.4", + "display_name": "Nextcloud MCP", + "description": "Access your Nextcloud instance (Notes, Calendar, Contacts, Files, Deck, Tables) from Claude Desktop.", + "long_description": "Connects Claude Desktop to your Nextcloud server via stdio transport. Supports Notes, Calendar (CalDAV), Contacts (CardDAV), Files (WebDAV), Deck, Tables, and Cookbook. Requires uv (https://docs.astral.sh/uv/) to be installed.", + "author": { + "name": "nextcloud-mcp-server contributors" + }, + "repository": { + "type": "git", + "url": "https://github.com/cbcoutinho/nextcloud-mcp-server" + }, + "homepage": "https://github.com/cbcoutinho/nextcloud-mcp-server", + "license": "AGPL-3.0", + "keywords": ["nextcloud", "notes", "calendar", "contacts", "files", "deck"], + "server": { + "type": "python", + "entry_point": ".", + "mcp_config": { + "command": "/bin/sh", + "args": ["${__dirname}/run.sh"], + "env": { + "NEXTCLOUD_HOST": "${user_config.nextcloud_host}", + "NEXTCLOUD_USERNAME": "${user_config.nextcloud_username}", + "NEXTCLOUD_PASSWORD": "${user_config.nextcloud_password}" + } + } + }, + "tools_generated": true, + "user_config": { + "nextcloud_host": { + "type": "string", + "title": "Nextcloud URL", + "description": "Your Nextcloud instance URL, e.g. https://cloud.example.com", + "required": true + }, + "nextcloud_username": { + "type": "string", + "title": "Username", + "description": "Your Nextcloud username", + "required": true + }, + "nextcloud_password": { + "type": "string", + "title": "App Password", + "description": "A Nextcloud app password (Settings \u2192 Security \u2192 App passwords). Stored securely in the OS keychain.", + "sensitive": true, + "required": true + } + } +} diff --git a/mcpb/run.sh b/mcpb/run.sh new file mode 100644 index 00000000..fc5fc81e --- /dev/null +++ b/mcpb/run.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# Locate uvx — tries the official uv installer location first, then Homebrew, then PATH +for candidate in \ + "$HOME/.local/bin/uvx" \ + "/opt/homebrew/bin/uvx" \ + "/usr/local/bin/uvx" \ + "/home/linuxbrew/.linuxbrew/bin/uvx"; do + if [ -x "$candidate" ]; then + exec "$candidate" nextcloud-mcp-server run --transport stdio + fi +done + +# Fall back to whatever is in PATH +exec uvx nextcloud-mcp-server run --transport stdio From 819484015bd785b29018e65ff07b39e82c41eaa6 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Sat, 25 Apr 2026 19:17:23 +0200 Subject: [PATCH 2/3] fix(mcpb): address review feedback on manifest and run.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use SPDX identifier AGPL-3.0-only (consistent with pyproject.toml) - Add compatibility.platforms: [darwin, linux] — run.sh uses /bin/sh and is not compatible with Windows; this surfaces that at install time rather than silently failing to launch - Improve run.sh fallback: use 'command -v uvx' before exec so a missing uvx prints a clear error with install instructions instead of a generic shell 'not found' message Co-Authored-By: Claude Sonnet 4.6 --- mcpb/manifest.json | 5 ++++- mcpb/run.sh | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mcpb/manifest.json b/mcpb/manifest.json index fdb140b1..8cd1166c 100644 --- a/mcpb/manifest.json +++ b/mcpb/manifest.json @@ -13,7 +13,7 @@ "url": "https://github.com/cbcoutinho/nextcloud-mcp-server" }, "homepage": "https://github.com/cbcoutinho/nextcloud-mcp-server", - "license": "AGPL-3.0", + "license": "AGPL-3.0-only", "keywords": ["nextcloud", "notes", "calendar", "contacts", "files", "deck"], "server": { "type": "python", @@ -28,6 +28,9 @@ } } }, + "compatibility": { + "platforms": ["darwin", "linux"] + }, "tools_generated": true, "user_config": { "nextcloud_host": { diff --git a/mcpb/run.sh b/mcpb/run.sh index fc5fc81e..030dffa2 100644 --- a/mcpb/run.sh +++ b/mcpb/run.sh @@ -10,5 +10,14 @@ for candidate in \ fi done -# Fall back to whatever is in PATH -exec uvx nextcloud-mcp-server run --transport stdio +# Fall back to uvx on PATH if found +if command -v uvx > /dev/null 2>&1; then + exec uvx nextcloud-mcp-server run --transport stdio +fi + +# uvx not found — print actionable error and exit +echo "Error: 'uvx' was not found in any expected location." >&2 +echo "Install uv (which provides uvx) from: https://docs.astral.sh/uv/getting-started/installation/" >&2 +echo " macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh" >&2 +echo " Homebrew: brew install uv" >&2 +exit 1 From a89cefc53e67fe12d3416f9b8d8be74715567879 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Sat, 25 Apr 2026 19:25:03 +0200 Subject: [PATCH 3/3] fix(mcpb): add Windows support via platform_overrides and run.cmd The previous manifest hardcoded /bin/sh which fails on Windows. Fix by: - Adding mcpb/run.cmd: Windows batch wrapper that searches common uvx install locations (%USERPROFILE%\.local\bin, %LOCALAPPDATA%\uv\bin, %USERPROFILE%\.cargo\bin) before falling back to PATH, with a clear error message pointing to winget/PowerShell install instructions - Adding platform_overrides.win32 in mcp_config to use cmd /c run.cmd on Windows while macOS/Linux continue using /bin/sh run.sh - Expanding compatibility.platforms to include win32 Co-Authored-By: Claude Sonnet 4.6 --- mcpb/manifest.json | 8 +++++++- mcpb/run.cmd | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 mcpb/run.cmd diff --git a/mcpb/manifest.json b/mcpb/manifest.json index 8cd1166c..2b19bf44 100644 --- a/mcpb/manifest.json +++ b/mcpb/manifest.json @@ -25,11 +25,17 @@ "NEXTCLOUD_HOST": "${user_config.nextcloud_host}", "NEXTCLOUD_USERNAME": "${user_config.nextcloud_username}", "NEXTCLOUD_PASSWORD": "${user_config.nextcloud_password}" + }, + "platform_overrides": { + "win32": { + "command": "cmd", + "args": ["/c", "${__dirname}/run.cmd"] + } } } }, "compatibility": { - "platforms": ["darwin", "linux"] + "platforms": ["darwin", "linux", "win32"] }, "tools_generated": true, "user_config": { diff --git a/mcpb/run.cmd b/mcpb/run.cmd new file mode 100644 index 00000000..22c50633 --- /dev/null +++ b/mcpb/run.cmd @@ -0,0 +1,27 @@ +@echo off +REM Locate uvx — tries common Windows install locations first, then PATH + +for %%P in ( + "%USERPROFILE%\.local\bin\uvx.exe" + "%USERPROFILE%\.cargo\bin\uvx.exe" + "%LOCALAPPDATA%\uv\bin\uvx.exe" +) do ( + if exist %%P ( + %%P nextcloud-mcp-server run --transport stdio + exit /b %errorlevel% + ) +) + +REM Fall back to uvx on PATH if found +where uvx >nul 2>&1 +if %errorlevel% equ 0 ( + uvx nextcloud-mcp-server run --transport stdio + exit /b %errorlevel% +) + +REM uvx not found — print actionable error +echo Error: 'uvx' was not found in any expected location. >&2 +echo Install uv (which provides uvx) from: https://docs.astral.sh/uv/getting-started/installation/ >&2 +echo Windows: winget install astral-sh.uv >&2 +echo or: powershell -c "irm https://astral.sh/uv/install.ps1 | iex" >&2 +exit /b 1