Skip to Content

WebMCP support now available in mcp-handler

Opt tools in by adding them to the experimental_webMcp object:

Then load the script from your MCP endpoint with the ?webmcp-script parameter:

(server)=>{

18 Sep 2026
Copy
server.registerTool("roll_dice",/* ... */);
{

},

import{ createMcpHandler }from"mcp-handler";

const handler =createMcpHandler(
experimental_webMcp:{
1 min read

Upgrade to mcp-handler@2.2.0 and read the documentation to get started.

export{ handler asGET, handler asPOST};

},
},
tools:["roll_dice"],
);

Contributors

Ben Sabic