playwright-mcp/src
Ryan Malloy b7ec4faf60 feat: add MCP client identification system with debug toolbar and custom code injection
- Implement comprehensive debug toolbar showing project name, session ID, client info, and uptime
- Add Django-style draggable toolbar with terminal aesthetics for multi-client identification
- Support custom JavaScript/CSS injection into all pages with session persistence
- Auto-injection system hooks into page creation lifecycle for seamless operation
- LLM-safe HTML comment wrapping prevents confusion during automated testing
- 5 new MCP tools: enable_debug_toolbar, inject_custom_code, list_injections, disable_debug_toolbar, clear_injections
- Session-based configuration storage with auto-injection on new pages
- Solves multi-parallel MCP client identification problem for development workflows

Tools added:
- browser_enable_debug_toolbar: Configure project identification overlay
- browser_inject_custom_code: Add custom JS/CSS to all session pages
- browser_list_injections: View active injection configuration
- browser_disable_debug_toolbar: Remove debug toolbar
- browser_clear_injections: Clean up custom injections

Files modified:
- src/tools/codeInjection.ts: Complete injection system (547 lines)
- src/context.ts: Added injection config and auto-injection hooks
- src/tools.ts: Registered new tools in main array
- test-code-injection-simple.cjs: Validation test suite

Addresses issue: "I'm running many different 'mcp clients' in parallel on the same machine.
It's sometimes hard to figure out what client a playwright window belongs to."
2025-09-09 06:25:38 -06:00
..
extension chore(extension): exit gracefully when waiting for extension connection (#754) 2025-07-24 16:02:02 -07:00
loop chore: retain the source code from the underlying tools (#756) 2025-07-24 17:08:35 -07:00
loopTools chore: retain the source code from the underlying tools (#756) 2025-07-24 17:08:35 -07:00
mcp feat: implement MCP client session persistence for browser contexts 2025-08-12 12:22:46 -06:00
tools feat: add MCP client identification system with debug toolbar and custom code injection 2025-09-09 06:25:38 -06:00
artifactManager.ts feat: fix video recording session persistence and add HTTP request monitoring 2025-09-05 07:17:11 -06:00
browserContextFactory.ts refactor: minor code formatting improvements and add artifacts tool 2025-09-09 04:19:30 -06:00
browserServerBackend.ts feat: add snapshot size limits and optional snapshots to fix token overflow 2025-08-22 07:54:36 -06:00
config.ts feat: comprehensive console capture and offline mode support 2025-08-31 16:28:43 -06:00
context.ts feat: add MCP client identification system with debug toolbar and custom code injection 2025-09-09 06:25:38 -06:00
environmentIntrospection.ts feat: implement MCP client session persistence for browser contexts 2025-08-12 12:22:46 -06:00
fileUtils.ts chore: experimental agent mode (#516) 2025-06-04 09:14:50 -07:00
httpServer.ts chore: extract pure mcp server helpers (#751) 2025-07-24 12:57:01 -07:00
index.ts chore: extract pure mcp server helpers (#751) 2025-07-24 12:57:01 -07:00
javascript.ts feat: respond with action and generated locator (#181) 2025-04-15 10:55:20 -07:00
log.ts chore: allow right click (#687) 2025-07-17 13:24:05 -07:00
manualPromise.ts feat(dialog): handle dialogs (#212) 2025-04-17 14:03:13 -07:00
package.ts chore: add eval script (#743) 2025-07-23 10:31:37 -07:00
program.ts feat: add console output file option for debugging and monitoring 2025-08-24 14:12:00 -06:00
requestInterceptor.ts feat: fix video recording session persistence and add HTTP request monitoring 2025-09-05 07:17:11 -06:00
response.ts feat: add snapshot size limits and optional snapshots to fix token overflow 2025-08-22 07:54:36 -06:00
sessionLog.ts chore: save session log (#740) 2025-07-22 20:06:03 -07:00
sessionManager.ts feat: implement centralized artifact storage with session isolation 2025-08-15 06:42:16 -06:00
tab.ts feat: fix video recording session persistence and add HTTP request monitoring 2025-09-05 07:17:11 -06:00
tools.ts feat: add MCP client identification system with debug toolbar and custom code injection 2025-09-09 06:25:38 -06:00