# WebMCP declarative API See discussion in https://github.com/webmachinelearning/webmcp/issues/22 that led to the creation of this proposal. ## Motivation WebMCP lets developers expose intricate functionality backed by a website's JavaScript functions to an agent as "tools", effectively turning the site into an "MCP server". Agents can see the list of tools a site offers paired with natural language descriptions of what the tools do, and invoke them with structured data. With WebMCP, agents can perform complex actions like booking a flight or reserving a table by hooking into a site's own code designed to perform those actions, instead of the agent having to figure it out manually through a brittle series of screen shots, scrolls, and out-of-date screen reads. However, not all site functionality is exposed via JavaScript functions, and features that *are* take some effort to rewrite with an agent invoker in mind. Much of a site's functionality is provided via semantic HTML elements like `