Skip to content

feat(mcp): module state and logs as MCP resources - #457

Merged
stakach merged 1 commit into
masterfrom
feat/mcp-module-resources
Oct 20, 2026
Merged

stakach merged 1 commit into
masterfrom
feat/mcp-module-resources

Conversation

@stakach

@stakach stakach commented Oct 20, 2026

Copy link
Copy Markdown
Member

Brings the module debugging features of the /systems/control websocket to MCP clients, using the resource templates, subscriptions and long running routes from action-controller 9.3.

  • Resource templates: placeos://modules/{id}/state, placeos://modules/{id}/state/{key}, placeos://systems/{sys_id}/{module_slug}/{key} and placeos://modules/{id}/logs{?seconds,level}
  • Subscriptions: the two state value templates can be subscribed to. Watchers use the websocket's redis subscriptions, so any instance can serve a client, and clients re-read the resource when notified
  • GET /modules/:id/state/:key/value: returns the stored JSON as is, for MCP reads. state_lookup is unchanged
  • GET /modules/:id/logs: captures a module's debug output for seconds (30s default, 36h max) at or above level, streamed over HTTP and spooled to disk for MCP clients, capped at 3 MiB with a truncation marker
  • Permissions: module logs need support or admin users, or support subsystem Operate and Read (or Manage) on the module's zones. The websocket debug command now requires the same
  • Requires action-controller >= 9.3.0, which no longer issues Mcp-Session-Id (spec updated)

Specs: the new and affected spec files pass locally (80 examples, 0 failures).

🤖 Generated with Claude Code

@github-actions github-actions Bot added the type: enhancement new feature or request label Oct 20, 2026
Uses the resource templates, subscriptions and long running routes from
action-controller 9.3 to bring the module debugging features of the
control websocket to MCP clients.

- resource templates: `placeos://modules/{id}/state`,
  `placeos://modules/{id}/state/{key}`, `placeos://systems/{sys_id}/{module_slug}/{key}`
  and `placeos://modules/{id}/logs{?seconds,level}`
- the two state value templates can be subscribed to. Watchers use the
  websocket's redis subscriptions, so any instance can serve a client, and
  clients re-read the resource when notified
- GET /modules/:id/state/:key/value returns the stored JSON as is, for MCP
  reads. `state_lookup` is unchanged
- GET /modules/:id/logs captures a module's debug output for `seconds`
  (30s default, 36h max) at or above `level`, streamed over HTTP and spooled
  to disk for MCP clients, capped at 3 MiB with a truncation marker
- module logs need support or admin users, or support subsystem Operate and
  Read (or Manage) on the module's zones. The websocket `debug` command now
  requires the same
- requires action-controller >= 9.3.0, which no longer issues Mcp-Session-Id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stakach
stakach force-pushed the feat/mcp-module-resources branch from 0dd202f to de256b6 Compare October 20, 2026 06:11
@github-actions github-actions Bot added type: enhancement new feature or request and removed type: enhancement new feature or request labels Oct 20, 2026
@stakach
stakach merged commit 325fdc0 into master Oct 20, 2026
11 checks passed
@stakach
stakach deleted the feat/mcp-module-resources branch October 20, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement new feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant