mirror of
https://github.com/Dasemu/nextcloud-mcp.git
synced 2026-11-26 15:26:08 +00:00
chore: bootstrap Claude setup
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
33bae54e91
commit
53fc8b2865
12 files changed
+237
No files matched your search
@@ -0,0 +1,29 @@
|
||||
# Architecture
|
||||
|
||||
`server.py` is a single-file MCP server (streamable-http transport, via the
|
||||
`mcp` package's `MCPServer`) that proxies calls to a Nextcloud instance.
|
||||
|
||||
## Layers
|
||||
|
||||
- **Files**: WebDAV (`PROPFIND`, `GET`, `PUT`, `DELETE`, `MKCOL`, `MOVE`) under
|
||||
`/remote.php/dav/files/{user}/`, plus the unified search OCS endpoint and
|
||||
the file-sharing OCS API.
|
||||
- **Calendars**: CalDAV under `/remote.php/dav/calendars/{user}/`. Events and
|
||||
tasks (VTODO) are built/parsed with `vobject`. `list_events` uses a
|
||||
server-side `calendar-query` with `c:expand` so recurring events come back
|
||||
as individual occurrences.
|
||||
- **Address books**: CardDAV under `/remote.php/dav/addressbooks/users/{user}/`,
|
||||
contacts as vCards via `vobject`.
|
||||
- **Talk**: Nextcloud Talk's OCS Spreed API (`/ocs/v2.php/apps/spreed/api/`)
|
||||
for listing conversations and reading/sending chat messages.
|
||||
|
||||
All Nextcloud calls use HTTP Basic auth (`NEXTCLOUD_USERNAME` /
|
||||
`NEXTCLOUD_PASSWORD`) through a short-lived `httpx.Client` per request
|
||||
(`_client()`).
|
||||
|
||||
## Adding a tool
|
||||
|
||||
Add a function decorated with `@mcp.tool()`; its docstring becomes the tool
|
||||
description shown to the agent. Keep request/response shaping (XML/vCard/
|
||||
iCalendar parsing) in a private helper near the existing `_parse_*` /
|
||||
`_summarize_*` functions so tools stay thin.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Deployment
|
||||
|
||||
The repo currently ships a `nixpacks.toml` (`python server.py`), i.e. it is
|
||||
built/run through Nixpacks rather than this org's standard LXC/VPS + systemd
|
||||
setup.
|
||||
|
||||
This does not yet follow the `web-deploy` standard. Missing pieces, if the
|
||||
deployment target is ever moved to an LXC/VPS:
|
||||
|
||||
- A systemd unit file to run `server.py` as a service.
|
||||
- An idempotent `scripts/update.sh` (pull, install deps, restart).
|
||||
- An authenticated HTTP endpoint that triggers the update script (token auth,
|
||||
single-flight, status, rate limiting).
|
||||
|
||||
Until then, deploy via whatever platform consumes `nixpacks.toml` and set the
|
||||
environment variables listed in `.env.example`.
|
||||
Reference in new issue
Block a user