How to debug localhost site with MCP?

A MCP exists to interact with the site: GitHub - executeautomation/mcp-playwright: Repository contains Playwright Model Context Protocol to automate Browser and APIs

Personally I haven’t got it to work. Right now I find MCPs unstable in cursor. However, it’s actually kind of useless right now since it can only write to the console. So you use it primarily for navigating the site. Using Claude, I couldn’t read the console logs.

Like danperk mentioned, you can use cursor-tools, and in theory, you should be able to open up a chrome instance and do "cursor-tools browser extract --network --console —connect-to reload-current to read the console logs of a running instance, but I couldn’t get it to work and it seemed like a clumsy way of doing it. Other wise you just have to open up a headless browser every time you want to check the console logs, which seems inefficient.

There is a recent cursor extension that aims to do this: GitHub - saketsarin/composer-web: Cursor extension that forwards frontend errors and screenshots to composer in one-click, making development seamless for you
But it’s very early in development and I couldn’t get it to work, and it seems to me the approach isn’t ideal.

The best way I got it to work is to create a little javascript file that listens to a chrome debugger instance via websockets. When the composer agent runs it, it can get live access because the terminal content will be added to the context of the composer.

I made thread showing it here: Tutorial: Supercharged Cursor composer agent with Chrome DevTools