18 Commits

Author SHA1 Message Date
ec8b0c24b5 feat: add image size validation to screenshot tool to prevent API errors
Implements automatic validation of screenshot dimensions to prevent
"image dimensions exceed max allowed size: 8000 pixels" API errors.

New features:
 **Automatic size validation** - Rejects images > 8000px by default
 **allowLargeImages flag** - Override validation when needed
 **Smart error messages** - Helpful solutions when validation fails
 **Image dimension parsing** - Supports PNG and JPEG format detection
 **Updated tool description** - Documents size limits and flag usage

Error message provides actionable solutions:
1. Use viewport screenshot (remove fullPage: true)
2. Allow large images (add allowLargeImages: true)
3. Reduce viewport size (browser_configure)
4. Screenshot specific elements (element + ref)

Usage examples:
```json
// Safe viewport screenshot
{"filename": "safe.png"}

// Full page with validation
{"fullPage": true, "filename": "page.png"}

// Override validation for large images
{"fullPage": true, "allowLargeImages": true, "filename": "large.png"}
```

This prevents the frustrating API error: "At least one of the image
dimensions exceed max allowed size: 8000 pixels" by catching oversized
images before they reach the API and providing clear solutions.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-22 08:52:17 -06:00
d8202f6694 feat: implement centralized artifact storage with session isolation
Add comprehensive artifact storage system with session-specific directories:

- Add --artifact-dir CLI option and PLAYWRIGHT_MCP_ARTIFACT_DIR env var
- Create ArtifactManager class for session-specific artifact organization
- Implement ArtifactManagerRegistry for multi-session support
- Add tool call logging with JSON persistence in tool-calls.json
- Update screenshot, video, and PDF tools to use centralized storage
- Add browser_configure_artifacts tool for per-session control
- Support dynamic enable/disable without server restart
- Maintain backward compatibility when artifact storage not configured

Directory structure: {artifactDir}/{sessionId}/[artifacts, videos/, tool-calls.json]

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-15 06:42:16 -06:00
Pavel Feldman
601a74305c
chore: introduce response type (#738) 2025-07-22 16:36:21 -07:00
Pavel Feldman
468c84eb8f
chore: move state to tab, do not cache snapshot (#730) 2025-07-22 07:53:33 -07:00
Copilot
eeeab4f042
fix: browser_take_screenshot to not require snapshot unless element is specified (#725) 2025-07-21 10:52:06 -07:00
Copilot
1eee30fd45
feat: add fullPage mode to browser_take_screenshot (#704) 2025-07-18 13:56:43 -07:00
Pavel Feldman
d61aa16fee
chore: turn vision into capability (#679)
Fixes https://github.com/microsoft/playwright-mcp/issues/420
2025-07-16 16:40:00 -07:00
Pavel Feldman
9e5ffd2ccf
fix(cursor): allow enforcing images for cursor --image-responses=allow (#478)
Fixes https://github.com/microsoft/playwright-mcp/issues/449
2025-05-27 10:25:09 +02:00
Pavel Feldman
f20ae22ec6
chore: roll Playwright, remove localOutputDir (#471) 2025-05-24 11:44:57 -07:00
Pavel Feldman
a1eee8351e
chore: collapse readme (#404) 2025-05-12 16:42:47 -07:00
Pavel Feldman
707ebbf4d4
chore: group tools, prepare for capabilities (#134) 2025-04-04 15:22:00 -07:00
Pavel Feldman
e36d4ea695
chore: allow multiple tabs (#129) 2025-04-03 19:24:17 -07:00
Pavel Feldman
b358e47d71
chore: prep for multiple pages in context (#124) 2025-04-03 10:30:05 -07:00
Yury Semikhatsky
2291011dc7
feat: add slowly option for typing one character at a time (#121) 2025-04-02 14:36:30 -07:00
Pavel Feldman
89627fd23a
chore: extract page snapshot, prep for multipage (#120) 2025-04-02 11:42:39 -07:00
Pavel Feldman
d4bc2c78d2
chore: allow taking pixel screenshots in snapshot mode (#44)
Ref: https://github.com/microsoft/playwright-mcp/issues/39
2025-03-27 07:27:34 -07:00
Pavel Feldman
6ff4500211
chore: use persistent profile by default (#41)
Fixes https://github.com/microsoft/playwright-mcp/issues/29
2025-03-26 15:02:45 -07:00
Pavel Feldman
852709c026 chore: initial code commit 2025-03-21 11:13:24 -07:00