Skip to content

feat(web): add WebMCP support to c0mpute.com#14

Merged
ralyodio merged 1 commit into
masterfrom
feat/webmcp-support
Jul 23, 2026
Merged

feat(web): add WebMCP support to c0mpute.com#14
ralyodio merged 1 commit into
masterfrom
feat/webmcp-support

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

Adds WebMCP support to c0mpute.com. WebMCP lets a web page expose JavaScript "tools" that an in-browser AI agent can discover and invoke via document.modelContext.registerTool(...), instead of scraping the rendered page.

A client-side provider mounted in the root layout registers four tools, each backed by an existing public endpoint:

  • c0mpute_list_plugins — plugin/module catalogue (transcode, coinpay, infernet, …) with install commands
  • c0mpute_network_status — live workers online / jobs in flight / 24h throughput / latency
  • c0mpute_latest_release — CLI release manifest (version, channel, per-platform artifacts)
  • c0mpute_install_command — install command for the CLI or a specific plugin id

Changes

  • apps/web/src/components/webmcp-provider.tsx — client component; feature-detects document.modelContext / navigator.modelContext, supports both the registerTool and older provideContext({tools}) shapes, returns MCP text-content results, unregisters on unmount
  • apps/web/src/app/api/plugins/route.ts — new /api/plugins JSON endpoint (the plugin catalogue was build-time only; the client tool needs something fetchable)
  • apps/web/src/types/webmcp.d.ts — ambient types for the draft API (not in lib.dom yet)
  • apps/web/src/app/layout.tsx — mounts <WebMcpProvider />

Behavior

WebMCP is an emerging, unshipped spec, so everything is behind a feature-detect and degrades to a no-op in agents/browsers that don't implement it — zero visible change for regular visitors.

Verification

  • tsc --noEmit passes clean
  • Dev-server smoke test: /api/plugins returns 21 plugins, /api/status serves live data the tool wraps, homepage renders 200 with the WebMCP bundle loaded

🤖 Generated with Claude Code

Register JavaScript tools on document.modelContext so AI agents visiting
the site can query the network and plugin catalogue directly, per the
WebMCP draft spec (https://webmachinelearning.github.io/webmcp/).

Tools: c0mpute_list_plugins, c0mpute_network_status,
c0mpute_latest_release, c0mpute_install_command — each backed by an
existing public endpoint. Adds a /api/plugins JSON route since the plugin
catalogue was build-time only. Feature-detected and degrades to a no-op
in agents/browsers that don't implement WebMCP.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 883d79d into master Jul 23, 2026
@ralyodio
ralyodio deleted the feat/webmcp-support branch July 23, 2026 08:15
@ralyodio
ralyodio restored the feat/webmcp-support branch July 23, 2026 08:31
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