# Nestjs MCP

> Nestjs MCP is an open-source MCP server for developer tools. Runtime inspector for NestJS apps that shows coding agents the real module and route graph. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** self-hosted
- **Repository:** https://github.com/jsirp-dev/nestjs-mcp
- **MCP Registry name:** io.github.jsirp-dev/nestjs-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

Most of what a NestJS app does is wired up at runtime: which guards, pipes and interceptors a route passes through, what a provider is injected with, which jobs fire on a schedule. This package puts an inspector inside the running app and lets an agent ask about it, rather than reading source and guessing.

You import one module, `NestMcpModule.forRoot()`, and the app opens a separate HTTP listener, by default at `http://127.0.0.1:7777/`. It sits outside the app's own server, so global prefixes, auth guards, request loggers and OpenAPI output never see it, and its calls do not show up in request traces. Tool groups cover the module and provider graph, routes with their enhancers, live logs, request traces with timings, debug stacks for failing steps, event listeners, scheduled jobs and runs. Event and schedule tools appear only if `@nestjs/event-emitter` or `@nestjs/schedule` are in use.

It works on Nest 10 and 11. Start the app with `snapshot: true` so Nest keeps the graph. The `enabled` option defaults to off when `NODE_ENV` is `production`, and an `authorize` option exists if you turn it on there.

## Features

- **Module and provider graph:** Shows how modules and providers are connected in the running app.
- **Routes with enhancers:** Lists each route with the guards, interceptors, pipes and filters it goes through.
- **Live log reading:** Reads what the app's Logger is writing right now, including a custom logger.
- **Request traces:** Shows which enhancers a request passed through and how long each took.
- **Events and scheduled jobs:** Lists event listeners and scheduled jobs when the optional Nest packages are present.
- **Scoped instances:** `forFeature` limits an instance to one module and what it imports, on its own path.

## Good for

- Ask a coding agent why a route returns 403 and which guard ran
- Find out which provider a service is really getting injected
- Check what a cron job is scheduled to do without opening source
- Debug a slow request by looking at per-enhancer timings
- Give Claude Code or Cursor a map of an unfamiliar Nest codebase

## Install

### Claude Code (Terminal)

```sh
claude mcp add nestjs-mcp -- npx -y @jsirp/nestjs-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "nestjs-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jsirp/nestjs-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "nestjs-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jsirp/nestjs-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "nestjs-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@jsirp/nestjs-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "nestjs-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jsirp/nestjs-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "nestjs-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jsirp/nestjs-mcp"
      ]
    }
  }
}
```

## Tools

- `app_info`: Reports the inspector's scope and MCP URL.

## FAQ

### How do I connect an agent?

Run `claude mcp add --transport http my-nest-app http://127.0.0.1:7777/`, or add an `http` entry with that URL to any client that reads an `mcpServers` file.

### Does it run in production?

By default `enabled` is false when `NODE_ENV` is `production`, so no listener opens. You can set it to true and protect it with `authorize`.

### Which Nest versions work?

Nest 10 and 11.

### Do I install it as a devDependency?

The README says to install it as a regular dependency, because the app's module imports it and a production install without devDependencies would fail at startup. It also shows a conditional import if you want it out of production builds.

### What if two apps run on one machine?

Give each its own `listen.port`; the URL does not depend on the app's own port.

### Is Nestjs MCP free?

Yes. Nestjs MCP is open source, so you can use and self-host it for free.

### How do I add Nestjs MCP to Claude Code?

Run this command in your terminal: claude mcp add nestjs-mcp -- npx -y @jsirp/nestjs-mcp

### What are the best alternatives to Nestjs MCP?

The closest alternatives to Nestjs MCP are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/nestjs-mcp
