Skip to content

andreinwald/webmcp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebMCP Demo

https://andreinwald.github.io/webmcp-demo

Prerequisites:

  • Google Chrome version 146 or higher
  • Enable "WebMCP" in chrome://flags
  • Browser extension to call actions chromewebstore

Actions registered in DemoStore.tsx

Example:

  useRegisterMCP({
    name: "add_to_cart",
    description: "Add an item to the shopping cart",
    inputSchema: {
      type: "object",
      properties: {
        id: {
          type: "number",
          description: "The ID of the item to add to the cart"
        }
      },
      required: ["id"]
    },
    execute: ({ id }: { id: number }) => {
      showAlert("add_to_cart called")
      addToCart(id)
      return `Successfully added item ${id} to cart`
    }
  })

Read more: