---
title: Set up New Relic MCP
source: https://docs.newrelic.com/docs/agentic-ai/mcp/setup
---

This guide walks you through setting up New Relic's Model Context Protocol (MCP) server with your preferred supported MCP clients. Choose your environment below for platform-specific instructions.

> #### ⚠️ IMPORTANT
>
> Your use of any AI tools, including but not limited to the ones listed on this page, with New Relic AI MCP servers means your AI will take actions in your New Relic account on your behalf. When using either of the methods described here, create and use appropriate New Relic accounts that have your desired role based access controls (RBAC) and the least privileged permissions appropriate for your use case, requirements, and internal policies.

Before you begin the New Relic MCP setup, ensure you have completed the [prerequisites](https://docs.newrelic.com/docs/agentic-ai/mcp/overview#prerequisites), including the authentication setup. Then, follow the instructions for your specific development environment.

## Filtering tools with include-tags [#filtering-tools]

The New Relic MCP tools are organized and categorized using internal tags (such as `alerting`, `discovery`, and `data-access`). For details, refer to [filter tools](https://docs.newrelic.com/docs/agentic-ai/mcp/tool-reference##filter-tools)

You can dynamically filter the tools your AI agent accesses by sending the `include-tags` `HTTP` header with your requests as shown here:

> #### ⚠️ IMPORTANT
>
> **Region Notice:** The configuration examples in this topic use the US region (default) MCP connection URL: <https://mcp.newrelic.com/mcp/>. If your New Relic account is in a different region, replace this URL with the appropriate regional endpoint in all configuration files and command-line arguments:
>
> -   EU: <https://mcp.eu.newrelic.com/mcp/>
> -   JP: <https://mcp.jp.newrelic.com/mcp/>

```json
"servers": {
    "new-relic-mcp-server": {
        "url": "https://mcp.newrelic.com/mcp/",
        "type": "http",
        "headers": {
            "include-tags": "discovery,alerting"
        }
    }
}
```

For the complete list of available tags and the tools associated with each, refer to the [New Relic MCP tool reference](https://docs.newrelic.com/docs/agentic-ai/mcp/tool-reference) documentation.

> #### ⚠️ IMPORTANT
>
> Unless expressly indicated otherwise in this Documentation, you should only set up your supported MCP clients with the OAuth method. Unless indicated otherwise, any setup with an API key will not work as described in this Documentation or as intended.

## Claude Code setup [#claude-code]

Claude Code supports OAuth authentication method. OAuth requires Claude Code version 2.1.186 or later. If you are on older versions, you should authenticate via `/mcp` inside Claude instead of claude MCP login.

1.  Ensure you have Claude Code installed and configured.

2.  Add the MCP server using the command line:

    ```shell
    claude mcp add --transport http newrelic https://mcp.newrelic.com/mcp/
    claude mcp login newrelic
    ```

    Or, edit `~/.claude.json` as shown here:

    ```json
    {
      "mcpServers": {
        "newrelic": {
          "type": "http",
          "url": "https://mcp.newrelic.com/mcp/"
        }
      }
    }
    ```

3.  Follow the browser OAuth flow to complete authentication.

If you encounter connection errors after setup, refer to [Unexpected connection error in Claude Code](https://docs.newrelic.com/docs/agentic-ai/mcp/troubleshoot#connection-error) and [Stale OAuth credentials in Claude Desktop](https://docs.newrelic.com/docs/agentic-ai/mcp/troubleshoot#stale-creds).

## Codex setup [#codex]

Codex supports OAuth authentication method. OAuth requires Codex version 0.154.0 or later.

1.  Ensure you have Codex installed and configured.

2.  Add the MCP server using the command line:

    ```shell
    codex mcp add newrelic --url https://mcp.newrelic.com/mcp/
    ```

    Or, edit `~/.codex/config.toml` as shown here:

    ```shell
    [mcp_servers.newrelic]
    url = "https://mcp.newrelic.com/mcp/"
    ```

3.  Follow the browser OAuth flow to complete authentication.

## Antigravity CLI setup [#antigravity-cli]

> #### ⚠️ IMPORTANT
>
> Only the API key method is currently supported for Antigravity CLI. OAuth support is not yet available.

1.  Ensure you have Antigravity CLI installed on your machine.

2.  Configure the MCP server by opening (or creating) the configuration file:

    -   macOS/Linux: `~/.gemini/config/mcp_config.json`
    -   Windows: `%USERPROFILE%\.gemini\config\mcp_config.json`

        Add the following configuration:

        ```json
        {
          "mcpServers": {
            "newrelic": {
              "serverUrl": "https://mcp.newrelic.com/mcp/",
              "headers": {
                "api-key": "NRAK-YOUR-KEY-HERE"
              }
            }
          }
        }
        ```

3.  Start Antigravity CLI:

    ```shell
    agy
    ```

4.  Run `/mcp` to verify the New Relic server is connected.

## Kiro CLI setup [#kiro-cli]

1.  Ensure you have the [Kiro CLI tool installed](https://kiro.dev/cli/) on your machine.

2.  Configure the MCP server by opening (or creating) the configuration file located at `~/.kiro/settings/mcp.json` and add the following configuration:

    ```json
    {
      "mcpServers": {
        "newrelic-mcp-server": {
          "url": "https://mcp.newrelic.com/mcp/",
          "oauth": {
            "authorizationUrl": "https://oauth2.service.newrelic.com/oauth2/auth",
            "tokenUrl": "https://oauth2.service.newrelic.com/oauth2/token",
            "scopes": ["observability:read", "offline", "offline_access"],
            "usePKCE": true
          },
          "disabled": false
        }
      }
    }
    ```

3.  Authenticate and connect:
    -   Open your terminal and run `kiro-cli`.
    -   Type the command `/mcp` and hit enter.
    -   You will see the New Relic server listed with a URL. Open that URL in your browser.
    -   Complete the standard New Relic login process.
    -   After you're authenticated, the browser will confirm success.

## Claude Desktop setup [#claude-desktop]

Claude Desktop requires the `mcp-remote` proxy for `OAuth` authentication. Ensure you have `Node.js` installed on your computer for npx to work.

1.  Create the config directory (if needed):

    ```shell
    mkdir -p "~/Library/Application Support/Claude"
    ```

2.  Edit the config file: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows).

    ```json
    {
      "mcpServers": {
        "new-relic-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "mcp-remote",
            "https://mcp.newrelic.com/mcp/"
          ]
        }
      }
    }
    ```

3.  Restart Claude Desktop.

## VS Code setup [#vs-code]

You need VS Code (version 1.91 or later).

1.  Add the MCP server by editing `.vscode/mcp.json` as shown here:

    ```json
    {
      "servers": {
        "new-relic-mcp": {
          "url": "https://mcp.newrelic.com/mcp/",
          "type": "http"
        }
      }
    }
    ```

2.  Create or open `mcp.json` in your VS Code workspace:

    -   If you don't have a `.vscode` directory, create one in your project root.
        -   Inside `.vscode`, create a file named `mcp.json`.
        -   Add your authentication configuration.

3.  Start server:

    -   Ensure your `mcp.json` file is open in the editor.
    -   Look for a clickable link (CodeLens) above your server configuration. Click it to start the MCP server.

Once connected, you can interact with New Relic AI using natural language prompts. The MCP server will manage authentication and data retrieval from your New Relic account.
