Skip to content

Commit 735c4c5

Browse files
authored
Add Cospend tools — 16 tools for projects, members, bills (OCS) (#52)
1 parent 99470be commit 735c4c5

7 files changed

Lines changed: 1328 additions & 3 deletions

File tree

PROGRESS.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@
4242
- [x] File Reminders tools: get_file_reminder, set_file_reminder, remove_file_reminder (2026-04-22)
4343
- [x] Forms tools: 25 tools covering forms, questions, options, shares, submissions CRUD + export (2026-04-23)
4444
- [x] Circles (Teams) tools: 14 tools — list/CRUD circles, member add/remove/level, search, join/leave (2026-04-24)
45+
- [x] Cospend tools: 16 tools — projects (7), members (4), bills (5) — shared expense tracking (2026-04-26)
4546

4647
### In Progress
4748

4849
### Blocked
4950
(none)
5051

5152
### Next Up
52-
- Weather Status (fully OCS). Tables, Polls, Notes, Deck, Bookmarks, Photos skipped — API not OCS or OCS incomplete.
53+
- Cospend follow-ups (Shares: 5 share types; Categories/Payment modes/Currencies; Statistics export). Weather Status (fully OCS, bundled). Tables, Polls, Notes, Deck, Bookmarks, Photos skipped — API not OCS or OCS incomplete.
5354

5455
## Phases
5556

@@ -98,7 +99,8 @@
9899
| File Reminders | 3 | 20 |
99100
| Forms | 25 | 34 |
100101
| Circles | 14 | 31 |
101-
| **Total** | **141** | **836** |
102+
| Cospend | 16 | 35 |
103+
| **Total** | **157** | **871** |
102104

103105
Files shows 10, but one (`upload_file_from_path`) is only registered when
104-
`NEXTCLOUD_MCP_UPLOAD_ROOT` is configured. Default deployments expose 140 tools.
106+
`NEXTCLOUD_MCP_UPLOAD_ROOT` is configured. Default deployments expose 156 tools.

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ A 141st tool, `upload_file_from_path`, is registered only when the operator sets
5858
| [Collectives](#collectives) | list, pages, create, trash, restore | OCS |
5959
| [Forms](#forms) | CRUD forms, questions, options, shares, submissions + export | OCS |
6060
| [Circles (Teams)](#circles-teams) | list, CRUD, members (add/remove/promote), join/leave, search | OCS |
61+
| [Cospend](#cospend) | shared expense tracking — projects, members, bills | OCS |
6162
| [Unified Search](#unified-search) | list providers, search across apps | OCS |
6263
| [App Management](#app-management) | list, info, enable, disable apps | OCS |
6364

@@ -414,6 +415,29 @@ call; the body is streamed in chunks rather than loaded into memory.
414415
| `delete_circle` | destructive | Delete a circle |
415416
| `remove_circle_member` | destructive | Kick a member |
416417

418+
### Cospend
419+
420+
Shared expense tracking ("who paid for what"). Requires the [Cospend](https://apps.nextcloud.com/apps/cospend) app to be installed and enabled. All routes are OCS at `/ocs/v2.php/apps/cospend/api/v1/`.
421+
422+
| Tool | Permission | Description |
423+
|------|-----------|-------------|
424+
| `list_cospend_projects` | read | List projects the user can access |
425+
| `get_cospend_project` | read | Get full project info (members, balance, shares, settings) |
426+
| `get_cospend_project_statistics` | read | Per-member spending stats (paid/spent/balance) with filters |
427+
| `get_cospend_project_settlement` | read | Suggested reimbursement transactions to settle a project |
428+
| `list_cospend_members` | read | List members of a project |
429+
| `list_cospend_bills` | read | List bills with filters (payer, category, search, pagination) |
430+
| `get_cospend_bill` | read | Get a single bill |
431+
| `create_cospend_project` | write | Create a project (caller becomes ADMIN) |
432+
| `update_cospend_project` | write | Update project name, currency, sort, archive, etc. |
433+
| `create_cospend_member` | write | Add a member (free-form name or linked to a Nextcloud user) |
434+
| `update_cospend_member` | write | Update name/weight/color/activated/userid |
435+
| `create_cospend_bill` | write | Create a bill (defaults date to today if neither date nor timestamp set) |
436+
| `update_cospend_bill` | write | Update any bill field |
437+
| `delete_cospend_project` | destructive | Delete a project and all its data |
438+
| `delete_cospend_member` | destructive | Delete (or soft-disable if member has bills) |
439+
| `delete_cospend_bill` | destructive | Delete a bill (default: trash; pass `move_to_trash=False` to purge) |
440+
417441
### Unified Search
418442

419443
| Tool | Permission | Description |

src/nc_mcp_server/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
collectives,
1616
comments,
1717
contacts,
18+
cospend,
1819
files,
1920
forms,
2021
mail,
@@ -65,6 +66,7 @@ def create_server(config: Config | None = None) -> FastMCP:
6566
collectives.register(mcp)
6667
comments.register(mcp)
6768
contacts.register(mcp)
69+
cospend.register(mcp)
6870
files.register(mcp)
6971
forms.register(mcp)
7072
mail.register(mcp)

0 commit comments

Comments
 (0)