Diagnostics MCP Server

Tools for debugging your node.js modules and event loop

Local serverstdio

What is the Diagnostics MCP server?

Connect Diagnostics to Claude, Cursor or any other MCP client and it stops being a tab you switch to. Tools for debugging your node.js modules and event loop. The diagnostics mcp server is what makes that connection.

What the server does

Diagnostics in the evolution of debug pattern that is used in the Node.js core, this extremely small but powerful technique can best be compared as feature flags for loggers. The created debug logger is disabled by default but can be enabled without changing a line of code, using flags.

To create a new logger simply require the @dabh/diagnostics module and call the returned function. It accepts 2 arguments:

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • Introduction — To create a new logger simply require the @dabh/diagnostics module and call the returned function. It accepts 2 arguments:
  • modify — The modify method allows you add a new message modifier to all diagnostic instances. The passed argument should be a function that returns the
  • Modifiers — To be as flexible as possible when it comes to transforming messages we've come up with the concept of modifiers which can enhance the debug
  • namespace — This modifier is enabled for all debug instances and prefixes the messages with the name of namespace under which it is logged. The namespace is
  • Adapters — Adapters allows diagnostics to pull the DEBUG and DIAGNOSTICS environment variables from different sources. Not every JavaScript environment has a
  • hash — This adapter uses the window.location.hash of as source for the environment variables. It assumes that hash is formatted using the same syntax as
  • localStorage — This adapter uses the localStorage of the browser to store the debug flags. You can set the debug flag your self in your application code, but you
  • AsyncStorage — This adapter uses the AsyncStorage API that is exposed by the react-native library to store and read the debug or diagnostics storage items
  • Loggers — By default it will log all messages to console.log in when the logger is enabled using the debug flag that is set using one of the adapters

Installation

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Where it fits

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Diagnostics's toolset — Introduction, modify, Modifiers and 6 more — is a fair guide to whether it matches your workflow. It is maintained by dabh; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 9 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Diagnostics.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
IntroductionTo create a new logger simply require the @dabh/diagnostics module and call the returned function. It accepts 2 arguments:
modifyThe modify method allows you add a new message modifier to **all** diagnostic instances. The passed argument should be a function that returns the passed message after modification. The function receives 2 arguments:
ModifiersTo be as flexible as possible when it comes to transforming messages we've come up with the concept of modifiers which can enhance the debug messages. This allows you to introduce functionality or details that you find i
namespaceThis modifier is enabled for all debug instances and prefixes the messages with the name of namespace under which it is logged. The namespace is colored using the colorspace module which groups similar namespaces under t
AdaptersAdapters allows diagnostics to pull the DEBUG and DIAGNOSTICS environment variables from different sources. Not every JavaScript environment has a process.env that we can leverage. Adapters allows us to have different ad
hashThis adapter uses the window.location.hash of as source for the environment variables. It assumes that hash is formatted using the same syntax as query strings:
localStorageThis adapter uses the localStorage of the browser to store the debug flags. You can set the debug flag your self in your application code, but you can also open browser WebInspector and enable it through the console.
AsyncStorageThis adapter uses the AsyncStorage API that is exposed by the react-native library to store and read the debug or diagnostics storage items.
LoggersBy default it will log all messages to console.log in when the logger is enabled using the debug flag that is set using one of the adapters.

Example prompts to try

  • Use Diagnostics to Introduction.
  • Use Diagnostics to modify.
  • Use Diagnostics to Modifiers.

Frequently asked questions

It connects Diagnostics to MCP-compatible AI assistants such as Claude and Cursor, exposing 9 tools (Introduction, modify, Modifiers, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Diagnostics directly.