Skip to content

Adding WebMCP-compatible Support for Tools #1216

@alekrumkamp

Description

@alekrumkamp

Hi folks,

As discussed with @mattzcarey, sharing the fork branch that would add WebMCP compatibility for tools that are available via an MCP server: https://github.com/alekrumkamp/agents/tree/feat/webmcp-adapter

How it works

  1. registerWebMcp() connects to your MCP server
  2. Discovers tools via tools/list
  3. Registers each with navigator.modelContext.registerTool()
  4. Chrome can now call your tools
  5. Calls are relayed back to the MCP server via tools/call

Usage

import { registerWebMcp } from "agents/experimental/webmcp";

const handle = await registerWebMcp({ url: "/mcp" });

Example where WebMCP tools get picked up by browser extension

Image

FYI @whoiskatrin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions