feat: querypad mcp-attach - bridge stdio to an app-hosted MCP socket - #27
Merged
Conversation
The desktop app's data channel (ROADMAP step 8 phase 3) works by hosting the MCP conversation on a Unix socket the app owns: the app spawns querypad mcp over stdio, listens on the socket, and proxies frames between the two - which puts every tool call and result set in the app's hands to drive native panels. Claude Code cannot connect to a socket; it spawns a stdio command or calls HTTP. This is the missing wire: claude mcp add datactx -- querypad mcp-attach /tmp/datactx.sock Deliberately dumb - no framing, no parsing, no buffering policy. The app and the engine own the protocol. The engine is untouched, which keeps the architecture rule intact: surfaces stay thin, and stdio remains the only transport the server knows. e2e-tested both directions through a real socket, plus the loud failure when the socket is absent.
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.
Why
The desktop app's data channel (ROADMAP step 8 phase 3) hosts the MCP conversation on a Unix socket the app owns: the app spawns
querypad mcpover stdio, listens on the socket, and proxies frames between the two. That puts every tool call and result set in the app's hands to drive native panels - the difference between a pretty terminal and a data cockpit.Claude Code cannot connect to a socket; it spawns a stdio command or calls HTTP. This is the missing wire:
What
A byte-for-byte stdio-to-socket bridge, ~35 lines. Deliberately dumb: no framing, no parsing, no buffering policy of its own - the app and the engine own the protocol.
The engine is untouched, which keeps the architecture rule intact: surfaces stay thin, and stdio remains the only transport the server knows.
Verification
npm run checkexit 0;npm run test:cli150 pass / 0 fail🤖 Generated with Claude Code
https://claude.ai/code/session_01CKZ9UVgw2Mhiu6T5YAG7k6