feat: add beUI MCP server on Cloudflare Workers#79
Merged
Conversation
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
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.
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 usingMcpAgent(Streamable HTTP + SSE). The Durable Object backs MCP session lifecycle (session id, capabilities, SSE back-channel) — it stores no registry data.beui.dev/r/*endpoints at runtime, edge-cached 300s, so new components appear with zero worker redeploy. Single source of truth = the existing registry.Tools
list_componentscategory?search_componentsqueryget_componentslugget_install_commandslug,packageManager?Notes
@modelcontextprotocol/sdkto1.23.0to match the copy bundled inagents(avoids duplicateMcpServertype clash).aito satisfy the SDK's dynamicimport("ai")(chat-agent path we don't use, but esbuild must resolve it).mcp/from the Vercel/Next build (.vercelignore) and from the roottsconfig/biomeso the worker's Cloudflare types don't leak into the main build.bun.lock).Verification
initialize→tools/list(all 4) →tools/callreturns correct registry datamcp/typecheck + wrangler dry-run pass under bunbun run check(typecheck + lint + registry) green withmcp/presentDeploy
Already deployed (version
49b989c4); custom domainmcp.beui.devprovisioned.