grouse-tools
# grouse-tools
**One goose extension for every grouse server-side feature.** Add one URL to goose and the
client gets attachments, notifications, thread notes and My Day — instead of three extension
blocks across two containers.
This repo is the home of that extension: the MCP front door, the tool contract, the one-click
installer, and the image/quadlet that run it.
```
goose ──MCP──▶ grouse-tools ──┬── attachments (in-process)
│ │ ├── notify (in-process, ACP into goose)
│ │ └── state (proxy → state store)
└──── ACP (chat) ────┘
```
## Install
Three shapes, one extension. Pick by where the server should live.
**1. In goose itself, from PyPI — the one-block install.** Press the uvx link in `install.html`,
or paste this into goose Desktop's deeplink handler:
```
goose://extension?cmd=uvx&arg=grouse-tools&name=grouse-tools&id=grouse-tools&timeout=300
```
Nothing has to exist on the machine first. `uvx` fetches the package and runs the stdio
server. Works out of the box for the file tools; push and thread notes need the env below.
Until the package is on PyPI, use the git form — same install, but the repo must be public:
```
make deeplink-uvx SPEC=git+https://github.com/ccgauvin94/grouse-tools
```
**2. A server you run once — recommended where many chats are live.** Build and run the image
(or the quadlet) somewhere the goose server can reach, then install by URL:
```
podman build -t localhost/grouse-tools:latest -f Containerfile .
make deeplink URL=http://grouse-tools:8770/mcp
```
**3. A checkout on this machine — `type: stdio` in `config.yaml`.** `run_stdio.py` is the same
server from a checkout; the block shape is in its docstring.
Whichever you pick, the extension is added as one block named `grouse-tools`. Enable it, then
open a **new chat** — goose freezes a session's tool list at creation.
For route 2, the URL is the one goose dials, not your browser's: `http://grouse-tools:8770/mcp`
on the same podman network, or a published/LAN address across hosts. The server is stateless
and safe to expose behind a bearer-checking proxy; it parses untrusted files, so keep it off
the public internet.
## Two transports, and when to use which
This is a goose extension either way — `goose://extension` installs an MCP server, and where
that server runs is a separate decision.
| | `run_http.py` | `run_stdio.py` |
|---|---|---|
| shape | one process, every session | one child **per session** |
| install | URL deeplink, works from any goose and any client | `type: stdio` block in `config.yaml` |
| best for | a server with many live chats | a laptop, a single-user install |
The per-session cost is the reason the container exists: measured on a goose server with 37
live sessions, stdio notify children alone were ~785 MB. A server should run the HTTP server
once. Both entry points call the same `handle()`, so the tool surface cannot drift between
them.
Desktop will only accept a stdio deeplink whose `cmd` is `cu`, `docker`, `jbang`, `npx`,
`uvx` or `goose` — `python3` is refused there, so a `python3` install is a `config.yaml` edit.
Publishing the package and installing via `uvx` is the one-click stdio path.
## Tool contract
Everything below is a tool the client (or a recipe) may call. Names are load-bearing: a rename
is a coordinated client release, and `tests/test_contract.py` fails if one disappears.
| group | tools | what it does |
|---|---|---|
| files | `attachment_begin`, `attachment_chunk`, `attachment_commit`, `attachment_share`, `attachment_read`, `describe_image` | the phone uploads in chunks; the agent shares a file by path and the client pulls the bytes on demand |
| notify | `notify`, `thread_note`, `compact_thread`, `tidy_sessions`, `purge_sessions` | a push to the phone; one line appended into a thread's own conversation; session housekeeping |
| state | `state_items`, `state_item`, `state_close`, `state_snooze`, `state_react`, `state_sensitivity`, `state_sensitivity_preview`, `task_list`, `thread_sessions`, `thread_link`, `thread_timeline` | My Day's open loops and handovers, the thread map, an area's timeline (proxied to the state store) |
`docs/TOOLS.md` has the per-tool shapes and the invariants behind them.
## Why the state half is proxied
The state store owns a SQLite schema, migrations, salience, a matcher and a maintenance
timer. Folding it in here would mean copying thousands of lines (a fork that drifts) or moving
a live store. Proxying keeps one tool surface for the client and leaves the store where it
belongs.
`ASSISTANT_STATE_URL` unset ⇒ the state tools are simply not advertised; everything else still
works, which is what makes this installable on a goose host that has no assistant.
## Env
See `.env.example`. The three groups need:
- **files**: `ATTACHMENTS_DIR` (required), `ATTACHMENTS_IMPORT_ROOTS`, optional vision
(`VISION_URL`/`VISION_MODEL`/`VISION_API_KEY`) for `describe_image`.
- **notify**: `GOOSE_ACP_HOST`/`GOOSE_ACP_PORT`/`GOOSE_SERVER__SECRET_KEY` (ACP to the same
goose), `GOOSE_SESSIONS_DB` (the sessions *directory*), `GOOSE_PUSH_ENDPOINT` as a bootstrap
only — the live UnifiedPush endpoint is learned over ACP and left behind for the senders.
- **state**: `ASSISTANT_STATE_URL`, `ASSISTANT_STATE_TOKEN`.
## Compatibility with the legacy blocks
goose namespaces a tool by its extension block, so this block makes every tool
`grouse-tools__<tool>`. Deployments that still declare the old `attachments`, `notify` and
`assistant-state` blocks keep working unchanged; nothing here removes them. Moving a client to
the merged name is a client change (the core currently asks for `assistantstate__…`,
`notify__…`, `attachments__…`), tracked in `docs/TOOLS.md`.
## Layout
```
src/grouse_tools/__init__.py the front door: TOOLS, handle(), routing, state proxy
src/mcp_http.py the stdlib Streamable-HTTP transport (no SDK, no pip)
vendor/ attachments_mcp + notify_mcp (a snapshot; scripts/sync-vendor.sh)
run_http.py the entry point (one process, every session)
run_stdio.py the stdio entry point (one child per session)
install.html, scripts/deeplink.py the one-click installer
Containerfile, deploy/ image + rootless podman quadlet
tests/ the tool contract (stdlib unittest)
```
`vendor/` is a snapshot of implementations that are developed elsewhere today, because a
container there serves them. `scripts/sync-vendor.sh` is the only sanctioned way to refresh
it; retire it when those packages move here.
## License
AGPL-3.0-or-later, matching grouse.
TDQS
Scored across 14 tools
The attachment_* family is the main risk area, but the descriptions explicitly carve boundaries (attachment_share for showing files, attachment_read for client byte downloads, attachment_extract for text, describe_image for vision). tidy_sessions vs purge_sessions (archive vs permanent delete) and compact_thread vs thread_note (thread summarisation vs thread log) are clearly distinguished. Only attachment_read vs attachment_extract remain mildly confusable since both return offset/total character windows from a stored file.
All names are snake_case, and the seven attachment_* tools form a clean resource-prefixed family (begin/chunk/commit/share/read/list/extract). The rest are verb_noun (compact_thread, describe_image, tidy_sessions, purge_sessions, thread_note) with two bare verbs (notify) and one noun (now) that break the pattern slightly but stay readable and unambiguous.
14 tools is comfortably within a well-scoped range, and each tool maps to a real operation. The set is slightly heavy on attachment plumbing (begin/chunk/commit is three calls for one logical action), but that is justified by the stated transport chunking constraint rather than redundancy.
The surface covers upload, read, extract, share and list for attachments, but there is no attachment_delete/cleanup and no way to abort a failed in-progress upload (begin/chunk/commit only). Threads can be written to via thread_note but never listed or read back, and `now` advertises an overnight cutoff 'to bound message searches' when no message-search tool exists in this set, leaving a dangling dead end.