Skip to content

feat(mcp): add askable-mcp stdio CLI for command-based MCP clients - #349

Merged
vamgan merged 1 commit into
mainfrom
claude/mcp-stdio-cli
Jun 28, 2026
Merged

vamgan merged 1 commit into
mainfrom
claude/mcp-stdio-cli

Conversation

@vamgan

@vamgan vamgan commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds askable-mcp, a turnkey stdio MCP server binary, so MCP clients that launch a command (Claude Desktop, Cursor) — rather than connecting to an HTTP URL — can read your app's UI context.

Why

The existing path requires running an HTTP server (Express). Many MCP clients instead spawn a stdio command. This closes that gap with no new runtime dependencies — it reuses the already-present @modelcontextprotocol/sdk (StdioServerTransport) and node:util.parseArgs (no arg-parser, no server framework).

What's included

  • askable-mcp bin — serves the askable context tools/resources over stdio, backed by:
    • --url <endpoint> — fetches the current Context packet from an HTTP(S) endpoint, or
    • --file <path> — serves a static packet file
    • plus --header "K: V" (repeatable), --name, --require-redacted, --help
  • createAskableMcpRemoteProvider({ url, headers }) — exported for programmatic use (also what the CLI uses).
  • MCP guide section documenting the CLI + a flag table.
  • @types/node added dev-only, scoped to this package's tsconfig via types: ["node"] so it does not leak Node globals into the other packages' builds (verified: full 12-package build stays clean).
{
  "mcpServers": {
    "my-app": {
      "command": "npx",
      "args": ["-y", "@askable-ui/mcp", "--url", "http://localhost:3001/context"]
    }
  }
}

Your app just needs a GET endpoint returning the latest packet (e.g. via ctx.toContextPacket()).

Test plan

  • mcp 45/45 tests (7 new: remote provider success/non-ok + CLI header parsing / arg handling)
  • full workspace tsc build clean (no @types/node leakage)
  • docs build clean (no dead links)
  • smoke-tested: shebang, --help, exit-1 on missing source, stdio startup with --file
  • CI typecheck-and-build + static/quality green

🤖 Generated with Claude Code


Generated by Claude Code

Many MCP clients (Claude Desktop, Cursor) launch a stdio command rather than
connecting to an HTTP URL. Adds a zero-new-dependency 'askable-mcp' binary that
serves the askable context tools/resources over stdio, backed by a remote
endpoint (--url) or a static packet file (--file). Reuses the SDK's
StdioServerTransport and node:util.parseArgs — no arg-parser or server framework.

Also exports createAskableMcpRemoteProvider for programmatic use. @types/node is
scoped to this package's tsconfig (types: [node]) so it doesn't leak globals into
the other packages' builds.

Tests: remote provider (success + non-ok) and CLI header parsing / arg handling.
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
askable Ready Ready Preview, Comment Jun 28, 2026 6:29pm

@pkg-pr-new

pkg-pr-new Bot commented Jun 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

@askable-ui/angular

npm i https://pkg.pr.new/@askable-ui/angular@349

@askable-ui/context

npm i https://pkg.pr.new/@askable-ui/context@349

@askable-ui/core

npm i https://pkg.pr.new/@askable-ui/core@349

@askable-ui/create-app

npm i https://pkg.pr.new/@askable-ui/create-app@349

@askable-ui/mcp

npm i https://pkg.pr.new/@askable-ui/mcp@349

@askable-ui/qwik

npm i https://pkg.pr.new/@askable-ui/qwik@349

@askable-ui/react

npm i https://pkg.pr.new/@askable-ui/react@349

@askable-ui/react-native

npm i https://pkg.pr.new/@askable-ui/react-native@349

@askable-ui/solid

npm i https://pkg.pr.new/@askable-ui/solid@349

@askable-ui/svelte

npm i https://pkg.pr.new/@askable-ui/svelte@349

@askable-ui/vue

npm i https://pkg.pr.new/@askable-ui/vue@349

@askable-ui/web-component

npm i https://pkg.pr.new/@askable-ui/web-component@349

commit: c5401d7

@vamgan
vamgan merged commit 829651b into main Jun 28, 2026
9 checks passed
@vamgan
vamgan deleted the claude/mcp-stdio-cli branch June 28, 2026 18:33
vamgan added a commit that referenced this pull request Jul 1, 2026
…col (#360)

- Tagline: 'Give your LLM eyes. One attribute for humans, one protocol for agents.'
- MCP section now leads with the one-command npx askable-mcp stdio setup for
  Claude Desktop/Cursor (shipped in #349), with the in-process and web-handler
  paths as secondary; documents list_context_sources and askable://current
- New 'An open protocol, not just a library' section introducing the Context
  Packet wire format with a link to the spec page
- Fix invalid Angular useAskableCompose sample (README + source JSDoc): class
  bodies cannot destructure; use a field initializer
- Refresh stale availability claims (viewport/history now cover Solid/Angular/
  Qwik) and the Qwik package row (15+ hooks after the expansion)

Co-authored-by: Claude <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — c5401d75 Deployed Jun 28, 2026 by vercel[bot]
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.

2 participants