MCP.so
Sign In
N

NestLens MCP Server

@mogretici

Basic information

Last updated

License

MIT

Transports

stdio, streamable-http

Auth

none

Author

mogretici

About NestLens MCP Server

Inspect NestJS debugging data through a read-only-by-default MCP gateway.

NestLens MCP Server config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "nestlens": {
      "command": "npx",
      "args": [
        "-y",
        "nestlens-mcp",
        "--url",
        "http://localhost:3000/nestlens"
      ]
    }
  }
}

NestLens MCP Server tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

Fetch the live tool list by running this server in a temporary sandbox using the button above.

Overview

Overview

NestLens MCP connects an AI client to the debugging data of a running NestJS application instrumented with NestLens. The author maintains a separate nestlens-mcp package that includes the MCP SDK and can run over local stdio or a self-hosted HTTP endpoint.

It suits developers investigating slow requests, repeated database queries and unresolved exceptions in development or staging. Unlike a static catalog of individual MCP tools, it exposes two gateway tools and obtains the available operations from the application each time. Write operations stay disabled by default.

Capabilities

  • Discover application operations and their arguments with nestlens_list_tools, then invoke an operation with nestlens_call_tool.
  • Inspect statistics, requests, logs, exceptions and recorded queries, including grouped entries and N+1 query filters.
  • Retrieve a recorded request with its associated queries, exceptions and logs to investigate a failure.
  • Check recording and watcher status to distinguish missing activity from disabled collection.

Setup and first use

  1. In your NestJS application, install NestLens with npm install nestlens.
  2. Import NestLensModule from nestlens and register NestLensModule.forRoot({ enabled: process.env.NODE_ENV !== 'production' }) once in the root module. Start the application and confirm its dashboard is reachable at http://localhost:3000/nestlens (or your configured path).
  3. Add the MCP server to Claude Code with claude mcp add nestlens -- npx -y nestlens-mcp --url http://localhost:3000/nestlens. The equivalent Codex command starts with codex mcp add nestlens -- and uses the same executable and arguments.
  4. Restart or reload the client configuration as needed. Ask it to list NestLens operations first, then inspect get_stats or the slowest requests. No write flag is needed for this workflow.
  5. If access is protected, supply the application's authorization through NESTLENS_HEADERS in the MCP process environment. Keep secrets out of command arguments and shared configuration. For remote HTTP hosting, follow the official guide for bearer-token protection and TLS termination.

Requirements and limits

A running, enabled NestLens application and a Node.js/npm environment capable of running npx are required. The application's tool catalog endpoint was added in NestLens 0.15.0; use compatible current application and MCP package versions. Since 0.19.0, the standalone command comes from nestlens-mcp rather than the older multi-package npx invocation.

NestLens is MIT licensed. This self-hosted integration does not establish any free model-provider entitlement; infrastructure and AI-client costs are separate. The default MCP mode refuses non-GET operations even when they appear in the catalog. Enabling --allow-write changes that boundary and is unnecessary for inspection.

The upstream application's environment, IP, authorization and rate-limit rules still apply. Unmasked request bodies and logs may reach the model provider: use appropriate development data and masking. HTTP mode speaks plain HTTP locally; a public deployment needs TLS and a bearer token. This guide did not run your application or install packages.

Sources and verification

Checked on 2026-12-02 against the author repository and official MCP integration guide. Package and configuration facts are documentation-verified; no authenticated runtime test was performed.

Frequently asked questions

1

Why does the client show only two tools?

The two gateway tools discover and call operations provided by the running application. They do not mean that only two debugging operations are available; ask nestlens_list_tools for the current catalog.

2

Why do I get a dashboard HTML page instead of JSON?

The --url value should point to the dashboard mount, including /nestlens, rather than just the application origin. An older application without the tool catalog endpoint also needs upgrading. Use the final URL because redirects are deliberately not followed.

3

Can the agent delete logs or replay requests?

Not in the default read-only mode. Non-GET operations are listed as disabled and refused. --allow-write is an explicit opt-in; replay additionally requires the application's separate replay setting.

4

Does read-only mode hide sensitive logs?

No. It prevents the supported mutation operations, not disclosure of readable data. Configure masking in NestLens and review which recorded data your AI client can send to its provider.

Comments

More MCP servers