Compare commits

...

48 Commits

Author SHA1 Message Date
Chris Coutinho ec8eab99f3 fix: strip whitespace from category names when splitting
Trim whitespace from comma-separated category values in all three
methods: _create_ical_event, _merge_ical_properties, and
_merge_ical_todo_properties. Prevents leading/trailing spaces in
category names from inputs like "work, meeting".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 23:46:28 +01:00
Chris Coutinho da104c59ac fix: handle categories, recurrence_rule, attendees, and reminder_minutes in update_event
_merge_ical_properties() only handled a subset of event fields, silently
dropping categories, recurrence_rule, attendees, and reminder_minutes
during updates. These fields were fully supported by _create_ical_event()
and accepted by the MCP tool, but never applied.

Closes #544

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 23:15:37 +01:00
github-actions[bot] b3e55d444b bump: version 0.57.40 → 0.57.41 2026-02-08 12:57:42 +00:00
github-actions[bot] 1786e204ec bump: version 0.63.2 → 0.63.3 2026-02-08 12:57:41 +00:00
Chris Coutinho 0a599c5c03 Merge pull request #543 from cbcoutinho/fix/recurring-event-expansion
fix: expand recurring events in date-range queries
2026-02-08 13:57:22 +01:00
Chris Coutinho 66e32d4705 fix: expand recurring events in date-range queries
PR #539 fixed date-range filtering so events outside the queried range
are excluded. However, recurring events still returned the master event
with its original DTSTART instead of expanded occurrences.

Add <C:expand> element to CalDAV REPORT requests (RFC 4791 §9.6.5) when
both date bounds are provided, so the server returns one VEVENT per
occurrence with the correct DTSTART. Refactor VEVENT parsing into a
shared helper and add _parse_all_ical_events() to handle multi-VEVENT
responses from expanded results.

Closes #538

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 12:43:40 +01:00
github-actions[bot] 8603ed114e bump: version 0.57.39 → 0.57.40 2026-02-07 16:38:25 +00:00
github-actions[bot] 7e6ef90423 bump: version 0.63.1 → 0.63.2 2026-02-07 16:38:24 +00:00
Chris Coutinho c5f2c8369f Merge pull request #539 from cbcoutinho/fix/calendar-date-range-filtering
fix: use CalDAV time-range filter for calendar date range queries
2026-02-07 17:38:05 +01:00
Chris Coutinho b79ac29a9d fix: use CalDAV time-range filter for calendar date range queries
get_calendar_events() accepted start/end datetime parameters but called
calendar.events() which fetches all events, silently discarding the
date filters. This caused nc_calendar_list_events and
nc_calendar_get_upcoming_events to return the entire calendar history.

Add _search_events_by_date() helper that builds a CalDAV REPORT query
with a <time-range> filter (RFC 4791 §9.9) for server-side filtering.
Falls back to calendar.events() when no dates are given.

