These prompts are live and ready! The WebMCP polyfill is included with this documentation site. Install the MCP-B browser extension to enable AI agents (like Claude) to discover and use these prompts directly.
Prompt Registration
Understanding prompt registration
Live Tools
Interactive tool demonstrations
Live Resources
Interactive resource demonstrations
WebMCP Status
Check if the WebMCP polyfill is loaded and ready:What are Prompts?
Prompts in MCP are reusable message templates that AI agents can retrieve and use. Unlike tools (which execute actions) or resources (which read data), prompts generate structured messages that guide AI interactions.| Feature | Description |
|---|---|
| Purpose | Generate pre-formatted messages for AI |
| Arguments | Optional schema-validated parameters |
| Output | Array of role-based messages (user/assistant) |
| Use Case | Standardized AI conversation starters |
Greeting Prompt
Demonstrates: Basic prompt registration without arguments This prompt shows the fundamentals ofregisterPrompt() - a simple prompt that returns a greeting message. Perfect for initializing conversations with AI agents.
Code Review Prompt
Demonstrates: Prompt with validated arguments schema This prompt shows advanced usage withargsSchema - it accepts code and language parameters to generate a customized code review request. The schema validation ensures correct argument types.
Prompt API Reference
registerPrompt(descriptor)
Registers a new prompt with the browser.
listPrompts()
Returns all registered prompts (called by AI agents via MCP protocol).
The
getPrompt() method is called by AI agents through the MCP protocol, not directly from your application code. When an AI agent calls getPrompt('greeting'), your registered get() handler is invoked and the result is returned to the agent.Best Practices
Use descriptive names
Use descriptive names
Choose prompt names that clearly indicate their purpose. Use kebab-case for multi-word names (e.g.,
code-review, bug-report).Provide helpful descriptions
Provide helpful descriptions
Write descriptions that help AI agents understand when to use the prompt and what it generates.
Validate arguments with schemas
Validate arguments with schemas
Use
argsSchema to ensure AI agents provide the correct argument types. Include descriptions for each property.Keep messages focused
Keep messages focused
Generate concise, focused messages. Avoid overly complex prompts that try to do too much.
Use appropriate roles
Use appropriate roles
Use
user role for requests and assistant role for context or examples the AI should follow.