# WebMCP

Category: API / Auth / MCP

## Goal
Implement the WebMCP API by calling `navigator.modelContext.provideContext()` with tool definitions exposing your site's key actions to AI agents. Each tool needs `name`, `description`, `inputSchema` (JSON Schema), and an `execute` callback. Register tools at the points an agent could meaningfully use them — after page hydration, on route changes, or when permission state changes.

## Validation
- Use public machine-readable artifacts where the standard expects them.
- Confirm content types, payload shape, and discoverability from the public web surface.
- Keep the implementation read-only from the scanner perspective.

## Copyable Fix Prompt
```text
Fix the WebMCP gap for https://example.com.

Requirements:
- Implement the WebMCP API by calling `navigator.modelContext.provideContext()` with tool definitions exposing your site's key actions to AI agents. Each tool needs `name`, `description`, `inputSchema` (JSON Schema), and an `execute` callback. Register tools at the points an agent could meaningfully use them — after page hydration, on route changes, or when permission state changes.
- Preserve existing product behavior and do not do UI work.
- Use machine-readable public artifacts under /.well-known/ or response headers when appropriate.
- Add or update automated tests covering the new behavior.
- Validate the final response shape and content types.
```