Skip to content

Conversation

@gaojude
Copy link
Contributor

@gaojude gaojude commented Nov 24, 2025

The old nextjs_runtime tool required multiple roundtrips to get started. You'd call discover_servers to find running servers, then call list_tools separately to see what each server offers. This meant two separate tool invocations just to figure out what's available before you could actually do anything useful.

This felt clunky in practice. When you're trying to debug a Next.js app, you just want to know "what servers are running and what can I do with them?" Having to make two separate calls to answer that question added unnecessary friction.

The new approach combines these into a single nextjs_index call that returns everything at once - all running servers with their full tool listings. One call gives you the complete picture of what's available.

This changes the workflow from:

  1. Call nextjs_runtime with action: "discover_servers"
  2. Call nextjs_runtime with action: "list_tools" for each server
  3. Call nextjs_runtime with action: "call_tool" to actually do something

To just:

  1. Call nextjs_index (gets servers + tools in one shot)
  2. Call nextjs_call with the specific tool you want

As a side effect, splitting this into two separate tools (nextjs_index and nextjs_call) also makes the API clearer since you're not passing around action discriminators and conditionally-required parameters. But the main win is cutting out that extra roundtrip during discovery.

> any error?

⏺ I'll check for any errors in your Next.js project. Let
  me first see if there's a dev server running and check
  for any compilation or runtime errors.
  ⎿  {
       "success": true,
       "count": 1,
     … +112 lines (ctrl+o to expand)

⏺ next-devtools - nextjs_call (MCP)(port: "3002", toolName:
                                   "get_errors")
  ⎿  {
       "success": true,
       "port": 3002,
     … +11 lines (ctrl+o to expand)

⏺ No errors detected! Your Next.js dev server is running
  on port 3002 with no compilation or runtime errors.

> show me the routes?

⏺ next-devtools - nextjs_call (MCP)(port: "3002", toolName:
                                   "get_routes")
  ⎿  {
       "success": true,
       "port": 3002,
     … +12 lines (ctrl+o to expand)

⏺ Write(/tmp/nextjs-routes.md)
  ⎿  Wrote 10 lines to ../../../../tmp/nextjs-routes.md
     # Next.js Routes
     ## App Router Routes
     - `/` - Home page
     - `/bar` - Bar page
     - `/demo/[...catchAll]` - Demo catch-all route
     - `/demo/[id]` - Demo dynamic route
     - `/favicon.ico` - Favicon

@gaojude gaojude requested a review from huozhi November 24, 2025 17:31
mcpTelemetryTracker.recordToolCall("mcp/browser_eval")
mcpTelemetryTracker.recordToolCall("mcp/nextjs_runtime") // Check runtime
mcpTelemetryTracker.recordToolCall("mcp/nextjs_index") // Discover servers
mcpTelemetryTracker.recordToolCall("mcp/nextjs_call") // Call runtime tool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is runtime tool? the nextjs-runtime is deleted, can we clarify what extactly another tool is as well? looks like tool cal just increased

@gaojude gaojude merged commit 489920c into main Nov 24, 2025
3 checks passed
@gaojude gaojude deleted the jude/simplify branch November 24, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants