Skip to content

feat(site): MCP platform showcase with multi-server chat demo#66

Open
mattzcarey wants to merge 14 commits intomainfrom
feat/mcp-site
Open

feat(site): MCP platform showcase with multi-server chat demo#66
mattzcarey wants to merge 14 commits intomainfrom
feat/mcp-site

Conversation

@mattzcarey
Copy link
Contributor

@mattzcarey mattzcarey commented Mar 5, 2026

Summary

  • Pivots mcp.cloudflare.com to position Cloudflare as the best platform to host and connect to MCP servers
  • Adds interactive chat demo that lets users try 10 MCP servers (Stripe, Sentry, Asana, Atlassian, Linear, PayPal, Square, Webflow, Intercom, Cloudflare) directly from the site
  • Multi-server selection: pills are toggleable, users can combine MCP servers
  • Code Mode: when 2+ servers selected, uses @cloudflare/codemode to wrap all tools into a single codemode tool where the LLM writes JavaScript. Also available as a toggle for single-server use.
  • Lazy connect: selecting servers doesn't connect until the first message is sent
  • Messages clear when selection changes
  • ToolCard renders code blocks and execution logs for codemode tool calls
  • Server-side MCP URL registry — URLs never sent from the client
  • 1-hour inactivity alarm for idle session cleanup
  • Switches model to @cf/moonshotai/kimi-k2.5

Blocked on

Test plan

  • Click server pills — multi-select toggles, Code Mode pill auto-activates with 2+
  • Send a message with 1 server — direct MCP tools (current behavior)
  • Send a message with 2+ servers — connects all, LLM uses codemode tool
  • Toggle Code Mode pill with 1 server — forces codemode
  • Toggle servers — messages clear, no connection until message sent
  • OAuth popup opens for servers needing auth
  • ToolCard shows code block for codemode calls, logs section when present
  • Click "Clear" — fresh state
  • Check dark/light mode across all sections

@mattzcarey
Copy link
Contributor Author

/bonk review this

Reposition mcp.cloudflare.com as the best platform to host and connect
to MCP servers. Users can try 10 MCP servers (Stripe, Sentry, Asana,
Atlassian, Linear, PayPal, Square, Webflow, Intercom, Cloudflare) from
an interactive chat demo.

- Add chat UI with ChatInterface, ToolCard, and ChatDemo components
- Make hero cards clickable to select MCP server, scroll to demo
- Add inline logo pill buttons for easy server switching
- Keep MCP OAuth connections alive across server switches
- Scope tools to active server via getActiveTools() prefix filtering
- Add 1-hour inactivity alarm to clean up idle sessions
- Server-side MCP URL registry (URLs never sent from client)
- Switch model to @cf/moonshotai/kimi-k2.5
- Update page copy: Features, MCP Spec support, Code Mode, CTA sections
- Fix R3F texturedLetterMaterial JSX type declaration
Use separate agent instances per server (session ID includes server ID)
so each DO has exactly one MCP connection. Removes PersistedObject,
tool prefix filtering, and cleared-state juggling. OAuth tokens persist
per server since the same DO is reused on return.
- Server pills are now toggleable (multi-select, min 1)
- Code Mode pill: toggleable for single server, auto-enabled for 2+
- Lazy connect: selecting servers doesn't connect until first message
- Messages clear when selection changes
- 2+ servers uses codemode (LLM writes JS against all tools)
- 1 server uses direct MCP tools by default
- ToolCard shows code blocks and logs for codemode calls
- Add @cloudflare/codemode dependency and worker_loaders binding
- Replace switchServer with connectServers callable
- Update compat date to 2026-01-28
…e guard

- ToolCard: keep content always mounted, toggle via CSS max-h/opacity
  (prevents state jumping between tool calls during streaming)
- GridAgent: sweep every 30s instead of 5s
- ChatAgent: don't schedule inactivity timer in onStart, wrap destroy in try/catch
- Disable Code Mode pill when Cloudflare is selected (has native codemode)
- Remove "Join the likes of these companies" copy
- Code Mode defaults on when multiple non-Cloudflare servers selected
- Always toggleable (no more locked/auto state)
- Cloudflare selection disables it (has native codemode)
- Reset override when server selection changes
- Better pill styling with monospace symbol and proper gap
Code Mode pill is now always toggleable for any server combination.
Server is now source of truth for MCP selection. ChatAgent stores
useCodemode in DO state via setState, synced to client via
onStateUpdate. Connected server IDs derived from mcpState on first
push. Also removes font-mono from chat header for consistent typography.
All MCP connection status now derived from server-pushed mcpState.
Removed isConnectingMcp, use mcpStatus from getMcpStatus instead.
Don't reset mcpState on selection change — server is source of truth.
Use toolCallId as React key for stable tool block rendering.
- Add getSessionConfig() callable for single authoritative sync on connect
- Remove onStateUpdate + serverStateRef (eliminates null ref crash and
  race between onStateUpdate/onMcpUpdate ordering)
- Cache DynamicWorkerExecutor on DO instance
- Add noopener,noreferrer to OAuth popup
- Surface connectError in header UI
- Handle empty serverIds in sync (reset to defaults)
- Add activeServerIds to ChatAgentState for server-side tool filtering
  instead of disconnecting/reconnecting servers on selection change
- Add setActiveServers callable to update which tools the LLM sees
- Add getActiveTools() that filters MCP tools by active server IDs
- Make connectServers additive-only (never removes servers)
- Add reauthServers callable + reauth button (ArrowsClockwise) in header
- Reduce auto-destroy timer to 15min, skip if connections still active
- Remove getMcpStatus helper, derive all status from mcpState.servers
- Dedupe OAuth popups per server+URL (workaround for SDK double-fire)
- Clear only wipes messages, keeps DO session and server connections
- Update system prompt to list active servers, not all connected
- Filter tool count in header to only show active server tools
- Add MCP intro section above Try It demo
- Add side-by-side code examples section with Shiki syntax highlighting
- Remove "Only pay for CPU time" claim from Region: Earth
- Add plans/ to gitignore
@ask-bonk
Copy link

ask-bonk bot commented Mar 9, 2026

ProviderModelNotFoundError

github run

@ask-bonk
Copy link

ask-bonk bot commented Mar 9, 2026

@mattzcarey Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

…izing

- ShikiCode: switch between github-light-default and github-dark-default
  themes based on data-mode attribute, add copy-to-clipboard button
- Card layout: use canvas text measurement instead of fixed char width
  ratio, switch label to flexbox so it sizes to fit content naturally
- Replace Sentry, Intercom, Linear, Webflow, Asana SVGs with official
  brand logos and normalize viewBoxes to square for consistent sizing
- Intercom: #6AFDEF → #0057FF (light) / #47C7F0 (dark)
- Webflow: #4353FF → #146EF5 (official brand blue)
- Asana: #F06A6A → #FC636B (updated coral)
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