webmcp-lib

A dependency-free JS library that discovers page functions and exposes them as WebMCP tool calls. Open any demo, then check the DevTools console for registered tools.

Live discovery and calls Registers a stateful namespace, calls its tools, and renders returned state. Calculator Exposes add / subtract from window. Todo List Stateful getTodos / addTodo / removeTodo. Namespaced API Discovers tools on window.MyApp with a depth limit. Test Harness Runs discovery over several function shapes and prints the schema.

Source: github.com/PaulKinlan/webmcp-lib