Skip to content

feat: add beUI MCP server on Cloudflare Workers#79

Merged
starc007 merged 1 commit into
mainfrom
feat/mcp-server
Jun 28, 2026
Merged

feat: add beUI MCP server on Cloudflare Workers#79
starc007 merged 1 commit into
mainfrom
feat/mcp-server

Conversation

@starc007

Copy link
Copy Markdown
Owner

What

Remote MCP server exposing the beUI registry so AI agents (Claude, Cursor, etc.) can discover and install components.

Live: https://mcp.beui.dev/mcp (deployed, verified end to end).

Architecture

  • mcp/ — Cloudflare Worker using McpAgent (Streamable HTTP + SSE). The Durable Object backs MCP session lifecycle (session id, capabilities, SSE back-channel) — it stores no registry data.
  • Reads the live beui.dev/r/* endpoints at runtime, edge-cached 300s, so new components appear with zero worker redeploy. Single source of truth = the existing registry.
  • No auth (public registry).

Tools

tool input returns
list_components category? slug, name, category, description
search_components query best-matching components
get_component slug description, deps, all source files, install command
get_install_command slug, packageManager? shadcn CLI command per package manager

Notes

  • Pinned @modelcontextprotocol/sdk to 1.23.0 to match the copy bundled in agents (avoids duplicate McpServer type clash).
  • Added ai to satisfy the SDK's dynamic import("ai") (chat-agent path we don't use, but esbuild must resolve it).
  • Excluded mcp/ from the Vercel/Next build (.vercelignore) and from the root tsconfig/biome so the worker's Cloudflare types don't leak into the main build.
  • Uses bun (bun.lock).

Verification

  • Local + live smoke test: initializetools/list (all 4) → tools/call returns correct registry data
  • mcp/ typecheck + wrangler dry-run pass under bun
  • Main repo bun run check (typecheck + lint + registry) green with mcp/ present

Deploy

cd mcp && bun install && bun run deploy

Already deployed (version 49b989c4); custom domain mcp.beui.dev provisioned.

Remote MCP server exposing the beUI registry so agents can discover and
install components. Deployed at https://mcp.beui.dev.

- mcp/: Cloudflare Worker using McpAgent (Streamable HTTP + SSE). Tools:
  list_components, search_components, get_component, get_install_command
- Reads the live beui.dev/r/* endpoints at runtime, edge-cached, so new
  components appear with no worker redeploy
- Pinned @modelcontextprotocol/sdk to match agents' bundled copy; ai added
  to satisfy the SDK's dynamic import
- Exclude mcp from the Vercel build (.vercelignore) and from the root
  tsconfig/biome so worker types stay isolated
@starc007 starc007 merged commit 0893435 into main Jun 28, 2026
2 checks passed
@starc007 starc007 deleted the feat/mcp-server branch June 28, 2026 18:23
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