# MCP server

> Let your AI agent search ngwr and read its API.

Source: https://ngwr.dev/docs/mcp-server

## Add it to your agent

`ngwr-mcp` is a [Model Context Protocol](https://modelcontextprotocol.io) server that ships in the `ngwr` package.

```bash
claude mcp add ngwr -- npx -y -p ngwr ngwr-mcp
```

Or add this to the client's config file:

```typescript
{
  "mcpServers": {
    "ngwr": {
      "command": "npx",
      "args": ["-y", "-p", "ngwr", "ngwr-mcp"]
    }
  }
}
```

| Client | Config file |
| --- | --- |
| Claude Code | `.mcp.json` in the project root |
| Claude Desktop, macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| Claude Desktop, Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
| Cursor | `.cursor/mcp.json` in the project, or `~/.cursor/mcp.json` |

Restart Claude Desktop after you edit its config.

## Pin your installed version

`npx` runs the latest release when the project has no ngwr; `node` runs your installed copy.

```typescript
{
  "mcpServers": {
    "ngwr": {
      "command": "node",
      "args": ["./node_modules/ngwr/mcp/server.js"]
    }
  }
}
```

The path is relative to where the client starts the server: the project root for Claude Code.

## Tools

| Tool | Arguments | Returns |
| --- | --- | --- |
| `search_ngwr` | `query`, `limit` (10, at most 40) | Matching entry points with import line and selector. Start here. |
| `get_ngwr_component` | `name`: entry point, symbol or selector | Selectors, exports, import line, `@use` line and docs URLs |
| `get_ngwr_api` | `symbol`: a class or a function, `kind` to narrow a class (`input`, `output`, `method`, …) | Inputs, models, outputs and methods of one class, or the signature of one function (`provideWr`, a `with*()` feature) |
| `get_ngwr_setup` | `symbols`: an array of names | The install, `ng g ngwr:use`, `@use` and provider lines, as text |

It reads only its own package: no network, no writes, and it never runs the commands it returns.

## See also

- [Skills](https://ngwr.dev/docs/skills) — Give your AI agent the ngwr rules and catalog as a skill.
- [Installation](https://ngwr.dev/docs/installation) — Add ngwr to an Angular app.
