Skip to main content
Glama
vercel

Next.js DevTools MCP

Official
by vercel

browser_eval

Perform browser automation to test and debug web applications. Execute actions like navigation, clicking, typing, and JavaScript evaluation to verify page rendering, capture console messages, and detect runtime errors.

Instructions

Automate and test web applications using Playwright browser automation. This tool connects to playwright-mcp server and provides access to all Playwright capabilities.

CRITICAL FOR PAGE VERIFICATION: When verifying pages in Next.js projects (especially during upgrades or testing), you MUST use browser automation to load pages in a real browser instead of curl or simple HTTP requests. This is because:

  • Browser automation actually renders the page and executes JavaScript (curl only fetches HTML)

  • Detects runtime errors, hydration issues, and client-side problems that curl cannot catch

  • Verifies the full user experience, not just HTTP status codes

  • Captures browser console errors and warnings via console_messages action

IMPORTANT FOR NEXT.JS PROJECTS: If working with a Next.js application, PRIORITIZE using the 'nextjs_index' and 'nextjs_call' tools instead of browser console log forwarding. Next.js has built-in MCP integration that provides superior error reporting, build diagnostics, and runtime information directly from the Next.js dev server. Only use browser_eval's console_messages action as a fallback when these Next.js tools are not available or when you specifically need to test client-side browser behavior that Next.js runtime cannot capture.

Available actions:

  • start: Start browser automation (automatically installs if needed). Verbose logging is always enabled.

  • navigate: Navigate to a URL

  • click: Click on an element

  • type: Type text into an element

  • fill_form: Fill multiple form fields at once

  • evaluate: Execute JavaScript in browser context

  • screenshot: Take a screenshot of the page

  • console_messages: Get browser console messages (for Next.js, prefer nextjs_index/nextjs_call tools instead)

  • close: Close the browser

  • drag: Perform drag and drop

  • upload_file: Upload files

  • list_tools: List all available browser automation tools from the server

Note: The playwright-mcp server will be automatically installed if not present.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoThe action to perform using browser automation
browserNo
headlessNo
urlNo
elementNo
refNo
doubleClickNo
buttonNo
modifiersNo
textNo
fieldsNo
scriptNo
fullPageNo
errorsOnlyNo
startElementNo
startRefNo
endElementNo
endRefNo
filesNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description bears full burden. It details automatic installation, verbose logging, browser rendering capabilities, runtime error detection, and console message capture. Lacks mention of performance overhead or authentication, but covers key behavioral aspects well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections but overly verbose. Repeats action list already in schema, and includes redundant warnings. Could be trimmed without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers overall purpose and usage context well for a complex tool (19 params, no output schema). Lacks details on parameter format, error handling, and return values. Adequate but not fully comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 5% (only 'action' described). Description lists action names but does not explain parameters like browser, headless, url, etc. Despite high parameter count, description adds little value beyond the schema's enum values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'Automate and test web applications using Playwright browser automation' with a specific verb and resource. It distinguishes itself from sibling tools like nextjs_index and nextjs_call by focusing on browser automation rather than Next.js-specific MCP integration.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on when to use browser_eval (for page verification in Next.js, rendering JavaScript) versus when to prefer nextjs_index/nextjs_call (for Next.js-specific error reporting). Also explains fallback scenarios and lists all available actions clearly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vercel/next-devtools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server