navigator.modelContext.
Quick Start
1
Install the packages
2
Initialize in your app entry
3
Add the custom element
How It Works
Your website registers tools usingnavigator.modelContext, and the embedded agent can discover and call them automatically.
Configuration
Required Attributes
Optional Attributes
Development Mode
During development, you can use your own API keys to test without cost:Registering Tools
The embedded agent automatically discovers tools registered on your page:Loading via CDN
You can also load the embedded agent without a build step:ESM
IIFE (No Module Support)
View Modes
The agent supports three display modes:- Pill
- Panel
- Fullscreen
A compact floating button that expands into a chat interface. Best for minimal UI impact.
Security
The embedded agent runs in your page’s context and has access to the same tools your users can access. All tool executions happen client-side.
- Tools inherit your website’s permissions and origin policies
- User authentication is handled through your
app-idconfiguration - API keys are never exposed in production builds
Security Best Practices
Review comprehensive security guidelines for WebMCP implementations
Next Steps
Tool Registration
Learn how to create powerful tools for the agent to use
React Integration
Use the
useWebMCP hook for easier tool registrationBest Practices
Patterns for building effective AI-powered features
Examples
See complete working implementations
