lattice-mcp 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > `lattice-mcp` is the **Model Context Protocol server for Lattice**, the container
4
4
  > orchestration platform that runs every `appleby.cloud` service. It exposes the
5
- > `lattice-api` admin surface to Claude Code as **125 typed tools** — workers, stacks,
5
+ > `lattice-api` admin surface to Claude Code as **126 typed tools** — workers, stacks,
6
6
  > containers, deployments, databases, registries, networks, volumes and instance config.
7
7
  > This file orients any agent/worker before touching code in this repo.
8
8
  >
@@ -42,7 +42,7 @@ Those live in [`lattice-api`](https://github.com/aidenappl/lattice-api) and
42
42
 
43
43
  | Path | Role |
44
44
  |------|------|
45
- | `index.js` | Everything: `--setup` flow, config read, `api()` HTTP helper, `text()`/`body()` helpers, all 125 `server.tool(...)` registrations, transport connect. |
45
+ | `index.js` | Everything: `--setup` flow, config read, `api()` HTTP helper, `text()`/`body()` helpers, all 126 `server.tool(...)` registrations, transport connect. |
46
46
  | `package.json` | npm metadata. `bin.lattice-mcp` → `index.js`, so `npx lattice-mcp` works. |
47
47
  | `README.md` | User-facing setup + full tool table. |
48
48
  | `AGENTS.md` | This file. |
@@ -126,13 +126,13 @@ exits immediately if either is missing. In practice these come from the `env` bl
126
126
 
127
127
  **Tool groups**, in file order:
128
128
 
129
- The counts below sum to **125**, matching the header and `grep -c 'server.tool(' index.js`. The
130
- first six rows are the original, pre-`1.1.0` tools (registered top-of-file with no banner comment);
129
+ The counts below sum to **126**, matching the header and `grep -c 'server.tool(' index.js`. The
130
+ first rows are the original, pre-`1.1.0` tools (registered top-of-file with no banner comment);
131
131
  every bolded row corresponds to a `// ───` banner group and matches its exact in-file name.
132
132
 
133
133
  | Group | Tools | Notes |
134
134
  |-------|-------|-------|
135
- | Overview & health | 2 | `lattice_overview`, `lattice_health` |
135
+ | Overview & health | 3 | `lattice_overview`, `lattice_health`, `lattice_get_version` |
136
136
  | Workers | 3 + 4 actions | list/get/metrics; reboot, upgrade, stop-all, start-all |
137
137
  | Stacks | 2 + 5 actions | list/get; deploy, restart, stop, start, update |
138
138
  | Containers | 4 + 8 actions | list/get/logs/lifecycle; start, stop, restart, kill, pause, unpause, remove, recreate. (`lattice_get_container_metrics` is *not* here — it lives under **Discovery & diagnostics**.) |
@@ -162,6 +162,12 @@ always 400'd); and `lattice_test_backup_destination` now marks `worker_id` as **
162
162
  param the handler 400s without — the test dispatches over the worker's WebSocket). It also hardens
163
163
  `api()` against non-JSON responses (see *How code is written here*) and declares `zod` explicitly.
164
164
 
165
+ **1.1.2** adds `lattice_get_version` (`GET /version`, so agents can read the deployed API version
166
+ for deploy-drift checks without shelling out to `curl`), and widens two read tools to pass filter
167
+ params the handlers already accept but the tools were dropping: `lattice_get_audit_log` gains
168
+ `user_id` / `action` / `resource_type` / `offset` (answer "who deleted stack X" server-side instead
169
+ of scanning 50 rows), and `lattice_get_container_logs` gains `offset` / `worker_id`. Tool count 125 → 126.
170
+
165
171
  **Consolidations.** Where `lattice-api` exposes several paths served by one handler, this repo
166
172
  exposes one tool with an enum rather than N tools. `lattice_database_action` covers
167
173
  `/start`, `/stop`, `/restart` and `/remove`. Worker actions are the historical exception — they
package/README.md CHANGED
@@ -8,7 +8,7 @@ Model Context Protocol server for [Lattice](https://github.com/aidenappl/lattice
8
8
 
9
9
  ## Overview
10
10
 
11
- `lattice-mcp` is a single-file Node ESM program (`index.js`) that speaks MCP over stdio and translates tool calls into HTTP requests against the `lattice-api` admin surface. It exposes **125 typed tools** and holds no business logic, caching or state of its own — every behaviour (pagination, validation, side effects) comes from `lattice-api`.
11
+ `lattice-mcp` is a single-file Node ESM program (`index.js`) that speaks MCP over stdio and translates tool calls into HTTP requests against the `lattice-api` admin surface. It exposes **126 typed tools** and holds no business logic, caching or state of its own — every behaviour (pagination, validation, side effects) comes from `lattice-api`.
12
12
 
13
13
  Once configured, ask Claude Code things like:
14
14
 
@@ -83,18 +83,19 @@ Restart Claude Code after setup so the new server and tools are picked up.
83
83
  | `npm install` | Install dependencies (not vendored) |
84
84
  | `node --check index.js` | Syntax gate — the only static check that exists |
85
85
  | `LATTICE_API_URL=… LATTICE_API_TOKEN=… node index.js` | Run the server on stdio |
86
- | `grep -c 'server.tool(' index.js` | Confirm the tool count (should be 125) |
86
+ | `grep -c 'server.tool(' index.js` | Confirm the tool count (should be 126) |
87
87
  | `npm publish` | Publish to npm — **this is deployment** (requires 2FA passkey from an interactive terminal) |
88
88
 
89
89
  ## Tools
90
90
 
91
- All 125 tools, grouped as they appear in `index.js`. ⚠️ marks destructive tools; their descriptions state the blast radius.
91
+ All 126 tools, grouped as they appear in `index.js`. ⚠️ marks destructive tools; their descriptions state the blast radius.
92
92
 
93
93
  ### Overview & health
94
94
  | Tool | Description |
95
95
  |------|-------------|
96
96
  | `lattice_overview` | Fleet overview — worker/stack/container counts, failed stacks, CPU/memory |
97
97
  | `lattice_health` | API health and database connectivity |
98
+ | `lattice_get_version` | Deployed lattice-api version string — check deploy drift against GitHub tags |
98
99
 
99
100
  ### Workers
100
101
  | Tool | Description |
@@ -123,7 +124,7 @@ All 125 tools, grouped as they appear in `index.js`. ⚠️ marks destructive to
123
124
  |------|-------------|
124
125
  | `lattice_list_containers` | List containers with status, image, ports, health |
125
126
  | `lattice_get_container` | Full container details |
126
- | `lattice_get_container_logs` | Recent container logs (stdout/stderr) |
127
+ | `lattice_get_container_logs` | Recent container logs (stdout/stderr); `offset` paginates into older logs, filter by `stream`/`worker_id` |
127
128
  | `lattice_get_container_lifecycle` | Lifecycle events (start, stop, health changes) |
128
129
  | `lattice_start_container` | Start a stopped container |
129
130
  | `lattice_stop_container` | Stop a running container |
@@ -151,7 +152,7 @@ All 125 tools, grouped as they appear in `index.js`. ⚠️ marks destructive to
151
152
  ### Audit & API tokens
152
153
  | Tool | Description |
153
154
  |------|-------------|
154
- | `lattice_get_audit_log` | Recent audit log entries (who did what, when) |
155
+ | `lattice_get_audit_log` | Audit log entries (who did what, when); filter by `user_id`/`action`/`resource_type`, `offset` paginates |
155
156
  | `lattice_list_api_tokens` | List API tokens |
156
157
  | `lattice_create_api_token` | Create a new API token |
157
158
  | `lattice_delete_api_token` | Delete an API token ⚠️ |
@@ -285,7 +286,7 @@ Everything lives in one file:
285
286
 
286
287
  | Path | Role |
287
288
  |------|------|
288
- | `index.js` | The whole server: `--setup` flow, config read, `api()` HTTP helper, `text()`/`body()` helpers, all 125 `server.tool(...)` registrations, transport connect. |
289
+ | `index.js` | The whole server: `--setup` flow, config read, `api()` HTTP helper, `text()`/`body()` helpers, all 126 `server.tool(...)` registrations, transport connect. |
289
290
  | `package.json` | npm metadata; `bin.lattice-mcp` → `index.js`. |
290
291
  | `AGENTS.md` | Contributor/agent guide — conventions, handler contracts, verification. |
291
292
  | `README.md` | This file. |
package/index.js CHANGED
@@ -114,7 +114,7 @@ function body(obj) {
114
114
 
115
115
  const server = new McpServer({
116
116
  name: "lattice",
117
- version: "1.1.1",
117
+ version: "1.1.2",
118
118
  });
119
119
 
120
120
  // Overview
@@ -129,6 +129,12 @@ server.tool("lattice_health", "Check API health and database connectivity", {},
129
129
  return { content: text(res) };
130
130
  });
131
131
 
132
+ // Version
133
+ server.tool("lattice_get_version", "Get the deployed lattice-api version string. Use to check deploy drift against GitHub tags/commits (e.g. for /howfarbehind).", {}, async () => {
134
+ const res = await api("GET", "/version");
135
+ return { content: text(res) };
136
+ });
137
+
132
138
  // Workers
133
139
  server.tool("lattice_list_workers", "List all workers with status, IP, Docker version, runner version, last heartbeat", {
134
140
  status: z.enum(["online", "offline", "disconnected"]).optional().describe("Filter by worker status"),
@@ -189,9 +195,11 @@ server.tool("lattice_get_container", "Get full container details including confi
189
195
  server.tool("lattice_get_container_logs", "Get recent container logs (stdout/stderr)", {
190
196
  id: z.number().describe("Container ID"),
191
197
  limit: z.number().optional().describe("Number of log lines (default 50)"),
198
+ offset: z.number().optional().describe("Skip this many lines — paginate past the tail into older logs"),
192
199
  stream: z.enum(["stdout", "stderr"]).optional().describe("Filter by stream"),
193
- }, async ({ id, limit, stream }) => {
194
- const res = await api("GET", `/admin/containers/${id}/logs`, { limit, stream });
200
+ worker_id: z.number().optional().describe("Filter by worker ID"),
201
+ }, async ({ id, limit, offset, stream, worker_id }) => {
202
+ const res = await api("GET", `/admin/containers/${id}/logs`, { limit, offset, stream, worker_id });
195
203
  return { content: text(res) };
196
204
  });
197
205
 
@@ -228,10 +236,14 @@ server.tool("lattice_get_deployment_logs", "Get deployment logs: pull, create, s
228
236
  });
229
237
 
230
238
  // Audit log
231
- server.tool("lattice_get_audit_log", "Get recent audit log entries (who did what, when)", {
239
+ server.tool("lattice_get_audit_log", "Get recent audit log entries (who did what, when). Filter by user, action, or resource type to answer 'who deleted X' without scanning.", {
232
240
  limit: z.number().optional().describe("Number of entries (default 50)"),
233
- }, async ({ limit }) => {
234
- const res = await api("GET", "/admin/audit-log", { limit });
241
+ offset: z.number().optional().describe("Skip this many entries for pagination"),
242
+ user_id: z.number().optional().describe("Filter by the user who performed the action"),
243
+ action: z.string().optional().describe("Filter by action (e.g. create, update, delete, deploy)"),
244
+ resource_type: z.string().optional().describe("Filter by resource type (e.g. stack, container, worker, registry)"),
245
+ }, async ({ limit, offset, user_id, action, resource_type }) => {
246
+ const res = await api("GET", "/admin/audit-log", { limit, offset, user_id, action, resource_type });
235
247
  return { content: text(res) };
236
248
  });
237
249
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lattice-mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "MCP server for Lattice container orchestration platform",
5
5
  "type": "module",
6
6
  "main": "index.js",