Explains how to add and debug playwright MCP tools and CLI commands.
Developer guide for extending Playwright MCP tools and CLI commands. Add new MCP tools in packages/playwright/src/mcp/browser/tools/, register in tools.ts, and define capabilities in config.d.ts CLI commands map to MCP tools; register new commands in packages/playwright/src/mcp/terminal/commands.ts and update help generator if adding a category Config options require updates across program.ts (CLI option), config.d.ts (definition), and config.ts (implementation and environment mapping) Run npm run ctest-mcp <category> for testing and npm run flint before commit; always keep watch mode running and use lint to catch type errors MCP Adding MCP Tools Create a new tool in packages/playwright/src/mcp/browser/tools/your-tool.ts Register the tool in packages/playwright/src/mcp/browser/tools.ts Add ToolCapability in packages/playwright/src/mcp/config.d.ts Place new tests in tests/mcp/mcp-<category>.spec.ts Building Assume watch is running at all times, run lint to see type errors Testing Run tests as npm run ctest-mcp <category> Do not run test --debug CLI
don't have the plugin yet? install it then click "run inline in claude" again.