Unable to use playwright Agents in Cursor
Unable to use playwright Agents in Cursor
I was trying to do a workaround to use the Agents on Cursor and I managed to add the Agents manually on it:
But I end up getting this error when I try to use it, it seems that is an issue when executing the MCP from Cursor, there's a way to solve this?
How you managed to add the agents manually? any progress?
@Pollizzio Using that "Custom Modes" I printed, it enables to add agents with custom instructions:
On this at the bottom by clicking on Advanced Options you can paste the Custom Instructions you want.
Sure will try
On Tue, 4 Nov 2025 at 5:40 PM, Gustavo Meilus @.***> wrote:
gustavo-meilus left a comment (microsoft/playwright#37739) https://github.com/microsoft/playwright/issues/37739#issuecomment-3485666864
@Pollizzio https://github.com/Pollizzio Using that "Custom Modes" I printed, it enables to add agents with custom instructions: image.png (view on web) https://github.com/user-attachments/assets/557a86b7-38fc-42eb-8c46-4424f619fba0 image.png (view on web) https://github.com/user-attachments/assets/dc1c847b-1489-4975-8808-b33b9b8c3017
On this at the bottom by clicking on Advanced Options you can paste the Custom Instructions you want.
— Reply to this email directly, view it on GitHub https://github.com/microsoft/playwright/issues/37739#issuecomment-3485666864, or unsubscribe https://github.com/notifications/unsubscribe-auth/BYMPA4DF57MXMGBMYVZS54L33CJT7AVCNFSM6AAAAACIPBNIJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIOBVGY3DMOBWGQ . You are receiving this because you authored the thread.Message ID: @.***>
I still having issues using the module MCP for that on Cursor, the instructions help the AI to be more precise, but the MCP tools would make it much better, without it the AI tries to do things in random ways that is not efficient.
Found a workaround that actually works.
Tests fail to load with those annoying "Playwright Test did not expect test() to be called here" errors because it's starting from the wrong directory.
I just wrapped it in a shell script that explicitly sets the working directory first. Create ~/.cursor/playwright-test-wrapper.sh:
#!/bin/bash
cd /path/to/your/projectexec npx playwright run-test-mcp-server --config playwright.config.ts "$@"
Make it executable:
chmod +x ~/.cursor/playwright-test-wrapper.sh
Update your ~/.cursor/mcp.json:
{
"mcpServers": {
"playwright-test": {
"type": "stdio",
"command": "/home/user/.cursor/playwright-test-wrapper.sh"
}
}
}
The wrapper forces the correct working directory before launching the MCP server, so all the relative paths in your playwright config resolve properly.
Hope this helps someone else struggling with this!
With the latest Cursor I was able to use it as is: https://www.youtube.com/watch?v=LsDS0Z6E4NM
@Pollizzio Using that "Custom Modes" I printed, it enables to add agents with custom instructions:
![]()
On this at the bottom by clicking on Advanced Options you can paste the Custom Instructions you want.
Apparently, they just got rid of the custom-modes feature in the latest version of Cursor. I tried to find this feature to enable in Cursor setting > Features, but it was no longer there. My Cursor version is 2.1.36.
Yeah, that changed, now we have only the option to set custom commands for this, that's what I done.
Btw, the mcp tools for playwright-test is not working even with the workaround or without it, I'm struggling with this now.
Yeah, that changed, now we have only the option to set custom commands for this, that's what I done.
I noticed the custom commands feature as well. So I tried it by creating each command and copying each agent to each file (planner, generator, healer). But it didn't work.
So, I simply drag and drop each agent from the tree into the chatbox every time I use it. It's a pain in the neck, but it still works so far...
Curious if there is a plan to make Cursor compatible with Playwright Agents? @Skn0tt maybe you can answer?
Curious if there is a plan to make Cursor compatible with Playwright Agents?
That would be a question to Cursor. Once they support agent definitions in a workspace, it should be doable. Closing it as it should be a PR once Cursor supports agents.
On this at the bottom by clicking on Advanced Options you can paste the Custom Instructions you want.