用途:通过 MCP 服务器检查与调试 Next.js 应用,适合在开发或排查 Next.js 项目时使用。
主要能力(可用工具):list-routes 获取全部应用路由;get-route-info 查看指定路由详情;list-components 列出应用中的 React 组件;get-build-info 获取构建配置;get-config 读取 next.config.js 设置。
使用方式:可按需临时启动服务器,例如 python3 scripts/mcp-client.py call -s "npx next-devtools-mcp@latest" -t list-routes;若要多次调用可先运行 bash scripts/start-server.sh 启动常驻服务器,再用带 -u 参数的 mcp-client.py 连接。查询指定路由示例:python3 scripts/mcp-client.py call -s "npx next-devtools-mcp@latest" -t get-route-info -p '{"route": "/api/auth"}'。
常见工作流:路由检查(先 list-routes,再 get-route-info);构建问题排查(get-build-info 与 get-config);组件发现(list-components)。
限制与注意:需在 Next.js 项目根目录运行,否则可能找不到路由;构建信息为空时先执行 next build;服务器无法启动时先手动验证 npx next-devtools-mcp@latest 是否可用。未提供更多平台、收费或效果信息。