Skip to content

feat(mcp): stack-nudge's events over MCP Events, push and poll - #288

Merged
StuBehan merged 2 commits into
mainfrom
feat/mcp-events
Nov 25, 2026
Merged

StuBehan merged 2 commits into
mainfrom
feat/mcp-events

Conversation

@StuBehan

@StuBehan StuBehan commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Third of four for the local MCP server, following #287. This is the subscribe side, over the MCP Events extension (io.modelcontextprotocol/events), so a client can be told what stack-nudge knows instead of polling sessions_list.

Six event types:

  • session.waiting a session is blocked on you, session.stopped a turn finished, session.stalled the stalled rule fired. Filter by agent or repo
  • nudge.raised anything that isn't an agent's own lands in Events: GitHub, a script, an extension, a client's notify. Filter by source or tag
  • quota.threshold a usage window crossed the alert threshold
  • settings.changed with the old and new value and who changed it (Settings, the config file, or the MCP client by name)

Payloads are kept to who and where: no prompt text, tool input or message body, and the repo's name rather than its path, the same as sessions_list.

  • events/list, events/poll and events/stream (push, with a heartbeat the client can tune between 5 s and 5 min). Webhook delivery isn't offered, that needs an authenticated https callback and belongs to the relay in the design doc
  • the last 500 occurrences are kept so a client can resume from a cursor. A cursor from another launch, or older than what's kept, comes back as truncated rather than silently skipping
  • subscriptions/listen gets eventsListChanged, which phase 4 uses when extensions' event types come and go

Locally I had a client listening to settings.changed while another changed settings, and streams filtered by key or source only got their own. It's also where the config-load fix in #286 came from, every launch used to stream 17 changes.

Tests: MCPEventsTests (the hub, cursors and gaps, filters, payloads without prompt text, streams and heartbeats on a session) pass.

Base automatically changed from feat/mcp-write to main November 25, 2026 00:44
As sessions_list and event:session do, and as the design lists them. The filter is repo too.
@StuBehan
StuBehan merged commit fffed69 into main Nov 25, 2026
6 checks passed
@StuBehan
StuBehan deleted the feat/mcp-events branch November 25, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant