Skip to content

Feature: WebMCP support#7

Merged
ryan-roemer merged 15 commits into
mainfrom
feature/webmcp
Mar 9, 2026
Merged

Feature: WebMCP support#7
ryan-roemer merged 15 commits into
mainfrom
feature/webmcp

Conversation

@ryan-roemer

@ryan-roemer ryan-roemer commented Mar 9, 2026

Copy link
Copy Markdown
Contributor
  • Added WebMCP tool registration (webmcp.js) and iframe MCP transport server (iframe-server.js) sharing a centralized tool definition (tool-defs.js) that wraps the existing searchPosts function
  • Migrated all CDN module imports from esm.sh to jsdelivr.net, added import map overrides for React version deduplication
  • added WebGPU acceleration support for the embedding model and memory cleanup
  • added maxChunks parameter support to searchPosts
  • Upgraded deps

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds WebMCP support to the vector search web demo, enabling AI agents to discover and invoke a semantic search tool through two transport mechanisms: the WebMCP browser API (navigator.modelContext) and an iframe-based MCP transport for embedding in other applications. The PR also migrates CDN imports from esm.sh to jsdelivr.net and upgrades ESLint/Prettier tooling.

Changes:

  • Added WebMCP tool registration (webmcp.js) and iframe MCP transport server (iframe-server.js) sharing a centralized tool definition (tool-defs.js) that wraps the existing searchPosts function
  • Migrated all CDN module imports from esm.sh to jsdelivr.net, added import map overrides for React version deduplication, and added WebGPU acceleration support for the embedding model
  • Upgraded ESLint to v10, added @eslint/js as an explicit dependency, upgraded Prettier to v3.8.1, and added maxChunks parameter support to searchPosts

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
public/index.html Migrated import map from esm.sh to jsdelivr, added @mcp-b/transports import and React version overrides, added WebMCP and iframe server initialization scripts
public/app/data/webmcp.js New file: registers the search tool with the WebMCP browser API after checking for Chrome 146+ support
public/app/data/tool-defs.js New file: centralized MCP tool schema and executeSearch wrapper shared between WebMCP and iframe transport
public/app/data/iframe-server.js New file: MCP iframe transport server using JSON-RPC 2.0 for embedding in iframes
public/app/data/search.js Added WebGPU acceleration for embeddings, maxChunks parameter, memory cleanup via dispose(), and navigator global declaration
public/app/components/forms.js Exported POST_TYPE_OPTIONS and commented out service post type
package.json Added @eslint/js, upgraded eslint to v10, upgraded prettier to v3.8.1
package-lock.json Lock file updates for dependency upgrades
docs/webmcp.md New documentation for WebMCP integration including tool schema, demo instructions, and example queries
.playwright-mcp/vector-search-demo.png Screenshot for documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread public/app/data/search.js
Comment thread public/app/data/search.js Outdated
Comment thread public/app/data/search.js Outdated
Comment thread public/app/data/search.js Outdated
Comment thread public/app/data/iframe-server.js Outdated
@ryan-roemer ryan-roemer merged commit 7981b92 into main Mar 9, 2026
1 check passed
@ryan-roemer ryan-roemer deleted the feature/webmcp branch March 9, 2026 19:09
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