webmcp — the browser MCP for your TYPO3.
Web Model Context Protocol server that exposes tools like search, navigation and page content directly via navigator.modelContext. AI agents use them straight in the browser, with SecureContext checks and a CSRF nonce — no external API needed.
When the AI agent gets stuck because it can't see anything.
With webmcp
- Standardised
navigator.modelContextAPI directly in the browser - Built-in tools: search, navigation, page-content
- Custom tools registerable via
ToolProviderInterface - SecureContext + CSRF nonce, FE group-aware
Until now
- AI agents have to learn external REST/GraphQL APIs
- Auth tokens, rate limits, caching problems
- Tools aren't available in the current browser context
- Every site implements its own tool vocabulary
Four building blocks
Optional: form tool
With typo3/cms-form as an optional dependency, form submission is also exposed as a tool — AI agents can submit enquiries directly.
Secure by default
SecureContext required (HTTPS), CSRF nonce in every tool request, access control via TYPO3 FE groups respected.
Custom tool provider
Register your own tools via ToolProviderInterface — e.g. to expose shop-specific search functions or custom forms.
Built-in tools
search, navigation, page-content — ready to use straight after installation.
Configuration
Enable the site set
Include the site set moselwal/webmcp in your site configuration.
Settings
In config/sites/<site>/settings.yaml:
webmcp:
enabled: true
apiBasePath: '/_webmcp/api'
tools:
search:
enabled: true
maxResults: 20
navigation:
enabled: true
maxDepth: 4
page-content:
enabled: trueBuilt-in tools
All tools respect TYPO3 access restrictions (fe_group, starttime, endtime, hidden). Only content visible to the current visitor (anonymous or logged-in) is returned.
| Tool | Description | Input |
|---|---|---|
search | Full-text search across pages and content elements | { query: string, limit?: int } |
navigation | Page tree as structured JSON | { rootPageId?: int, maxDepth?: int } |
page-content | Structured content of a specific page | { pageId?: int, slug?: string } |
Building custom tools
1. Implement a ToolProvider
<?php
use Moselwal\WebMcp\Domain\Contract\ToolProviderInterface;
use Moselwal\WebMcp\Domain\Model\ToolAnnotations;
use Moselwal\WebMcp\Domain\Model\ToolDefinition;
final class ShopToolProvider implements ToolProviderInterface
{
public function getIdentifier(): string
{
return 'shop';
}
public function getTools(): array
{
return [
new ToolDefinition(
name: 'product-search',
description: 'Search products in the shop',
inputSchema: [
'type' => 'object',
'properties' => [
'query' => ['type' => 'string'],
'category' => ['type' => 'string'],
],
'required' => ['query'],
],
annotations: new ToolAnnotations(readOnlyHint: true),
),
];
}
}
2. Implement a ToolHandler
<?php
use Moselwal\WebMcp\Domain\Contract\ToolHandlerInterface;
use Moselwal\WebMcp\Domain\Model\ToolResult;
use Psr\Http\Message\ServerRequestInterface;
final class ProductSearchHandler implements ToolHandlerInterface
{
public function getToolName(): string
{
return 'product-search';
}
public function execute(array $input, ServerRequestInterface $request): ToolResult
{
// Implement product search ...
return ToolResult::success(['products' => $results]);
}
}
Both classes are auto-registered via _instanceof tags in Services.yaml — no extra configuration required.
How it works
- When a page is rendered, the extension injects JavaScript via
AssetCollector. - The JavaScript registers all enabled tools through
navigator.modelContext.registerTool(). - When an AI agent invokes a tool, the browser sends a
POSTrequest to/_webmcp/api/{toolName}. - The PSR-15 middleware validates the request (CSRF nonce, input) and delegates to the matching ToolHandler.
- The result is returned as JSON.
Requirements
- TYPO3 13.4 or 14.0
- PHP 8.2 or higher
- HTTPS (SecureContext required)
Source code & documentation
TYPO3 Extension Repository
Not in the official TER — install via Composer only.
GitLab (source of truth)
Primary repository including CI/CD and Composer package registry.
GitHub
GitHub mirror with issues and PRs (placeholder — verify before publish).
Help with integration?
webmcp is open source and meant for self-integrators. If you want to integrate webmcp for your specific use case (custom tools, commercial AI agent integration, custom permissions), we'll help on a day rate or as part of our CMS as a Service.
Oder direkt schreiben: kontakt@moselwal.de