Repository navigation
feat(mcp): a local MCP server for reading settings and sessions - #286
Merged
Merged
Conversation
Started before nav read the config, the watcher's first snapshot held the defaults, so every launch told clients that each non-default setting had just changed. A refusal for a per-request revision now names only the one that carries _meta.
The same shape event:session sends, so the two agree on what waiting means, and leave out paths and terminal names the same way. Ended sessions are left out, and the watcher compares snapshots rather than a JSON signature.
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of four for a local MCP server in stack-nudge. The design is in
docs/design/local-mcp.mdand is worth reading before the code, the next three PRs follow its phases (write tools, MCP Events, extensions).This one is read only:
stack-nudge --mcpis a stdio bridge to~/.stack-nudge/mcp.sock(0600). Its own socket rather than panel.sock, since a bridge holds its connection open for as long as its client runs. The bridge's first line tells the app the Claude session id from its env and the pid that launched it, so who's calling never comes from what a model saysserver/discover, per request_meta,subscriptions/listen) and the older initialize handshake, which Claude Code and Codex still sendSettingsRegistry, one entry perSTACKNUDGE_key with the values it takes, and why it can't be changed from here where it can't. No secrets in itsettings_list,settings_get,sessions_list, and the settings and sessions resources with update notifications.sessions_listis the sameSessionSnapshotthatevent:sessionsends (feat(extensions): deliver event:session to trusted services #284), so the two agree on what waiting means and neither hands out pathsTo try it,
claude mcp add stack-nudge -- ~/Applications/StackNudge.app/Contents/MacOS/stack-nudge --mcp. Settings gets a row to copy that in the next PR.I've had the whole stack installed locally and driven it with a scripted client and real Claude Code runs, which is where the last commit came from: the server started before the config loaded, so every launch told clients each non-default setting had just changed.
Tests: new
MCPServerTests(the session against a fake app, the bridge, the registry, one round trip over a real socket) pass.