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.
Importante
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, including the authentication setup. Then, follow the instructions for your specific development environment.
Filtering tools with include-tags
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
You can dynamically filter the tools your AI agent accesses by sending the include-tags HTTP header with your requests as shown here:
Importante
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:
"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 documentation.
Importante
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 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.
Ensure you have Claude Code installed and configured.
Add the MCP server using the command line:
bash$claude mcp add --transport http --scope user newrelic https://mcp.newrelic.com/mcp/$claude mcp login newrelicOr, edit
~/.claude.jsonas shown here:{"mcpServers": {"newrelic": {"type": "http","url": "https://mcp.newrelic.com/mcp/"}}}Follow the browser OAuth flow to complete authentication.
If you encounter connection errors after setup, refer to Unexpected connection error in Claude Code and Stale OAuth credentials in Claude Desktop.
Codex setup
Codex supports OAuth authentication method. OAuth requires Codex version 0.154.0 or later.
Ensure you have Codex installed and configured.
Add the MCP server using the command line:
bash$codex mcp add newrelic --url https://mcp.newrelic.com/mcp/Or, edit
~/.codex/config.tomlas shown here:bash$[mcp_servers.newrelic]$url = "https://mcp.newrelic.com/mcp/"Follow the browser OAuth flow to complete authentication.
Antigravity CLI setup
Importante
Only the API key method is currently supported for Antigravity CLI. OAuth support is not yet available.
Ensure you have Antigravity CLI installed on your machine.
Configure the MCP server by opening (or creating) the configuration file:
macOS/Linux:
~/.gemini/config/mcp_config.jsonWindows:
%USERPROFILE%\.gemini\config\mcp_config.jsonAdd the following configuration:
{"mcpServers": {"newrelic": {"serverUrl": "https://mcp.newrelic.com/mcp/","headers": {"api-key": "NRAK-YOUR-KEY-HERE"}}}}
Start Antigravity CLI:
bash$agyRun
/mcpto verify the New Relic server is connected.
Kiro CLI setup
Ensure you have the Kiro CLI tool installed on your machine.
Configure the MCP server by opening (or creating) the configuration file located at
~/.kiro/settings/mcp.jsonand add the following configuration:{"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","oauthScopes": ["observability:read", "offline", "offline_access"],"usePKCE": true},"disabled": false}}}Authenticate and connect:
- Open your terminal and run
kiro-cli. - Type the command
/mcpand 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.
- Open your terminal and run
Cursor setup
Importante
Only the API key method is currently supported for Cursor. The New Relic MCP server is OAuth ready, and we plan to enable OAuth for Cursor as soon as Cursor supports it. Until then, use an API key as described here.
Requirements for using an API key
Before you configure Cursor, confirm the following:
- Your New Relic administrator has enabled the API Keys sub-toggle under New Relic MCP Server in feature control manager. If it's disabled, connections fail. See API key error.
- You belong to a group with a role that can read the MCP server. See Organization access.
- You have a user API key, in the format
NRAK-XXXXXXXXXXXXXXXXXXXXX. To create or copy one, log in to New Relic, and select user menu > API keys.
API key access
- Inherits your user permissions: Cursor can only access the data, entities, and accounts granted to your New Relic user via role-based access control (RBAC). Requests outside these permissions return a permission error.
- Requires secure storage: Because the key grants full access to your user permissions, store it securely, never commit it to source control, and use an account configured with least-privilege access.
- Excludes OAuth-only features: API keys cannot access certain features, including AI-powered analysis and preview tools. For a complete list, see OAuth-only tools.
Configure Cursor
Ensure that you have Cursor installed on your machine.
Configure the MCP server by opening (or creating) the configuration file:
Global (all projects):
~/.cursor/mcp.jsonProject-specific:
.cursor/mcp.jsonin your project rootAdd the following configuration:
{"mcpServers": {"newrelic": {"url": "https://mcp.newrelic.com/mcp/","headers": {"api-key": "NRAK-YOUR-KEY-HERE"}}}}
Restart Cursor, or open Cursor Settings > MCP and confirm that the New Relic server is enabled and shows as connected.
Claude Desktop setup
Claude Desktop requires the mcp-remote proxy for OAuth authentication. Ensure you have Node.js installed on your computer for npx to work.
Create the config directory (if needed):
bash$mkdir -p "~/Library/Application Support/Claude"Edit the config file:
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows).{"mcpServers": {"new-relic-mcp": {"command": "npx","args": ["-y", "mcp-remote", "https://mcp.newrelic.com/mcp/"]}}}Restart Claude Desktop.
VS Code setup
You need VS Code (version 1.91 or later).
Add the MCP server by editing
.vscode/mcp.jsonas shown here:{"servers": {"new-relic-mcp": {"url": "https://mcp.newrelic.com/mcp/","type": "http"}}}Create or open
mcp.jsonin your VS Code workspace:- If you don't have a
.vscodedirectory, create one in your project root.- Inside
.vscode, create a file namedmcp.json. - Add your authentication configuration.
- Inside
- If you don't have a
Start server:
- Ensure your
mcp.jsonfile is open in the editor. - Look for a clickable link (CodeLens) above your server configuration. Click it to start the MCP server.
- Ensure your
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.