Closes #538

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 17:35:33 +01:00
github-actions[bot] 334d62825c bump: version 0.57.38 → 0.57.39 2026-02-07 14:49:39 +00:00
Chris Coutinho 2233cb423c Merge pull request #537 from cbcoutinho/renovate/docker.io-library-python-3.12-slim-trixie
chore(deps): update docker.io/library/python:3.12-slim-trixie docker digest to 9e01bf1
2026-02-07 15:49:23 +01:00
github-actions[bot] 196a6cdfb2 bump: version 0.57.37 → 0.57.38 2026-02-07 14:47:36 +00:00
Chris Coutinho 93f5e70128 Merge pull request #519 from cbcoutinho/renovate/astral-sh-setup-uv-7.x
chore(deps): update astral-sh/setup-uv action to v7.3.0
2026-02-07 15:47:20 +01:00
renovate-bot-cbcoutinho[bot] e5248e70ee chore(deps): update astral-sh/setup-uv action to v7.3.0 2026-02-07 11:10:43 +00:00
renovate-bot-cbcoutinho[bot] 018b946b5b chore(deps): update docker.io/library/python:3.12-slim-trixie docker digest to 9e01bf1 2026-02-07 11:10:27 +00:00
github-actions[bot] 863ba0d52a bump: version 0.57.36 → 0.57.37 2026-02-06 20:08:06 +00:00
Chris Coutinho d3903c5e2e Merge pull request #529 from cbcoutinho/renovate/ollama-1.x
chore(deps): update helm release ollama to v1.41.0
2026-02-06 21:07:48 +01:00
github-actions[bot] 6ea97c5b88 bump: version 0.57.35 → 0.57.36 2026-02-06 17:44:50 +00:00
Chris Coutinho c12c825b11 Merge pull request #530 from cbcoutinho/renovate/hoverkraft-tech-compose-action-2.x
chore(deps): update hoverkraft-tech/compose-action action to v2.5.0
2026-02-06 18:44:32 +01:00
github-actions[bot] 3d8f7692a8 bump: version 0.57.34 → 0.57.35 2026-02-06 15:18:18 +00:00
Chris Coutinho b21c874c14 Merge pull request #531 from cbcoutinho/renovate/docker.io-library-nginx-alpine
chore(deps): update docker.io/library/nginx:alpine docker digest to 5878d06
2026-02-06 16:18:00 +01:00
github-actions[bot] a4661099e5 bump: version 0.57.33 → 0.57.34 2026-02-06 14:49:36 +00:00
Chris Coutinho a46d74d999 Merge pull request #522 from cbcoutinho/renovate/anthropics-claude-code-action-1.x
chore(deps): update anthropics/claude-code-action action to v1.0.45
2026-02-06 15:49:19 +01:00
github-actions[bot] 92f69c8dba bump: version 0.57.32 → 0.57.33 2026-02-06 14:23:11 +00:00
Chris Coutinho 6692a85007 Merge pull request #534 from cbcoutinho/renovate/uv_build-0.x
chore(deps): update dependency uv_build to >=0.10.0,<0.11.0
2026-02-06 15:22:55 +01:00
github-actions[bot] 1f09079b5a bump: version 0.57.31 → 0.57.32 2026-02-06 14:04:59 +00:00
Chris Coutinho 2535c95f4e Merge pull request #535 from cbcoutinho/renovate/ghcr.io-astral-sh-uv-0.x
chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.10.0
2026-02-06 15:04:30 +01:00
renovate-bot-cbcoutinho[bot] 4fac0ca40d chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.10.0 2026-02-06 11:09:24 +00:00
renovate-bot-cbcoutinho[bot] 719a432a95 chore(deps): update dependency uv_build to >=0.10.0,<0.11.0 2026-02-06 11:09:13 +00:00
renovate-bot-cbcoutinho[bot] 14c4512ef8 chore(deps): update anthropics/claude-code-action action to v1.0.45 2026-02-06 11:08:46 +00:00
github-actions[bot] 6f482c9245 bump: version 0.57.30 → 0.57.31 2026-02-06 07:23:12 +00:00
Chris Coutinho a6ad3707c6 Merge pull request #513 from cbcoutinho/renovate/ghcr.io-astral-sh-uv-0.x
chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.9.30
2026-02-06 08:22:55 +01:00
github-actions[bot] b34f8d96e3 bump: version 0.57.29 → 0.57.30 2026-02-06 07:09:22 +00:00
Chris Coutinho d948f51b10 Merge pull request #532 from cbcoutinho/renovate/docker.io-library-python-3.12-slim-trixie
chore(deps): update docker.io/library/python:3.12-slim-trixie docker digest to 43e4d70
2026-02-06 08:09:07 +01:00
renovate-bot-cbcoutinho[bot] 5eb5b5023c chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.9.30 2026-02-05 11:12:00 +00:00
renovate-bot-cbcoutinho[bot] 504213ae79 chore(deps): update docker.io/library/python:3.12-slim-trixie docker digest to 43e4d70 2026-02-05 11:11:49 +00:00
renovate-bot-cbcoutinho[bot] 5eeaafbe95 chore(deps): update docker.io/library/nginx:alpine docker digest to 5878d06 2026-02-05 11:11:43 +00:00
renovate-bot-cbcoutinho[bot] 0ddc62c371 chore(deps): update hoverkraft-tech/compose-action action to v2.5.0 2026-02-04 11:09:33 +00:00
renovate-bot-cbcoutinho[bot] 36d901d5ae chore(deps): update helm release ollama to v1.41.0 2026-02-04 11:09:28 +00:00
github-actions[bot] 0a3052d0d9 bump: version 0.57.28 → 0.57.29 2026-02-04 06:25:10 +00:00
Chris Coutinho 2b691f1792 Merge pull request #525 from cbcoutinho/renovate/docker.io-library-nextcloud-32.0.5
chore(deps): update docker.io/library/nextcloud:32.0.5 docker digest to 4b66e9b
2026-02-04 07:24:55 +01:00
github-actions[bot] e3da2e006c bump: version 0.57.27 → 0.57.28 2026-02-03 19:57:46 +00:00
Chris Coutinho 4539f2f486 Merge pull request #526 from cbcoutinho/renovate/docker.io-library-python-3.12-slim-trixie
chore(deps): update docker.io/library/python:3.12-slim-trixie docker digest to 87b49ee
2026-02-03 20:57:27 +01:00
renovate-bot-cbcoutinho[bot] c85ad95faf chore(deps): update docker.io/library/python:3.12-slim-trixie docker digest to 87b49ee 2026-02-03 11:12:24 +00:00
renovate-bot-cbcoutinho[bot] 60f7234908 chore(deps): update docker.io/library/nextcloud:32.0.5 docker digest to 4b66e9b 2026-02-03 11:12:18 +00:00
github-actions[bot] 1dd5698389 bump: version 0.10.0 → 0.10.1 2026-02-03 06:50:26 +00:00
github-actions[bot] 3a0096f8df bump: version 0.57.26 → 0.57.27 2026-02-03 06:50:26 +00:00
22 changed files with 658 additions and 104 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ jobs:
- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@0ed5eeaa54d3b0170e79f1ff29996342cf0605f1 # v1.0.40
uses: anthropics/claude-code-action@b113f49a56229d8276e2bf05743ad6900121239c # v1.0.45
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
allowed_bots: "renovate-bot-cbcoutinho"
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@0ed5eeaa54d3b0170e79f1ff29996342cf0605f1 # v1.0.40
uses: anthropics/claude-code-action@b113f49a56229d8276e2bf05743ad6900121239c # v1.0.45
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
+2 -2
View File
@@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Run docker compose with vector sync
uses: hoverkraft-tech/compose-action@05da55b2bb8a5a759d1c4732095044bd9018c050 # v2.4.3
uses: hoverkraft-tech/compose-action@4894d2492015c1774ee5a13a95b1072093087ec3 # v2.5.0
with:
compose-file: |
./docker-compose.yml
@@ -42,7 +42,7 @@ jobs:
VECTOR_SYNC_SCAN_INTERVAL: "5"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
- name: Wait for Nextcloud to be ready
run: |
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
- name: Install Python 3.11
run: uv python install 3.11
- name: Build
+3 -3
View File
@@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install the latest version of uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
- name: Check format
run: |
uv run --frozen ruff format --diff
@@ -66,14 +66,14 @@ jobs:
- name: Run docker compose
uses: hoverkraft-tech/compose-action@05da55b2bb8a5a759d1c4732095044bd9018c050 # v2.4.3
uses: hoverkraft-tech/compose-action@4894d2492015c1774ee5a13a95b1072093087ec3 # v2.5.0
with:
compose-file: "./docker-compose.yml"
#compose-flags: "--profile qdrant"
up-flags: "--build"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
- name: Install Playwright dependencies
run: |
+12
View File
@@ -5,6 +5,18 @@ All notable changes to the Nextcloud MCP Server will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://peps.python.org/pep-0440/).
## v0.63.3 (2026-02-08)
### Fix
- expand recurring events in date-range queries
## v0.63.2 (2026-02-07)
### Fix
- use CalDAV time-range filter for calendar date range queries
## v0.63.1 (2026-02-03)
### Fix
+2 -2
View File
@@ -1,6 +1,6 @@
FROM docker.io/library/python:3.12-slim-trixie@sha256:5e2dbd4bbdd9c0e67412aea9463906f74a22c60f89eb7b5bbb7d45b66a2b68a6
FROM docker.io/library/python:3.12-slim-trixie@sha256:9e01bf1ae5db7649a236da7be1e94ffbbbdd7a93f867dd0d8d5720d9e1f89fab
COPY --from=ghcr.io/astral-sh/uv:0.9.26@sha256:9a23023be68b2ed09750ae636228e903a54a05ea56ed03a934d00fe9fbeded4b /uv /uvx /bin/
COPY --from=ghcr.io/astral-sh/uv:0.10.0@sha256:78a7ff97cd27b7124a5f3c2aefe146170793c56a1e03321dd31a289f6d82a04f /uv /uvx /bin/
# Install dependencies
# 1. git (required for caldav dependency from git)
+2 -2
View File
@@ -12,12 +12,12 @@
# - Per-session app password authentication
# - Multi-user support via Smithery session config
FROM docker.io/library/python:3.12-slim-trixie@sha256:5e2dbd4bbdd9c0e67412aea9463906f74a22c60f89eb7b5bbb7d45b66a2b68a6
FROM docker.io/library/python:3.12-slim-trixie@sha256:9e01bf1ae5db7649a236da7be1e94ffbbbdd7a93f867dd0d8d5720d9e1f89fab
WORKDIR /app
# Install uv for fast dependency management
COPY --from=ghcr.io/astral-sh/uv:0.9.26@sha256:9a23023be68b2ed09750ae636228e903a54a05ea56ed03a934d00fe9fbeded4b /uv /uvx /bin/
COPY --from=ghcr.io/astral-sh/uv:0.10.0@sha256:78a7ff97cd27b7124a5f3c2aefe146170793c56a1e03321dd31a289f6d82a04f /uv /uvx /bin/
# Install dependencies
# 1. git (required for caldav dependency from git)
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.57.26"
version = "0.57.41"
tag_format = "nextcloud-mcp-server-$version"
version_scheme = "semver"
update_changelog_on_bump = true
+39 -9
View File
@@ -14,17 +14,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Configurable resource limits
- Grafana dashboard annotations
## [Unreleased]
## nextcloud-mcp-server-0.57.41 (2026-02-08)
### Fixed
- **volumes**: Fix /app/data not writable in basic auth mode due to readOnlyRootFilesystem security context
- Always mount /app/data (uses emptyDir by default, PVC when dataStorage.enabled=true)
- Resolves conflict where multi-user-basic and qdrant tried to mount different PVCs to same path
- Unified dataStorage configuration for all /app/data persistence needs
### Fix
### Changed
- **volumes**: Deprecated separate token-storage and qdrant-data PVCs in favor of unified data-storage PVC
- **volumes**: /app/data now always writable regardless of auth mode or features enabled
- expand recurring events in date-range queries
## nextcloud-mcp-server-0.57.40 (2026-02-07)
### Fix
- use CalDAV time-range filter for calendar date range queries
## nextcloud-mcp-server-0.57.39 (2026-02-07)
## nextcloud-mcp-server-0.57.38 (2026-02-07)
## nextcloud-mcp-server-0.57.37 (2026-02-06)
## nextcloud-mcp-server-0.57.36 (2026-02-06)
## nextcloud-mcp-server-0.57.35 (2026-02-06)
## nextcloud-mcp-server-0.57.34 (2026-02-06)
## nextcloud-mcp-server-0.57.33 (2026-02-06)
## nextcloud-mcp-server-0.57.32 (2026-02-06)
## nextcloud-mcp-server-0.57.31 (2026-02-06)
## nextcloud-mcp-server-0.57.30 (2026-02-06)
## nextcloud-mcp-server-0.57.29 (2026-02-04)
## nextcloud-mcp-server-0.57.28 (2026-02-03)
## nextcloud-mcp-server-0.57.27 (2026-02-03)
### Fix
- **helm**: add backward compatibility for legacy persistence configs
## nextcloud-mcp-server-0.57.26 (2026-01-31)
+3 -3
View File
@@ -4,6 +4,6 @@ dependencies:
version: 1.16.3
- name: ollama
repository: https://otwld.github.io/ollama-helm
version: 1.40.0
digest: sha256:d8cbf3eab778b3e28818dd1f9cbd71c99ce968fb2a46880b162f988a59a5fedf
generated: "2026-01-30T11:10:10.104463708Z"
version: 1.41.0
digest: sha256:1d5b958a64eb2102cf347ec199638bfac5b289bafdecff2529099ee6bce03b86
generated: "2026-02-04T11:09:21.837825534Z"
+3 -3
View File
@@ -2,8 +2,8 @@ apiVersion: v2
name: nextcloud-mcp-server
description: A Helm chart for Nextcloud MCP Server - enables AI assistants to interact with Nextcloud
type: application
version: 0.57.26
appVersion: "0.63.1"
version: 0.57.41
appVersion: "0.63.3"
keywords:
- nextcloud
- mcp
@@ -31,6 +31,6 @@ dependencies:
repository: https://qdrant.github.io/qdrant-helm
condition: qdrant.networkMode.deploySubchart
- name: ollama
version: "1.40.0"
version: "1.41.0"
repository: https://otwld.github.io/ollama-helm
condition: ollama.enabled
+2 -2
View File
@@ -23,7 +23,7 @@ services:
restart: always
app:
image: docker.io/library/nextcloud:32.0.5@sha256:11a3a4f63bad8813c7455b4a3c473ccd1c41e2c48f55decb51718f15691e7568
image: docker.io/library/nextcloud:32.0.5@sha256:4b66e9bd8cb2c8af5457c1e2606c9937af2fcccbe4f6338956bc5990caec8968
restart: always
ports:
- 127.0.0.1:8080:80
@@ -54,7 +54,7 @@ services:
retries: 30
recipes:
image: docker.io/library/nginx:alpine@sha256:4870c12cd2ca986de501a804b4f506ad3875a0b1874940ba0a2c7f763f1855b2
image: docker.io/library/nginx:alpine@sha256:5878d06ae4c83d73285438255f705bb3f9a736f41cd24876ed25bb33faf76c7d
restart: always
volumes:
- ./tests/fixtures/test_recipe.html:/usr/share/nginx/html/test_recipe.html:ro
+199 -68
View File
@@ -255,18 +255,35 @@ class CalendarClient:
"""List events in a calendar within date range."""
calendar = self._get_calendar(calendar_name)
# Get all events using caldav library (now with proper filter)
events = await calendar.events()
if start_datetime or end_datetime:
# Build CalDAV REPORT with time-range filter for server-side filtering
events = await self._search_events_by_date(
calendar, start_datetime, end_datetime
)
# Expand is only used when both bounds are provided
expanded = bool(start_datetime and end_datetime)
else:
# No date filter — fetch all events
events = await calendar.events()
expanded = False
result = []
for event in events:
await event.load(only_if_unloaded=True)
if event.data:
event_dict = self._parse_ical_event(event.data)
if event_dict:
event_dict["href"] = str(event.url)
event_dict["etag"] = ""
result.append(event_dict)
if expanded:
# Server-side expansion: each response resource may contain
# multiple VEVENTs (one per recurrence occurrence)
for event_dict in self._parse_all_ical_events(event.data):
event_dict["href"] = str(event.url)
event_dict["etag"] = ""
result.append(event_dict)
else:
event_dict = self._parse_ical_event(event.data)
if event_dict:
event_dict["href"] = str(event.url)
event_dict["etag"] = ""
result.append(event_dict)
if len(result) >= limit:
break
@@ -274,6 +291,57 @@ class CalendarClient:
logger.debug(f"Found {len(result)} events")
return result
async def _search_events_by_date(
self,
calendar: AsyncCalendar,
start_datetime: Optional[dt.datetime] = None,
end_datetime: Optional[dt.datetime] = None,
) -> list:
"""Execute a CalDAV REPORT with time-range filter."""
from caldav.async_collection import AsyncEvent
from caldav.elements import cdav, dav
from lxml import etree # type: ignore[import-untyped]
# Ensure naive datetimes are treated as UTC
if start_datetime and start_datetime.tzinfo is None:
start_datetime = start_datetime.replace(tzinfo=dt.UTC)
if end_datetime and end_datetime.tzinfo is None:
end_datetime = end_datetime.replace(tzinfo=dt.UTC)
# Build comp-filter with time-range (mirrors sync Calendar.build_search_xml_query)
inner_comp_filter = cdav.CompFilter(name="VEVENT")
inner_comp_filter += cdav.TimeRange(start_datetime, end_datetime)
outer_comp_filter = cdav.CompFilter(name="VCALENDAR") + inner_comp_filter
filter_element = cdav.Filter() + outer_comp_filter
# When both bounds are provided, request server-side expansion of
# recurring events (RFC 4791 §9.6.5). Each occurrence is returned as
# a separate VEVENT with its own DTSTART, with RRULE stripped.
data = cdav.CalendarData()
if start_datetime and end_datetime:
data += cdav.Expand(start_datetime, end_datetime)
query = cdav.CalendarQuery() + [dav.Prop() + data] + filter_element
body = etree.tostring(
query.xmlelement(), encoding="utf-8", xml_declaration=True
)
assert calendar.client is not None
response = await calendar.client.report(str(calendar.url), body, depth=1)
# Parse response (same pattern as AsyncCalendar.search)
objects = []
response_data = response.expand_simple_props([cdav.CalendarData()])
for href, props in response_data.items():
if href == str(calendar.url):
continue
cal_data = props.get(cdav.CalendarData.tag)
if cal_data:
obj = AsyncEvent(client=calendar.client, data=cal_data, parent=calendar)
objects.append(obj)
return objects
async def create_event(
self, calendar_name: str, event_data: Dict[str, Any]
) -> Dict[str, Any]:
@@ -583,7 +651,7 @@ class CalendarClient:
# Add categories
categories = event_data.get("categories", "")
if categories:
event.add("categories", categories.split(","))
event.add("categories", [c.strip() for c in categories.split(",")])
# Add priority and status
priority = event_data.get("priority", 5)
@@ -633,75 +701,92 @@ class CalendarClient:
cal.add_component(event)
return cal.to_ical().decode("utf-8")
def _extract_vevent_data(self, component) -> Dict[str, Any]:
"""Extract event data from a single VEVENT component.
Shared helper used by both _parse_ical_event() and _parse_all_ical_events().
"""
event_data: Dict[str, Any] = {
"uid": str(component.get("uid", "")),
"title": str(component.get("summary", "")),
"description": str(component.get("description", "")),
"location": str(component.get("location", "")),
"status": str(component.get("status", "CONFIRMED")),
"priority": int(component.get("priority", 5)),
"privacy": str(component.get("class", "PUBLIC")),
"url": str(component.get("url", "")),
}
# Handle dates
dtstart = component.get("dtstart")
if dtstart:
if isinstance(dtstart.dt, dt.date) and not isinstance(
dtstart.dt, dt.datetime
):
event_data["start_datetime"] = dtstart.dt.isoformat()
event_data["all_day"] = True
else:
event_data["start_datetime"] = dtstart.dt.isoformat()
event_data["all_day"] = False
dtend = component.get("dtend")
if dtend:
if isinstance(dtend.dt, dt.date) and not isinstance(dtend.dt, dt.datetime):
event_data["end_datetime"] = dtend.dt.isoformat()
else:
event_data["end_datetime"] = dtend.dt.isoformat()
# Handle categories
categories = component.get("categories")
if categories:
event_data["categories"] = self._extract_categories(categories)
# Handle recurrence
rrule = component.get("rrule")
if rrule:
event_data["recurring"] = True
event_data["recurrence_rule"] = str(rrule)
# Handle attendees
attendees = []
for attendee in component.get("attendee", []):
if isinstance(attendee, list):
attendees.extend(str(a).replace("mailto:", "") for a in attendee)
else:
attendees.append(str(attendee).replace("mailto:", ""))
if attendees:
event_data["attendees"] = ",".join(attendees)
return event_data
def _parse_ical_event(self, ical_text: str) -> Optional[Dict[str, Any]]:
"""Parse iCalendar text and extract event data."""
"""Parse iCalendar text and extract the first event."""
try:
cal = Calendar.from_ical(ical_text)
for component in cal.walk():
if component.name == "VEVENT":
event_data = {
"uid": str(component.get("uid", "")),
"title": str(component.get("summary", "")),
"description": str(component.get("description", "")),
"location": str(component.get("location", "")),
"status": str(component.get("status", "CONFIRMED")),
"priority": int(component.get("priority", 5)),
"privacy": str(component.get("class", "PUBLIC")),
"url": str(component.get("url", "")),
}
# Handle dates
dtstart = component.get("dtstart")
if dtstart:
if isinstance(dtstart.dt, dt.date) and not isinstance(
dtstart.dt, dt.datetime
):
event_data["start_datetime"] = dtstart.dt.isoformat()
event_data["all_day"] = True
else:
event_data["start_datetime"] = dtstart.dt.isoformat()
event_data["all_day"] = False
dtend = component.get("dtend")
if dtend:
if isinstance(dtend.dt, dt.date) and not isinstance(
dtend.dt, dt.datetime
):
event_data["end_datetime"] = dtend.dt.isoformat()
else:
event_data["end_datetime"] = dtend.dt.isoformat()
# Handle categories
categories = component.get("categories")
if categories:
event_data["categories"] = self._extract_categories(categories)
# Handle recurrence
rrule = component.get("rrule")
if rrule:
event_data["recurring"] = True
event_data["recurrence_rule"] = str(rrule)
# Handle attendees
attendees = []
for attendee in component.get("attendee", []):
if isinstance(attendee, list):
attendees.extend(
str(a).replace("mailto:", "") for a in attendee
)
else:
attendees.append(str(attendee).replace("mailto:", ""))
if attendees:
event_data["attendees"] = ",".join(attendees)
return event_data
return self._extract_vevent_data(component)
return None
except Exception as e:
logger.error(f"Error parsing iCalendar event: {e}")
return None
def _parse_all_ical_events(self, ical_text: str) -> list[Dict[str, Any]]:
"""Parse iCalendar text and extract ALL event occurrences.
Used with server-side expansion where a single VCALENDAR contains
multiple VEVENT components (one per recurrence occurrence).
"""
results: list[Dict[str, Any]] = []
try:
cal = Calendar.from_ical(ical_text)
for component in cal.walk():
if component.name == "VEVENT":
results.append(self._extract_vevent_data(component))
except Exception as e:
logger.error(f"Error parsing iCalendar events: {e}")
return results
def _merge_ical_properties(
self, raw_ical: str, event_data: Dict[str, Any], event_uid: str
) -> str:
@@ -727,6 +812,50 @@ class CalendarClient:
if "url" in event_data:
component["URL"] = event_data["url"]
# Handle categories
if "categories" in event_data:
categories_str = event_data["categories"]
if categories_str:
component["CATEGORIES"] = [
c.strip() for c in categories_str.split(",")
]
elif "CATEGORIES" in component:
del component["CATEGORIES"]
# Handle recurrence rule
if "recurrence_rule" in event_data:
rrule_str = event_data["recurrence_rule"]
if rrule_str:
component["RRULE"] = vRecur.from_ical(rrule_str)
elif "RRULE" in component:
del component["RRULE"]
# Handle attendees
if "attendees" in event_data:
attendees_str = event_data["attendees"]
# Remove all existing attendees first
while "ATTENDEE" in component:
del component["ATTENDEE"]
if attendees_str:
for email in attendees_str.split(","):
if email.strip():
component.add("attendee", f"mailto:{email.strip()}")
# Handle reminder (VALARM)
if "reminder_minutes" in event_data:
component.subcomponents = [
sub
for sub in component.subcomponents
if sub.name != "VALARM"
]
minutes = event_data["reminder_minutes"]
if minutes > 0:
alarm = Alarm()
alarm.add("action", "DISPLAY")
alarm.add("description", "Event reminder")
alarm.add("trigger", dt.timedelta(minutes=-minutes))
component.add_component(alarm)
# Handle dates
if "start_datetime" in event_data:
start_str = event_data["start_datetime"]
@@ -960,7 +1089,9 @@ class CalendarClient:
if "categories" in todo_data:
categories_str = todo_data["categories"]
if categories_str:
component["CATEGORIES"] = categories_str.split(",")
component["CATEGORIES"] = [
c.strip() for c in categories_str.split(",")
]
logger.debug(f"Set CATEGORIES to {categories_str}")
# Update timestamps
+2 -2
View File
@@ -1,6 +1,6 @@
[project]
name = "nextcloud-mcp-server"
version = "0.63.1"
version = "0.63.3"
description = "Model Context Protocol (MCP) server for Nextcloud integration - enables AI assistants to interact with Nextcloud data"
authors = [
{name = "Chris Coutinho", email = "chris@coutinho.io"}
@@ -114,7 +114,7 @@ caldav = { git = "https://github.com/cbcoutinho/caldav", branch = "feature/httpx
qdrant-client = { git = "https://github.com/cbcoutinho/qdrant-client", branch = "fix/fusion-score-threshold" }
[build-system]
requires = ["uv_build>=0.9.4,<0.10.0"]
requires = ["uv_build>=0.10.0,<0.11.0"]
build-backend = "uv_build"
[tool.uv.build-backend]
@@ -273,6 +273,86 @@ async def test_update_event(nc_client: NextcloudClient, temporary_event: dict):
raise
async def test_update_event_extended_fields(
nc_client: NextcloudClient, temporary_calendar: str
):
"""Test updating categories, recurrence_rule, attendees, and reminder_minutes."""
calendar_name = temporary_calendar
tomorrow = datetime.now() + timedelta(days=1)
event_data = {
"title": "Extended Fields Update Test",
"start_datetime": tomorrow.strftime("%Y-%m-%dT10:00:00"),
"end_datetime": tomorrow.strftime("%Y-%m-%dT11:00:00"),
"description": "Base event for extended-field update test",
}
event_uid = None
try:
result = await nc_client.calendar.create_event(calendar_name, event_data)
event_uid = result["uid"]
logger.info(f"Created base event for extended fields test: {event_uid}")
# --- Phase 1: Set all four extended fields ---
updated_data = {
"categories": "work,meeting",
"recurrence_rule": "FREQ=WEEKLY;COUNT=4",
"attendees": "alice@example.com,bob@example.com",
"reminder_minutes": 15,
}
await nc_client.calendar.update_event(calendar_name, event_uid, updated_data)
retrieved, _ = await nc_client.calendar.get_event(calendar_name, event_uid)
# Verify categories
assert "work" in retrieved.get("categories", "")
assert "meeting" in retrieved.get("categories", "")
# Verify recurrence rule
assert retrieved.get("recurring") is True
assert "WEEKLY" in retrieved.get("recurrence_rule", "")
# Verify attendees
attendees = retrieved.get("attendees", "")
assert "alice@example.com" in attendees
assert "bob@example.com" in attendees
logger.info("Phase 1 passed: all extended fields set correctly")
# --- Phase 2: Clear all four extended fields ---
cleared_data = {
"categories": "",
"recurrence_rule": "",
"attendees": "",
"reminder_minutes": 0,
}
await nc_client.calendar.update_event(calendar_name, event_uid, cleared_data)
cleared, _ = await nc_client.calendar.get_event(calendar_name, event_uid)
# Verify categories cleared
assert not cleared.get("categories")
# Verify recurrence cleared
assert cleared.get("recurring") is not True
assert not cleared.get("recurrence_rule")
# Verify attendees cleared
assert not cleared.get("attendees")
logger.info("Phase 2 passed: all extended fields cleared correctly")
except Exception as e:
logger.error(f"Extended fields update test failed: {e}")
raise
finally:
if event_uid:
try:
await nc_client.calendar.delete_event(calendar_name, event_uid)
except Exception:
pass
async def test_create_event_with_attendees(
nc_client: NextcloudClient, temporary_calendar: str
):
@@ -380,6 +460,177 @@ async def test_event_with_url_and_categories(
raise
async def test_list_events_date_range_filtering(
nc_client: NextcloudClient, temporary_calendar: str
):
"""Test that date range filtering actually excludes events outside the range.
Reproduces GH-538: get_calendar_events() accepted date range parameters
but returned events from the entire calendar history, ignoring date filters.
"""
calendar_name = temporary_calendar
past_uid = None
future_uid = None
try:
# Create Event A: 30 days in the past
past_date = datetime.now() - timedelta(days=30)
past_event_data = {
"title": f"Past Event {uuid.uuid4().hex[:8]}",
"start_datetime": past_date.strftime("%Y-%m-%dT10:00:00"),
"end_datetime": past_date.strftime("%Y-%m-%dT11:00:00"),
"description": "Event in the past for date range test",
}
result_past = await nc_client.calendar.create_event(
calendar_name, past_event_data
)
past_uid = result_past["uid"]
logger.info(f"Created past event: {past_uid}")
# Create Event B: 1 day in the future
future_date = datetime.now() + timedelta(days=1)
future_event_data = {
"title": f"Future Event {uuid.uuid4().hex[:8]}",
"start_datetime": future_date.strftime("%Y-%m-%dT14:00:00"),
"end_datetime": future_date.strftime("%Y-%m-%dT15:00:00"),
"description": "Event in the future for date range test",
}
result_future = await nc_client.calendar.create_event(
calendar_name, future_event_data
)
future_uid = result_future["uid"]
logger.info(f"Created future event: {future_uid}")
# Query with date range: today → 7 days ahead
now = datetime.now()
week_ahead = now + timedelta(days=7)
events = await nc_client.calendar.get_calendar_events(
calendar_name=calendar_name,
start_datetime=now,
end_datetime=week_ahead,
limit=50,
)
event_uids = [e["uid"] for e in events]
# Future event (tomorrow) SHOULD be in results
assert future_uid in event_uids, (
f"Future event {future_uid} should be in date-filtered results"
)
# Past event (30 days ago) should NOT be in results
assert past_uid not in event_uids, (
f"Past event {past_uid} should be excluded by date range filter "
f"(GH-538: date range was being ignored)"
)
logger.info(
f"Date range filtering works: {len(events)} events returned, "
f"past event correctly excluded"
)
finally:
# Cleanup both events
for uid in [past_uid, future_uid]:
if uid:
try:
await nc_client.calendar.delete_event(calendar_name, uid)
except Exception as e:
logger.warning(f"Cleanup failed for event {uid}: {e}")
async def test_recurring_event_date_range_expansion(
nc_client: NextcloudClient, temporary_calendar: str
):
"""Test that recurring events are expanded into individual occurrences.
When querying with a date range, a recurring event should return one
event dict per occurrence within the range, each with the correct
start_datetime for that occurrence (not the original master event date).
This is a follow-up to GH-538: the time-range filter correctly selected
recurring events, but returned the master event with its original DTSTART
instead of expanding occurrences.
"""
calendar_name = temporary_calendar
event_uid = None
try:
# Create a daily recurring event starting 7 days ago
start = datetime.now() - timedelta(days=7)
event_data = {
"title": f"Daily Recurrence {uuid.uuid4().hex[:8]}",
"start_datetime": start.strftime("%Y-%m-%dT09:00:00"),
"end_datetime": start.strftime("%Y-%m-%dT10:00:00"),
"description": "Daily recurring event for expansion test",
"recurring": True,
"recurrence_rule": "FREQ=DAILY",
}
result = await nc_client.calendar.create_event(calendar_name, event_data)
event_uid = result["uid"]
logger.info(f"Created daily recurring event: {event_uid}")
# Query with date range: today → 3 days ahead
query_start = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
query_end = query_start + timedelta(days=3)
events = await nc_client.calendar.get_calendar_events(
calendar_name=calendar_name,
start_datetime=query_start,
end_datetime=query_end,
limit=50,
)
# Filter to only our recurring event (calendar may have others)
our_events = [e for e in events if e["uid"] == event_uid]
# Should have multiple occurrences (one per day in the range)
assert len(our_events) >= 2, (
f"Expected multiple expanded occurrences, got {len(our_events)}. "
f"Expansion may not be working."
)
# Each occurrence should have a different start_datetime
start_dates = [e["start_datetime"] for e in our_events]
assert len(set(start_dates)) == len(our_events), (
f"Each occurrence should have a unique start_datetime, got: {start_dates}"
)
# No start_datetime should fall outside the queried range
for e in our_events:
event_start = datetime.fromisoformat(e["start_datetime"])
# Remove timezone info for comparison if present
if event_start.tzinfo is not None:
event_start = event_start.replace(tzinfo=None)
assert event_start >= query_start - timedelta(hours=1), (
f"Occurrence {e['start_datetime']} is before query start {query_start}"
)
assert event_start < query_end + timedelta(hours=1), (
f"Occurrence {e['start_datetime']} is after query end {query_end}"
)
# Expanded occurrences should NOT have recurrence rules
# (server strips RRULE when expanding)
for e in our_events:
assert not e.get("recurring"), (
"Expanded occurrence should not have recurring=True, "
"RRULE should be stripped by server-side expansion"
)
logger.info(
f"Recurring event expansion works: {len(our_events)} occurrences "
f"returned with unique start dates"
)
finally:
if event_uid:
try:
await nc_client.calendar.delete_event(calendar_name, event_uid)
except Exception as e:
logger.warning(f"Cleanup failed for recurring event {event_uid}: {e}")
async def test_calendar_operations_error_handling(
nc_client: NextcloudClient,
):
+124
View File
@@ -0,0 +1,124 @@
"""Integration tests for Calendar VEVENT update MCP tools - extended fields."""
import json
import logging
from datetime import datetime, timedelta
import pytest
from mcp import ClientSession
from nextcloud_mcp_server.client import NextcloudClient
logger = logging.getLogger(__name__)
pytestmark = pytest.mark.integration
async def test_mcp_update_event_extended_fields(
nc_mcp_client: ClientSession, nc_client: NextcloudClient, temporary_calendar: str
):
"""Test updating categories, recurrence_rule, attendees, and reminder_minutes via MCP."""
calendar_name = temporary_calendar
event_uid = None
try:
# 1. Create a base event via MCP
tomorrow = datetime.now() + timedelta(days=1)
create_result = await nc_mcp_client.call_tool(
"nc_calendar_create_event",
{
"calendar_name": calendar_name,
"title": "Extended Fields MCP Test",
"start_datetime": tomorrow.strftime("%Y-%m-%dT14:00:00"),
"end_datetime": tomorrow.strftime("%Y-%m-%dT15:00:00"),
"description": "Base event for MCP extended-field update test",
},
)
assert create_result.isError is False, (
f"MCP event creation failed: {create_result.content}"
)
result_data = json.loads(create_result.content[0].text)
event_uid = result_data["uid"]
logger.info(f"Created base event via MCP: {event_uid}")
# 2. Update with all four extended fields via MCP
update_result = await nc_mcp_client.call_tool(
"nc_calendar_update_event",
{
"calendar_name": calendar_name,
"event_uid": event_uid,
"categories": "work,meeting",
"recurrence_rule": "FREQ=WEEKLY;COUNT=4",
"attendees": "alice@example.com,bob@example.com",
"reminder_minutes": 15,
},
)
assert update_result.isError is False, (
f"MCP event update failed: {update_result.content}"
)
# 3. Verify via direct client
event, _ = await nc_client.calendar.get_event(calendar_name, event_uid)
# Categories
assert "work" in event.get("categories", ""), (
f"Expected 'work' in categories, got: {event.get('categories')}"
)
assert "meeting" in event.get("categories", ""), (
f"Expected 'meeting' in categories, got: {event.get('categories')}"
)
# Recurrence
assert event.get("recurring") is True, "Expected event to be recurring"
assert "WEEKLY" in event.get("recurrence_rule", ""), (
f"Expected WEEKLY in rrule, got: {event.get('recurrence_rule')}"
)
# Attendees
attendees = event.get("attendees", "")
assert "alice@example.com" in attendees, (
f"Expected alice in attendees, got: {attendees}"
)
assert "bob@example.com" in attendees, (
f"Expected bob in attendees, got: {attendees}"
)
logger.info("MCP extended fields update verified successfully")
# 4. Clear all four fields via MCP
clear_result = await nc_mcp_client.call_tool(
"nc_calendar_update_event",
{
"calendar_name": calendar_name,
"event_uid": event_uid,
"categories": "",
"recurrence_rule": "",
"attendees": "",
"reminder_minutes": 0,
},
)
assert clear_result.isError is False, (
f"MCP event clear failed: {clear_result.content}"
)
# 5. Verify fields cleared
cleared, _ = await nc_client.calendar.get_event(calendar_name, event_uid)
assert not cleared.get("categories"), (
f"Expected categories cleared, got: {cleared.get('categories')}"
)
assert cleared.get("recurring") is not True, (
f"Expected recurring cleared, got: {cleared.get('recurring')}"
)
assert not cleared.get("attendees"), (
f"Expected attendees cleared, got: {cleared.get('attendees')}"
)
logger.info("MCP extended fields clear verified successfully")
finally:
if event_uid:
try:
await nc_client.calendar.delete_event(calendar_name, event_uid)
except Exception:
pass
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.10.0"
version = "0.10.1"
tag_format = "astrolabe-v$version"
version_scheme = "semver"
update_changelog_on_bump = true
+6
View File
@@ -25,6 +25,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Requires external MCP server deployment
- See documentation for setup: https://github.com/cbcoutinho/nextcloud-mcp-server
## astrolabe-v0.10.1 (2026-02-03)
### Fix
- **helm**: add backward compatibility for legacy persistence configs
## astrolabe-v0.10.0 (2026-01-28)
### Feat
+1 -1
View File
@@ -29,7 +29,7 @@ Astrolabe connects to a semantic search service that understands the meaning of
See [documentation](https://github.com/cbcoutinho/nextcloud-mcp-server) for configuration details.
]]></description>
<version>0.10.0</version>
<version>0.10.1</version>
<licence>agpl</licence>
<author homepage="https://github.com/cbcoutinho">Chris Coutinho</author>
<namespace>Astrolabe</namespace>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "astrolabe",
"version": "0.10.0",
"version": "0.10.1",
"license": "AGPL-3.0-or-later",
"engines": {
"node": "^22.0.0",
Generated
+1 -1
View File
@@ -1988,7 +1988,7 @@ wheels = [
[[package]]
name = "nextcloud-mcp-server"
version = "0.63.1"
version = "0.63.3"
source = { editable = "." }
dependencies = [
{ name = "aiosqlite" },