From eb022e2376dcf04ad6167be26d9fd1b4e93b3e7d Mon Sep 17 00:00:00 2001 From: Marcus van Elst Date: Thu, 16 Apr 2026 21:39:57 +0200 Subject: [PATCH] fix(circles): protect primary circle from rename in update_circle (v0.7.5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds isFirstFamily check to update_circle — mirrors the same guard already present in delete_circle. Attempting to rename the primary circle now returns a clear error instead of silently renaming it. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 7 ++++--- README.md | 4 ++-- pyproject.toml | 2 +- src/mcp_familywall/__init__.py | 2 +- src/mcp_familywall/server.py | 16 ++++++++++++++++ 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 71a5046..9afc7a9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,7 +24,7 @@ und wird in Claude Desktop eingebunden. ## Aktueller Stand -### Implementierte Tools (v0.7.4) +### Implementierte Tools (v0.7.5) | Kategorie | Tools | |---|---| @@ -49,8 +49,9 @@ und wird in Claude Desktop eingebunden. - v0.7.1: get_lists scope fix + create_list circle_id + delete_list scope ✓ - v0.7.2: delete_circle ✓ - v0.7.3: update_list (Umbenennen, emoji/color ändern) ✓ -- v0.7.4: update_circle (Kreis umbenennen) ✓ ← aktuell -- v0.7.5: mpadditemtolist (Zutaten → Einkaufsliste) +- v0.7.4: update_circle (Kreis umbenennen) ✓ +- v0.7.5: Primärkreis-Schutz in update_circle (isFirstFamily-Check) ✓ ← aktuell +- v0.7.6: mpadditemtolist (Zutaten → Einkaufsliste) - v0.8.x: Erinnerungen + Wiederholungen (Premium-Account erforderlich) - v2.0: Schreibzugriff auf Wall-Posts (Erstellen, Kommentieren) diff --git a/README.md b/README.md index f4f6d74..4bdbd1e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ MCP server for [Family Wall](https://www.familywall.com) -- read and manage your family's circles, lists, tasks, and recipes directly from Claude. -## Features (v0.7.4) +## Features (v0.7.5) ### Read @@ -31,7 +31,7 @@ MCP server for [Family Wall](https://www.familywall.com) -- read and manage your - `update_recipe` -- update any field of an existing recipe (partial update — omitted fields unchanged) - `delete_recipe` -- permanently delete a recipe (only own recipes) - `create_circle` -- create a new Family Wall circle (group) -- `update_circle` -- rename a circle (server capitalises first letter; only name is changeable via API) +- `update_circle` -- rename a circle (server capitalises first letter; only name is changeable via API; primary circle is protected) - `delete_circle` -- permanently delete a circle and all its content (primary circle is protected) - `add_member_to_circle` -- invite a person to a circle by e-mail (for new Family Wall users only; existing accounts require in-app invitation) diff --git a/pyproject.toml b/pyproject.toml index 77ea8c8..fdef5d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "mcp-familywall" -version = "0.7.4" +version = "0.7.5" description = "MCP server for Family Wall — read your family's lists and tasks via Claude" readme = "README.md" requires-python = ">=3.12" diff --git a/src/mcp_familywall/__init__.py b/src/mcp_familywall/__init__.py index ed9d4d8..ab55bb1 100644 --- a/src/mcp_familywall/__init__.py +++ b/src/mcp_familywall/__init__.py @@ -1 +1 @@ -__version__ = "0.7.4" +__version__ = "0.7.5" diff --git a/src/mcp_familywall/server.py b/src/mcp_familywall/server.py index 1e904b8..bda9720 100644 --- a/src/mcp_familywall/server.py +++ b/src/mcp_familywall/server.py @@ -1399,6 +1399,22 @@ def update_circle(circle_id: str, name: str) -> str: indent=2, ) + if target.get("isFirstFamily") == "true": + client.logout() + return json.dumps( + { + "error": "Cannot rename the primary circle.", + "id": circle_id, + "name": target.get("name"), + "hint": ( + "The primary (first) circle cannot be renamed via the API. " + "Use the Family Wall app settings to manage it." + ), + }, + ensure_ascii=False, + indent=2, + ) + # Rename the circle. # Verified: accupdatefamily with scope= targets any circle, # both primary and secondary. The server capitalises the first letter.