Skip to content

Connect Next.js DevTools MCP to OpenCode

Vercel's MCP server for Next.js. It connects to your running dev server so agents can read build and runtime errors, routes and logs, and search the Next.js docs.

MCP serverOfficialChecked 2026-11-16

Before you start

  • OpenCode installed (see its MCP documentation (opens in a new tab)).
  • Next.js DevTools MCP is available on macOS, Windows and Linux.
  • Needs Next.js 16 or later. Start the dev server (npm run dev) before the agent connects; it serves the endpoint the MCP server talks to. Error and page tools read from pages open in a browser.
  1. Step 1: Add Next.js DevTools MCP to OpenCode

    Add it from the terminal

    Run this in your project folder. It saves the server to the project's opencode.json.

    Terminal
    opencode mcp add next-devtools -- npx -y next-devtools-mcp@latest

    Or edit the config file

    Add this to opencode.json at the project root.

    opencode.json
    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "next-devtools": {
          "type": "local",
          "command": [
            "npx",
            "-y",
            "next-devtools-mcp@latest"
          ],
          "enabled": true
        }
      }
    }
  2. Step 2: Check it's connected

    Terminal
    opencode mcp list

    Start OpenCode in the project; the server's tools are available to the agent straight away.

  3. Step 3: Try a first request

    Ask OpenCode something that only works with Next.js DevTools MCP connected:

    Say to OpenCode
    Check my running Next.js dev server for build or runtime errors and explain how to fix the first one.

If it doesn't work

  • OpenCode reads opencode.json from the project root, or ~/.config/opencode/opencode.json for every project.
  • Environment variables use the {env:NAME} syntax inside the config file.
  • Servers that need a sign-in: run opencode mcp auth <name>.