This document explains how the Model Context Protocol (MCP) is configured in BitSleuth and how to use it with AI coding assistants.
Model Context Protocol (MCP) is a standard that enables AI coding assistants (like GitHub Copilot, Claude, Cursor) to interact directly with your running Next.js application. This provides:
- Real-time diagnostics: Access to build errors, runtime errors, and logs
- Automated upgrades: Run official Next.js codemod scripts
- Context-aware assistance: AI agents have access to page metadata, routes, and server actions
- Enhanced debugging: Live inspection of your application state
- Development knowledge base: Access to curated Next.js best practices
BitSleuth is configured with two MCP servers:
Provides browser automation and testing capabilities through Playwright.
Provides Next.js-specific development tooling and diagnostics.
This file at the project root configures the MCP servers:
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
},
"next-devtools": {
"command": "npx",
"args": ["-y", "next-devtools-mcp@latest"]
}
}
}The experimental MCP server feature is enabled in the Next.js configuration:
experimental: {
mcpServer: true,
// ... other experimental features
}- Node.js v20+ (required, latest LTS recommended)
- Next.js 16+ (current version: 16.1.1)
- An AI coding assistant that supports MCP (GitHub Copilot, Claude, Cursor, etc.)
- Start the Next.js dev server:
npm run dev- You should see in the console output:
✓ mcpServer
This indicates the MCP server is enabled and running.
The MCP servers are automatically available to AI assistants that support the protocol. The configuration in .mcp.json tells your AI assistant how to connect to the servers.
For VS Code with GitHub Copilot or similar tools, the .mcp.json file at the project root is automatically discovered.
Once connected, AI assistants can use various tools:
get_errors- Retrieve build, runtime, and type errorsget_logs- Access development logs and console outputget_page_metadata- Get metadata about specific pages/components/routesenable-cache-components- Automate Cache Components setup- Upgrade assistance - AI can help upgrade Next.js versions with automated codemods
- Browser automation for testing
- Screenshot capture
- DOM inspection
- Network request analysis
To verify MCP is working:
- Start the dev server:
npm run dev - Look for the MCP server confirmation in the console
- Ask your AI assistant to query your Next.js application state
- Try commands like "Show me the current build errors" or "What routes are available?"
- Ensure you have Node.js 20+ installed
- Check that
.mcp.jsonhas valid JSON syntax - Verify
next.config.tshasmcpServer: truein the experimental section
- Ensure your AI assistant supports MCP
- Check that
.mcp.jsonis in the project root - Restart your IDE/editor after adding MCP configuration
- Verify the dev server is running
You may see a warning like:
⚠ Invalid next.config.ts options detected:
⚠ Unrecognized key(s) in object: 'mcpServer' at "experimental"
This warning can be safely ignored if you see ✓ mcpServer in the experiments list, which indicates the feature is working correctly.
- MCP servers run using
npxwith the-yflag to auto-accept installation - The
@latesttag ensures you're always using the newest version - MCP communication uses stdio protocol (not HTTP endpoints)
- No additional installation is required - the servers are invoked on-demand
Last Updated: January 2026
Next.js Version: 16.1.1
MCP Version: Latest