Generate MCP resources at build time and host on playwriter.dev

- Add build-resources.ts script to generate markdown API docs
- Resources now use https://playwriter.dev/resources/*.md URLs
- Output to both playwriter/dist/ and website/public/resources/
- Simplify mcp.ts resource handlers to read pre-built files
This commit is contained in:
Tommy D. Rossi
2025-12-30 14:30:30 +01:00
parent aca26896b4
commit 237f24d3f8
8 changed files with 1082 additions and 77 deletions
+2
View File
@@ -36,6 +36,8 @@ playwriter contains the ws server and MCP code. also the tests for the mcp are t
playwriter/src/resource.md is for more generic knowledge about playwright that the agent can use when necessary, for things like best practices for selecting locators on the page
website/public/resources/ is auto-generated by `playwriter/scripts/build-resources.ts` during `pnpm build`. DO NOT edit these files manually - edit the source files in `playwriter/src/` instead (e.g. `debugger-examples.ts`, `editor-examples.ts`, `styles-examples.ts`)
## CDP docs
here are some commands you can run to fetch does about CDP various domains (events and commands namespaces)