Skip to content

feat: querypad mcp-attach - bridge stdio to an app-hosted MCP socket - #27

Merged
kiyeonjeon21 merged 1 commit into
mainfrom
feat/mcp-attach
Jul 25, 2026
Merged

feat: querypad mcp-attach - bridge stdio to an app-hosted MCP socket#27
kiyeonjeon21 merged 1 commit into
mainfrom
feat/mcp-attach

Conversation

@kiyeonjeon21

Copy link
Copy Markdown
Owner

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 mcp over 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:

claude mcp add datactx -- querypad mcp-attach /tmp/datactx.sock

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 check exit 0; npm run test:cli 150 pass / 0 fail
  • e2e: a real socket server round-trips a JSON-RPC line in both directions through the spawned CLI, and closing stdin ends the bridge with exit 0
  • e2e: a missing socket fails loudly on stderr with exit 1

🤖 Generated with Claude Code

https://claude.ai/code/session_01CKZ9UVgw2Mhiu6T5YAG7k6

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.
@kiyeonjeon21
kiyeonjeon21 merged commit 10c4775 into main Jul 25, 2026
1 check passed
@kiyeonjeon21
kiyeonjeon21 deleted the feat/mcp-attach branch July 25, 2026 19:42
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