Introduction 

What is WebMCP? 

WebMCP exposes page-scoped tools to AI agents through the browser's ModelContext interface ( document.modelContext ; older Chrome origin trial builds and polyfills also offer the deprecated navigator.modelContext ). An agent operating the page can discover these tools and call them – for example to search content, navigate to a section, or open a pre-filled contact e-mail.

BrowserTYPO3 siteModelContextwebmcp.jsruntimeRegisteredpage toolsTool providers(PHP)Manifest(JSON in page)AI agentdiscover & callregisterdeclare (server-side)delivered in page HTML
Where WebMCP sits — agent, browser and your TYPO3 site

What this extension does 

The extension turns tool definitions into a declarative concern:

  • A tool is a small PHP class implementing \Neoblack\Webmcp\Tool\ToolProviderInterface . It returns a \Neoblack\Webmcp\Tool\Manifest describing the tool's name, JSON schema and behaviour.
  • Behaviour is expressed through one of four primitives whose generic interpreters live in a single JavaScript runtime (webmcp.js). No per-tool JavaScript is required.
  • A \Neoblack\Webmcp\DataProcessing\ToolManifestProcessor (a TYPO3 data processor) collects every registered provider into one JSON block per page; the runtime reads it and registers the tools.

The four primitives at a glance:

Primitive Behaviour
navigate Navigate the browser to a URL chosen from a fixed set of options.
search Fetch a same-origin JSON index, filter it client-side, return the hits.
mailto Build a pre-filled mailto: link and open it (no server storage).
static Return a curated, static list of items verbatim.

Because tools are pure server-side configuration, other extensions and site packages can add their own without touching JavaScript. For behaviour that no primitive covers, a tool may point at its own ES module (escape hatch).

Privacy-preserving analytics 

An optional first-party ingest endpoint (/webmcp-event) logs one row per tool call – only the tool name and a coarse, self-reported client hint, never free text, cookies or IP. A backend module visualises the usage. Analytics can be disabled in the extension configuration.

Feature detection & progressive enhancement 

Everything degrades gracefully: without a ModelContext implementation, without configuration, with a malformed manifest or inside an iframe, nothing is registered and regular visitors are unaffected. Your pages must — and with this extension do — work fully without WebMCP.

nothing registeredno, iframetop-level document?nothing registerednoconfig block present and valid?yesdocument.modelContext.registerTool available?use document.modelContextyeslegacyNavigatorFallback on andnavigator.modelContext.registerTool available?neitheruse navigator.modelContext(deprecated)nothing registeredregisterTool() per tool,each with its own AbortSignal
Feature detection — nothing is registered without a ModelContext