- Clojure 99%
- Nix 1%
| .plans | ||
| docs | ||
| nix | ||
| src/nextcloud_mcp_server | ||
| tasks | ||
| test | ||
| .envrc | ||
| .gitignore | ||
| .zprintrc | ||
| bb.edn | ||
| build.clj | ||
| deps-lock.json | ||
| deps.edn | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
Nextcloud MCP server
Small Clojure Nextcloud calendars/tasks MCP server using stdio on the locked nixpkgs default JDK. The primary ordinary-server deployment artifact is now a NixOS/flake-ready package, with offline packaged acceptance; no installation, activation or live account/client testing is implied. Nextcloud will remain the source of truth. T1 provides tooling; T2 proves SDK/iCal4j interop; T3 adds secure DAV discovery; T4 adds offline lossless iCalendar patches; T5 adds internal conditional resource mutations and GET-only recovery; T6 adds an opt-in disposable compatibility harness with offline safety proofs; T7 adds bounded ordinary event/task read services and fixed-subset expansion; T8 adds constrained one-off personal event and nonrecurring task write services; ordinary T10 adds the stdio composition root, MCP tools and subprocess lifecycle tests; ordinary T11 adds locked Nix/JAR packaging, runtime-file deployment documentation and automated artifact checks. The ordinary MCP contract exposes seven default read tools and nine write-gated tools (including two GET-only reconciliation tools). There is still no production recurring-write capability. T6 remains unaccepted/blocked. Tobias explicitly chose safe T7 reads and T8 ordinary writes under the plan's fallback allowance, not T6 sign-off. Storage validity and T7 expansion do not prove Tasks/Reminders interoperability. See the sanitized findings matrix and read API contracts / ordinary write contracts. No production collection or synchronization is changed.
Development
Run commands from this project directory. Use the literal path:. flake argument
so Nix includes new, untracked project files without staging them:
nix develop path:.
# Or run checks directly:
nix develop path:. --command bash -lc 'bb fmt:check && bb lint && bb test:unit'
For automatic shell activation, install direnv with flake support (for example,
nix-direnv) and enable its hook in your local shell. Review .envrc, then run
direnv allow from this project directory. The checked-in .envrc uses
use flake path:. to load the same locked development shell; its .direnv/
cache is already ignored by Git. Reapprove locally when .envrc changes.
flake.lock pins nixpkgs at b6018f87da91d19d0ab4cf979885689b469cdd41, selecting
the default JDK 21.0.10, Clojure CLI 1.12.3.1577, Babashka 1.12.209,
zprint 1.3.0, and clj-kondo 2025.09.22. The CLI's version is not the
project's Clojure runtime: deps.edn pins Clojure 1.12.6, tools.build
0.10.10, and Cognitect test-runner v0.5.1 / dfb30dd. T2 retains T1's
Clojure 1.12.6 baseline in both application and build aliases; build/unit checks
enforce Java major 21.
Use unmodified nixpkgs clojure and pkgs.jdk, with no JDK-version override;
compiler/build and test JVMs use this same default JDK via JAVA_HOME. The Nix
lock makes its selection reproducible. Any deliberate language or JDK update
requires rerunning these compatibility proofs and reviewing the baseline.
Dependency resolution uses -Srepro to exclude user-level Clojure configuration.
The dev shell/build/checks share clj-nix's hashed dependency cache from the reviewed
deps-lock.json, not developer Maven/Git caches. Initial explicit lock generation
and Nix fixed-output dependency fetching need network; build/check phases and
ordinary tests need no external services or credentials. See the
source-filter and reproducibility boundary.
Source belongs under src/nextcloud_mcp_server/, with namespaces prefixed
nextcloud-mcp-server. No speculative empty application modules are created.
:test adds tasks/, shared offline test support, and separate
unit/integration/MCP classpath roots; those roots are not in the application
basis. The live proof root is available only through the separate :nextcloud
alias, never ordinary suite discovery.
Checks and suite contracts
| Command | Scope and current status |
|---|---|
bb fmt:check [files...] |
Nonmutating zprint check; defaults to project Clojure/EDN files, excluding generated output. Uses .zprintrc, comma-free maps and search-config. |
bb lint |
Nonmutating, pinned clj-kondo analysis; cache writes disabled. |
bb test:unit [namespace] |
test/unit/; nonempty deterministic, credential-free tests, including subprocess bootstrap regressions. No external network. |
bb test:integration [namespace] |
test/integration/; deterministic loopback DAV contracts, no external accounts/network or containers. |
bb test:mcp [namespace] |
test/mcp/; nonempty actual stdio subprocess/SDK-client tests with synthetic local fixtures; no live account. |
bb package |
Deterministic-path self-contained JAR at target/nextcloud-mcp-server.jar, using tools.build and a minimal AOT launcher. |
bb smoke --jar <jar> / bb smoke --command <executable> |
Launch the requested real artifact: SDK initialize/list, pure stdout, bounded EOF/termination and fail-closed startup; synthetic runtime files only. |
nix flake check path:. / nix build path:. |
Offline source and actual packaged acceptance / primary Nix package. See checked versus declared platforms and results. |
nix run path:.#deps-lock |
Explicit network-enabled lock maintenance only; review its output, never an implicit check. |
bb test:nextcloud --config /absolute/path/disposable.edn --case recurrence-compatibility --evidence-dir target/interop |
Explicit opt-in original T6 proof; requires separately approved private configuration/manual prerequisites. Never an ordinary check. See interop instructions. Not run live during implementation. |
bb test:nextcloud --config /absolute/path/duration-comparison.edn --case duration-due-comparison --evidence-dir target/interop |
Separate closed two-task create/readback-only diagnostic; explicit future UTC start, new approved run/config, exact scope and two-entry manifest required. Never reuse/reseed finished diagnostics. |
bb test:nextcloud --config /absolute/path/server-completion.edn --case server-occurrence-completion --evidence-dir target/interop |
Existing closed server candidate, preserved unchanged. Later supplied client observations rejected its representation; do not reuse the failed task/run. |
bb test:nextcloud --config /absolute/path/native-observer.edn --case native-completion-observer --evidence-dir target/interop |
New closed one-fixture native Tasks observation: seed → separately approved gates-off baseline → USER completes once in Nextcloud Tasks → separately approved gates-off observe → STOP. See the full template, bounds and request matrix. NO live observation or T6 acceptance occurred in this handoff. |
Unit/integration/MCP wrappers invoke Cognitect's runner against their explicit
test root. The opt-in Nextcloud wrapper instead dispatches one closed proof case
with a validated nonempty manifest. Without a namespace, ordinary suite discovery
follows the runner's -test namespace suffix convention. An optional fully qualified namespace selects exactly that namespace
within the chosen root, for example:
bb test:unit nextcloud-mcp-server.bootstrap-test
Unknown namespaces, zero discovered tests (even in an existing namespace), failed
tests, child failures and missing prerequisites exit nonzero. Empty/unimplemented
suites are not successful skips. Bootstrap regressions generate temporary local
fixtures under target/ and remove them after testing; they also prove formatting
failure leaves an unformatted fixture byte-for-byte unchanged.
The native observer freezes a future whole-second UTC :native-start, DAILY
COUNT=3, explicit DUE one hour later, a distinctive fixed initial title and stable
case/run/operation/UID/href in schema 4 before any mutation. It adds no public MCP
API or replacement completion algorithm. :seed permits exactly one conditional
PUT and canonical GET; :baseline and :observe require both write gates off
and explicit known-UID candidate-read authorization. Each phase also requires
principal/home/collection PROPFIND discovery; read phases add one metadata-only
UID-filtered REPORT and 1–5 bounded canonical GETs (normally one). This is not a
GET-only approval. Candidate bodies may expose substring-filter false positives;
exact UID/all-component verification precedes private evidence retention. Related
hrefs confer no write/delete ownership. Original schemas 1–3 stay separate.
Editing and review
After Clojure/EDN implementation edits, explicitly format the changed files:
zprint '{:search-config? true}' -w <changed-files>
Then review the formatted diff and run checks. fmt:check never rewrites files;
formatting is an explicit editing step, not a check side effect. For future local
work, obtain review before committing. This explicitly authorized remote handoff
instead uses commit-and-PR publication for review; it does not authorize merging
or deployment.
Package and future NixOS consumption
nix flake check path:.
nix build path:.
nix develop path:. --command bash -lc 'bb fmt:check && bb lint && bb test:unit && bb test:integration && bb test:mcp && bb package && bb smoke --jar target/nextcloud-mcp-server.jar && bb smoke --command ./result/bin/nextcloud-mcp-server'
Named/default packages and apps are available for each declared system; only x86_64-linux / OpenJDK 21.0.10 was checked on TobServer. The package executable uses absolute locked Nix Java/JAR paths and needs no source cwd or PATH Java/ Clojure/Babashka. It is an on-demand stdio client child, not a systemd service.
Packaging and NixOS documentation covers consumer flake and
future Hermes launch examples, runtime-only config/password files (including
sops-nix's nonsymlink-file requirement), source filtering, locks, the justified
minimal AOT nextcloud_mcp_server.launcher entrypoint and honest reproducibility
limits. Acceptance evidence separates source from
real packaged checks. Dependency provenance records pinned
inputs and notices; the owner has not selected a project distribution license.
The safe source-development launch remains.
clojure -Srepro -T:build check is retained; explicit clean removes all target/
and is never a check prerequisite. Do not use it on evidence to preserve.
No actual deployment, host/SOPS/Hermes configuration or live account/client/device acceptance occurred. The next integration step requires separate authorization. Ordinary automated T11 acceptance does not accept T6, unblock T9 or complete the recurring-reminder goal.
T2 compatibility proof
Pinned candidates: official MCP Java SDK 2.0.1
(io.modelcontextprotocol.sdk/mcp, including mcp-core and Jackson 3 mapping)
and iCal4j 4.4.0
(org.mnode.ical4j/ical4j). No alternative JSON stack is added.
src/nextcloud_mcp_server/mcp.clj uses McpJsonDefaults.getMapper,
StdioServerTransportProvider(mapper, input, output) and McpServer.sync.
The caller supplies SDK tool specifications and owns stream cleanup. The proof
tool still exists only in the test, not public registration or a parallel spike
executable. Ordinary T10 now reuses this foundation through core.clj and
documented lifecycle ownership.
SDK code owns JSON-RPC parsing and routing.
T4 extends ical.clj's CalendarBuilder foundation with retained source storage;
CalendarOutputter still validates the complete typed result, but its normalized
output is never used as storage.
nix develop path:. --command bb test:unit nextcloud-mcp-server.feasibility-test
Executed on Clojure 1.12.6 / OpenJDK 21.0.10: 4 tests, 68 assertions, zero failures/errors. The regression proofs cover:
- Jackson 3 SDK mapper round trips of typed/polymorphic tool results, Unicode, embedded newlines and structured content backed by Clojure maps/vectors.
- Actual SDK supplied-stream stdio initialization (protocol
2025-11-25), the initialized notification, listing one closed-schema tool, and invoking its Clojure handler with a validated text/structured result. Pipes are in-process; reads and SDK shutdown have five-second waits with explicit stream/executor cleanup. No sockets, subprocess server, Nextcloud access or credentials. - Representative VTODO (DATE start/due, status, progress, RRULE) and VEVENT (UTC start/end, status, escaped description) parse/serialize/reparse, preserving identity, properties and basic date semantics.
- Parsed
Recur.getDates(seed, start, end, maxCount)expansion forFREQ=DAILY;INTERVAL=2;COUNT=4: January 2, 4, 6 and 8, 2030. A narrow window, post-exhaustion window and two-result cap are also asserted. DATE fixtures avoid clock/default-zone dependence; the test JVM explicitly disables iCal4j timezone updates to prevent runtime external timezone downloads.
Formatting/lint and all unit regressions also pass (9 tests, 106 assertions),
including T1's fail-closed namespace/empty-suite/child-failure checks. The build
basis check and AOT compilation of both interop namespaces pass on the same JVM.
Three consecutive feasibility runs in one JVM also pass and exit normally without
System/exit, checking that cleanup does not rely on the suite wrapper killing
SDK threads. These are feasibility proofs, not lossless editing, general
recurrence support, secure untrusted-input handling, live interoperability or
production lifecycle proof; those remain later tasks.
T4 retained resources, dates and alarms
ical/parse returns a redacted, retained whole VCALENDAR resource, not a
reduced component map. Tobias approved retaining original content alongside
pinned iCal4j after the strict DST regression exposed PT24H becoming P1D in
the library's model. From noon in Berlin on 2030-03-30 those durations end at
13:00 versus 12:00 after the DST transition. They are not interchangeable.
ical-content is an opaque content-line index, not another typed codec. It
retains original physical lines (including folding, parameters, whitespace and
line endings); only explicitly edited property lines or explicitly removed
alarms change. New TEXT escaping and complete-resource parsing/validation still
use iCal4j. Bare LF/CR is normalized only for the parser's read view, never in
storage. No dependency/version changes, timezone downloads, DAV mutations or
live account access are involved.
Pure API and supported shapes
parse,original-text,semantic-tree,targets,component-contentandalarm-targetsretain original values and identity. Full semantic trees use property/parameter/component multisets, not a small field projection. Returned content is untrusted data, never instructions or default log content.modelandselect-componentexpose detached, normalized iCal4j interop views, not authoritative storage/identity. The library also trims some TEXT whitespace and normalizes some local-time labels. Never persist.toStringof these views or use them to infer original duration units. Mutating a view cannot affect the retained resource. The T2 interop proofs use this same API.patchreturns a new resource. A target is exactly{:uid "synthetic" :recurrence-id nil}for a master, or the original typed RECURRENCE-ID descriptor returned bytargetsfor an exception. Its value and complete parameters must match. Missing/ambiguous identities fail; position never selects a component. UID decoding uses original source, not trimmed model values. Exception-first and multiple-UID resources are supported.- Supported patch keys:
:summary,:description,:location,:dtstart,:due(VTODO),:dtend(VEVENT), and:duration(RFC duration string). Omitted means unchanged;nilclears. Unknown parameters on an edited field remain intact; temporal edits explicitly own only VALUE/TZID parameters. :alarmsis a vector of{:match original-alarm-tree :remove true}or{:match original-alarm-tree :patch {:description ... :trigger ...}}. Obtain trees fromalarm-targets. Equal duplicate matches are ambiguous. Trigger input is{:relative "-PT15M" :related "START"}(START default) or{:absolute timed-input}. Explicit trigger edits own VALUE/RELATED/TZID only. DISPLAY/AUDIO alarm field edits are supported; no implicit alarm creation, repair, timestamp update or DTSTART invention occurs.- Every result is reparsed, its entire retained tree checked against the
explicitly transformed tree, and the complete resource validated using
raw temporal/duration/alarm checks plus the existing validating outputter.
Its normalized output is discarded.
serializevalidates and returns retained storage, never model rendering.original-textcan read invalid/read-only resources without asserting validity. Rejected patches leave input unchanged.
Temporal policy and explicit restrictions
New date input is {:date "2030-01-02"}. New timed input is either
{:offset-date-time "2030-01-02T10:00:00+01:00"} or
{:local-date-time "2030-01-02T10:00:00" :zone "Europe/Berlin"}. New local gaps
fail; overlaps require :offset, e.g. "+01:00". Overlaps are stored in UTC so
the chosen occurrence is not lost in a TZID-local label. Normal zoned input
remains TZID-local; explicit offset input is stored in UTC. Absolute alarm input
is always stored in UTC. Subseconds and new floating input are unsupported.
Existing DATE, floating, UTC and TZID storage is never implicitly rewritten.
ical-time/floating-context exposes an explicit Europe/Berlin interpretation
context (including valid offsets), without choosing a gap/overlap interpretation
or implementing T7 queries. No host-default timezone or current clock is used.
DUE/DTEND and DURATION are exclusive; DURATION requires DTSTART and a positive value. DATE durations must use day/week units. Endpoints must be compatible and strictly ordered. Supported comparisons are DATE pairs, floating pairs, UTC pairs, or same-IANA-TZID pairs with unambiguous endpoints. Mixed temporal kinds, different TZIDs, custom-TZID ordered pairs and zoned gap/overlap comparisons remain read-only. New local/TZID date edits referencing an embedded definition are also refused: its rules could override the JDK's IANA interpretation. Use explicit offset/UTC input instead. Embedded VTIMEZONE definitions are preserved verbatim, not rewritten from JDK timezone data; this is not a general timezone query engine.
Relative START alarms require DTSTART. Relative END alarms require DUE (task), DTEND (event), or DTSTART plus DURATION. DISPLAY requires DESCRIPTION. Anchor removal fails unless the same explicit patch supplies a valid alternative or repairs/removes the dependent alarm. Absolute triggers remain absolute and untouched during other edits, including date changes. Nominal weeks/days remain separate from elapsed hours/minutes/seconds in duration validation.
Recurring temporal/series edits, RRULE/RDATE/EXDATE/RID changes, status/completion algorithms, scheduling resources (METHOD/target ORGANIZER/ATTENDEE), RANGE edits, non-alarm nested target components, unsupported field/action edits, ambiguous or duplicate singleton targets, and unindexable shapes are unwritable, not simplified. Original content remains readable. Parsing is capped at 1 MiB, 20,000 physical lines and depth 32; library/index failures have fixed sanitized codes, no raw ICS or upstream causes. Default resource printing is redacted.
Offline proof
nix develop path:. --command bb test:unit nextcloud-mcp-server.ical-test
nix develop path:. --command bash -lc 'bb fmt:check && bb lint && bb test:unit && bb test:integration'
The strict independent full-wire-tree oracle compares all values, parameters, multiplicities and nested components, normalizing only folding/order/quoting and RRULE key order. Synthetic fixtures and 32 deterministic generated cases prove preservation of unknown properties/parameters, Apple metadata, alarm UIDs, ACKNOWLEDGED, completed exceptions, VTIMEZONE, duration units and unrelated components. Temporal cases run under UTC, Honolulu and Tokyo host defaults. The DST fixture/regression is retained, not normalized or weakened. Targeted tests use no sockets/services/credentials; T3 loopback XML/URI/DAV and TZURL regressions remain separate. No live/client interoperability, full recurrence support, UI or deployment claim is made.
T3 discovery and security boundary
caldav/open-client accepts an explicit startup map (not MCP arguments). Use
with-open to close the owned JDK HTTP client, including after failure. The
:transport, :close! and :clock injection options are trusted application/test
seams, not remote inputs. No configuration file reader, command-line entry point,
production listener or MCP tools are added. No additional dependencies are needed.
Illustrative placeholder-only configuration; this is not a live connection example and does not identify the protected production task collection:
{:dav-base-uri "https://nextcloud.example.invalid/remote.php/dav/"
:username "nonadmin-account"
:app-password-file "/absolute/private/path/app-password"
:allowed-collections ["calendars/nonadmin-account/explicit-shared-collection/"]
:default-task-calendar
{:identity "calendars/nonadmin-account/explicit-shared-collection/"}
:enable-writes? false
:enable-recurring-writes? false}
Recommend a nonadmin account with explicitly shared resources. Account,
sharing and secret provisioning are manual and out of scope. Keep the password
file outside the repository and Nix store, readable only by its owner (e.g.
mode 0600); never pass passwords as command-line arguments, MCP inputs, Nix
values or logs. Only the explicit absolute regular file is read, at most 4096
bytes, with final symlinks refused. Printable ASCII app passwords may have one
terminal LF/CRLF. File access failures disclose no path, contents or cause.
Credentials necessarily exist transiently in JVM/HTTP memory; no secure-memory
zeroization guarantee is made. Secret and client printing is redacted.
discover! performs Depth-0 principal/home queries, then Depth-1 collection
queries, retaining resource type, components, privileges, display name and each
returned property's HTTP status. Omitted/404 component sets mean all components
(RFC 4791); forbidden/failed retrieval means unknown, not all. Empty component
sets support nothing. Missing/failed privileges never grant access. Discovery
returns metadata for available collections, even unallowed ones, and never
changes the allowlist or default. Display names are intentional untrusted result
data, not instructions, log content or capability evidence.
authorize! enforces exact configured identities, component support and DAV
privileges independently of MCP. default-task-calendar! resolves the configured
DEFAULT_TASK_CALENDAR mapping to exactly one discovered, allowed VTODO
collection for the requested operation. Optional {:display-name "exact name"}
lookup must be unambiguous across discovery and still pass the identity allowlist.
There is no fallback list, collection creation or automatic default selection.
Call default resolution when an operation needs it: metadata-only discovery does
not require a default or write privileges. Reads require DAV read;
create/update/delete policy checks require bind/write-content/unbind
respectively (or their DAV aggregate privileges), the write flag and allowlist.
Recurring writes additionally require their separate default-off flag. T5 adds
guarded internal write primitives below, but no write tools; these checks do not
establish T6 recurring-write compatibility.
Targets, limits and failures
- Production uses HTTPS and one approved origin/base path, ending in
/(e.g./remote.php/dav/, not a particular calendar subtree: principals and homes must also fit inside it). Hrefs resolve against the actual request URI. Encoded identities retain their spelling; they are not decoded for requests or authorization. Traversal, nested/invalid UTF-8 escapes, encoded separators, userinfo, queries/fragments, network-path authorities and prefix lookalikes are refused. This intentionally rejects some otherwise legal DAV paths, including literal percent, semicolon and encoded separator names. - All redirects are rejected, including same-origin redirects, before any
follow-up request. Configure the final DAV URL manually. No inherited proxy,
authenticator or cookie jar is used. HTTP is permitted only with the explicit
:profile :isolated-testand literal127.0.0.1; this is not a production insecure override. The loopback listener exists only in integration tests. - Hard ceilings (
config/limits) can be lowered via:limits, never raised: connect 2 seconds, complete request/body 5 seconds, entire discovery 15 seconds; 8 requests, 256 collections; each response 1 MiB, 10,000 XML elements, depth 32, 262,144 text characters and 32 attributes per element. The body is capped while streaming regardless of Content-Length, before XML parsing; SAX counts work during parsing. Deadlines use monotonic time; the injectedClocksupplies discovery timestamps. Trusted injected transports must honor their supplied timeout/body limits; their:close!callback owns cleanup. - SAX explicitly disables DTDs, external general/parameter entities, external DTD/schema access and XInclude. The actual iCal4j parse path sets its process-wide timezone-update setting to false before constructing the builder, overriding an enabled setting; TZURL updates must never access the network. T4 retains this actual-path protection in the codec and detached-model paths.
- Errors fail the whole discovery rather than return complete-looking partial results. Public discovery failures have fixed codes/messages, no upstream cause or metadata. Default stderr logging uses fixed vocabulary only, without targets, credentials, headers, XML/ICS or display names. No stdout logging. Owned HTTP resources have a two-second shutdown wait; fixture servers release blocked handlers, close exchanges and stop/await their worker pools.
Deterministic verification (not live compatibility)
nix develop path:. --command bb test:integration nextcloud-mcp-server.caldav-contract-test
nix develop path:. --command bash -lc 'bb fmt:check && bb lint && bb test:unit && bb test:integration'
Original synthetic loopback fixtures verify request methods/Depth/property names, principal/home/collection discovery, component and privilege outcomes, opaque hrefs, forbidden targets, redirects without destination requests, DTD/entity and TZURL attempts without canary requests, fixed/chunked oversized bodies, misleading lengths, stalled-body cancellation, XML/work limits and sanitized failures. Pure/injected unit tests cover configuration, exact defaults, ambiguous/missing names, allowlists, privilege/write/recurrence gates, clock and idempotent cleanup. Synthetic password files are temporary and removed; no existing credentials, external test services, account data or containers are used. No Nextcloud/iPhone interoperability or production lifecycle claim follows from these tests. Ordinary T10 now adds offline MCP subprocess tests; T6's opt-in live suite is separate and requires its explicit safety prerequisites. No UI or animation changes are made, so visual evidence is not applicable.
T5 conditional mutations and uncertain-outcome recovery
Internal synchronous functions in caldav compose T3 authorization/transport and
T4 retained-source editing. They are not a public CRUD/MCP surface. No production
account, collection identity, default mapping or synchronization is accessed or
changed; all write tests explicitly enable synthetic loopback configuration.
get-resource!accepts an exact{:collection ... :href ... :component ...}address. The href must be one opaque direct child of the allowed collection. Only:success/:presentcarries a retained:resourceand exact strong:etag;:success/:absent(404/410) has neither. Failed reads are not absence.create-identitytakes the exact collection, component and stableoperation_id(the Clojure key is:operation-id). Its versioned SHA-256 identity derives both UID and href without clock/random/process state. One operation ID denotes one immutable logical request, not an attempt. Build the resource with its returned target UID;create!requires that identity exactly and sendsIf-None-Match: *. Collision never selects another href or UID.update!accepts a successful canonical snapshot, explicit UID/original typed RECURRENCE-ID target, T4 patch, and operation ID.delete!accepts the snapshot, target and operation ID. Both require the unchanged single strong ETag inIf-Match: no trimming, weak tags, wildcard, tag lists, absent preconditions, unconditional overwrite or force path. Updates always use T4's validated retained source; normalized iCal4j serialization is never sent. Creation and deletion are restricted to a single nonrecurring component; unsupported shapes remain unwritable. Recurring label/alarm patches still require the separate default-off gate and T4's restrictions, not a completion/series algorithm.- Results distinguish
:success,:conflict(409/412, no retry),:unsupported(validation/policy rejection), and:outcome-unknown. Unexpected write responses and transport failures are uncertain, never proof of non-application. Every acknowledged write is followed by bounded canonical GET. Server normalization is returned as read, not fabricated from the request or PUT response. A deletion succeeds only with canonical absence, without a deleted-resource body/ETag. Failed canonical reads or changed/missing identities withhold writable state. - Unknown results carry
:identity, a small EDN:recoverydescriptor and:resolution :refetch-or-operator, but no top-level resource/ETag. The descriptor contains operation/resource/component identity, the original precondition and full-tree digests, not ICS or credentials. The old:before-etagis evidence, not a new writable ETag.recovery-descriptorcan reconstruct this evidence before sending or after restart from the original immutable request: original snapshot and T4-patched after-resource (nil before for create, nil after for delete). No operation cache/database supplies truth. reconcile!only GETs canonical server state. Full retained-tree fingerprints tolerate property/component order and folding, not altered text, timestamps, added properties orPT24HbecomingP1D. A desired-state match recognizes convergence, not historical attribution. Absence recognizes deletion; unchanged old state, absence after uncertain creation, other state/identity changes or uncertain GETs remain unknown. A timed-out request might still apply later. There is no automatic replay, duplicate creation, conflict overwrite or hidden retry engine. The pinned JDK's all-method retry override is refused; writes use HTTP/1.1 to avoid HTTP/2 unprocessed-stream replay. Dropped-response tests assert exactly one wire write.- Thread the result of each dependent step into the next: unknown/conflicting/
absent predecessors cannot feed update/delete. Future callers must resolve an
unknown step via reconciliation or explicit refetch/operator resolution, not
substitute an unrelated snapshot to bypass it.
completed-occurrence!only recognizes an already-completed explicit typed VTODO exception from canonical state; it never selects the master, invents an occurrence or advances a series. Interrupted multi-step tests change labels on fixed synthetic components only. They do not choose or claim a T9 recurrence representation/algorithm or T6 live interoperability. No recurring creation/deletion or public recurring tools.
All internal write paths retain exact allowlist, privileges, read-only, recurring, URI/credential/redirect, timeout/body, untrusted-calendar and offline-timezone boundaries. Read privilege is checked before writing because canonical GET is required. Upstream content/exceptions never appear in error diagnostics; resources remain redacted when printed. No additional libraries or tooling changes.
nix develop path:. --command bb test:integration nextcloud-mcp-server.mutation-contract-test
nix develop path:. --command bash -lc 'bb fmt:check && bb lint && bb test:unit && bb test:integration'
The deterministic fixtures cover exact methods/headers, stale/malformed/weak
ETags, 412/UID/href collisions, server normalization, failed canonical reads,
response loss before/after application, restart/request reconstruction, absence,
explicit completed occurrences and blocked interrupted steps. T4's exact retained
wire output and PT24H versus P1D regressions remain intact. No external test
services, credentials, containers, UI/animation changes or visual evidence apply.
T7 bounded event/task reads
See docs/reads.md for events/{collections!,list!,get!} and
tasks/{collections!,list!,occurrences!,get!}, temporal inputs, exact authorization,
completed/undated policy, supported recurrence and explicit coverage limitations.
Events/expanded occurrences require bounds; task lists may instead return stored
components without a window. Hard per-call caps are 366 elapsed days, 500 matched
resources and 1,000 items, with cumulative response/component/work/deadline limits.
Unsupported or truncated expansion is :partial with reasons and retained readable
resources, never apparently complete absence. No mutations, live requests or MCP
registration are triggered by reads; all mutation support is explicitly disabled.
nix develop path:. --command bb test:unit nextcloud-mcp-server.calendar-read-test
nix develop path:. --command bb test:unit nextcloud-mcp-server.read-service-test
nix develop path:. --command bb test:integration nextcloud-mcp-server.read-contract-test
nix develop path:. --command bash -lc 'bb fmt:check && bb lint && bb test:unit && bb test:integration'
Only deterministic synthetic/injected and loopback checks apply. T6 proof code, write safety gates and original-source/PT24H preservation remain unchanged. T7 read results remain read-only projections, not writable snapshots. T8 below adds separately guarded ordinary writes; ordinary T10 now wires these services through MCP. Recurring T9/full recurring T10 remain separate; ordinary T11 packaging is documented above. There are no UI/animation changes requiring visual evidence.
T8 constrained ordinary writes
See docs/writes.md for actual signatures, closed supported
fields, default-off gates, exact targets/defaults, strong preconditions, clear
semantics and GET-only recovery. events/{create!,update!,delete!} only handle
one-off personal events; tasks/{create!,update!,complete!,delete!} reject all
recurring mutations, regardless of flags or readable recurrence support.
reconcile! in each namespace recognizes canonical convergence without replay.
Every operation independently checks configuration/allowlist/component/privileges. Change services inspect canonical original content without replacing the caller's expected ETag; original and proposed scheduling/recurrence shapes are rejected. Explicit task completion sets consistent status/100%/UTC completion time from the injected clock, never a next task. Creates freeze the logical request's DTSTAMP alongside stable operation ID/UID/href for restart reconstruction. Existing retained-source, alarm, temporal and conditional transport protections remain.
nix develop path:. --command bb test:unit nextcloud-mcp-server.ordinary-write-test
nix develop path:. --command bb test:unit nextcloud-mcp-server.ordinary-ical-test
nix develop path:. --command bb test:integration nextcloud-mcp-server.ordinary-write-contract-test
nix develop path:. --command bash -lc 'bb fmt:check && bb lint && bb test:unit && bb test:integration'
Only synthetic injected and bounded loopback fixtures apply. No live Nextcloud, client/device, notification, package or deployment acceptance is claimed. T6 remains unaccepted and T9 blocked; no proof guard is removed, no recurring algorithm/tools are added. The ordinary T10 MCP/lifecycle surface is implemented; ordinary T11 packaging now has its own automated acceptance, separate from full recurring/live acceptance. No UI/animation changes require visual evidence.
T6 implementation-only compatibility harness
See docs/interop.md for the closed disposable config schema,
experimental single-resource representation, six finite schedule cases,
manifest recovery, evidence rules, manual pause/resume checklist and original-case
cleanup. A separate closed duration-due-comparison case initially titles its
matched UTC pair T6 duration test / T6 due-date test: PT24H without DUE versus
explicit DUE 24 elapsed hours later. It freezes one future UTC input before IO,
creates/readbacks only, then pauses; all other phases (including cleanup) fail
closed. See the operator template and read-only Details checklist.
Original schema-1 twelve-entry manifests/phase behavior remain unchanged; the
pair uses a case/version/schedule-bound schema-2 manifest, never a subset or
migration. The separate server-occurrence-completion case uses exactly one
initially distinct T6 server completion test, a frozen future UTC DTSTART,
one-hour explicit DUE offset, DAILY COUNT=3 and END-relative DISPLAY alarm.
Schema 3 binds exact scope/identity and original typed first RID. Seed creates and
pauses; separately approved complete-one requires a verified seed, atomically
adds one same-UID completed exception, and pauses. Gates-off verify/reconcile
perform bounded metadata PROPFINDs plus the owned-resource GET only; recovery
never retries or continues writes. No cleanup/selector/production registration.
See the complete operator schema and phase matrix.
This candidate is not the phone-initiated master/count-rewrite path; reported
success of the finished explicit-DUE phone diagnostic does not prove server-side
exception interoperability. Later supplied Tasks/Reminders observations rejected
this exception-only candidate; do not repair/reuse that run. The new closed
native observer
uses a fresh fixed title, schema-4 singleton and separate seed/baseline/observe
pauses to collect canonical evidence after one USER completion in Tasks, never
another server completion algorithm. Supplied subsequent native observation found
one shifted pending master with unchanged COUNT and no same-UID history in the
bounded observation; it does not establish global history loss. Overall T6
remains blocked, not passed by either native behavior or the T7 reader. Ordinary T4/T5 APIs retain
their recurring-write restrictions; narrowly
validated caldav/proof-* entry points share their codec/transport/conditional
machinery without exposing recurring MCP tools. Production flags/defaults are
unchanged.
nix develop path:. --command bb test:unit nextcloud-mcp-server.recurrence-proof-test
nix develop path:. --command bb test:unit nextcloud-mcp-server.duration-comparison-test
nix develop path:. --command bb test:unit nextcloud-mcp-server.server-completion-test
nix develop path:. --command bb test:unit nextcloud-mcp-server.native-observer-test
nix develop path:. --command bb test:integration nextcloud-mcp-server.native-observer-contract-test
nix develop path:. --command bb test:integration nextcloud-mcp-server.server-completion-contract-test
nix develop path:. --command bb test:integration nextcloud-mcp-server.recurrence-proof-contract-test
nix develop path:. --command bash -lc 'bb fmt:check && bb lint && bb test:unit && bb test:integration'
These are offline/synthetic loopback checks, not Nextcloud/Tasks/iPhone compatibility. No real password, metadata discovery, account mutation or device action was used for implementation. A later live run needs separate approval, actual client versions and independent manual observations/sign-off; an automated exit status never supplies that acceptance. T9 must rerun proof against its final implementation. No UI/animation changes or corresponding visual evidence apply.
No distribution license has been selected. No external project source code has been imported.