Claude Code setup
Claude Code supports both OAuth (recommended) and API key authentication methods. 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.
OAuth method (recommended)
-
Ensure you have Claude Code installed and configured.
-
Add the MCP server using the command line:
bash $claude mcp add --transport http newrelic https://mcp.newrelic.com/mcp/$claude mcp login newrelic
Or, edit ~/.claude.json as shown here:
{ "mcpServers": { "newrelic": { "type": "http", "url": "https://mcp.newrelic.com/mcp/" } }}
3. Follow the browser OAuth flow to complete authentication.
API key method
- Add the MCP server using the command line:
bash $claude mcp add --transport http newrelic https://mcp.newrelic.com/mcp/ --header "api-key: NRAK-YOUR-KEY-HERE"
Or, edit ~/.claude.json as shown here:
{ "mcpServers": { "newrelic": { "type": "http", "url": "https://mcp.newrelic.com/mcp/", "headers": { "api-Key": "NRAK-YOUR-KEY-HERE" } } }}
2. Verify that the MCP server is listed:
bash $claude mcp list
3. Start Claude:
bash $claude
If you encounter connection errors after setup, refer to Unexpected connection error in Claude Code and Stale OAuth credentials in Claude Desktop.
Kiro CLI setup
OAuth method (recommended)
-
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.json and 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", "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.
API key method
-
Ensure you have the Kiro CLI tool installed on your machine.
-
Configure the MCP server by opening (or creating) ~/.kiro/settings/mcp.json and add the following configuration:
{ "mcpServers": { "newrelic-mcp-server": { "url": "https://mcp.newrelic.com/mcp/", "headers": { "api-key": "NRAK-YOUR-KEY-HERE" }, "disabled": false } }}
3. Open your terminal and run kiro-cli. The New Relic MCP server will connect automatically.
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.
OAuth method (recommended)
- Create the config directory (if needed):
bash $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).
{ "mcpServers": { "new-relic-mcp": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.newrelic.com/mcp/"] } }}
3. Restart Claude Desktop.
API key method
- Add the MCP server by editing
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) as shown here:
* For macOS:
{ "mcpServers": { "newrelic": { "command": "npx", "args": [ "-y", "mcp-remote", "https://mcp.newrelic.com/mcp/", "--transport", "http", "--header", "api-key: NRAK-xxxx" ] } }}
* For Windows:
{ "mcpServers": { "newrelic": { "command": "C:\\PROGRA~1\\nodejs\\npx.cmd", "args": [ "-y", "mcp-remote", "https://mcp.newrelic.com/mcp/", "--transport", "http", "--header", "api-key: NRAK-xxxx" ] } }}
- Restart Claude Desktop. On Windows, changes may not take effect until the Claude application is closed via Task Manager.
Windsurf setup
OAuth method
- Edit the config file,
~/.codeium/windsurf/mcp_config.json, as shown here:
{ "mcpServers": { "new-relic": { "serverUrl": "https://mcp.newrelic.com/mcp/" } }}
2. Restart Windsurf.
- Check MCP servers using the hammer icon in the Cascade panel.
API key method
- Add the MCP server by editing
~/.codeium/windsurf/mcp_config.json as shown here:
{ "mcpServers": { "newrelic-api": { "serverUrl": "https://mcp.newrelic.com/mcp/", "headers": { "api-key": "NRAK-YOUR-API-KEY" } } }}
2. Restart Windsurf.
VS Code setup
VS Code remains fully supported with both authentication methods. You need VS Code (version 1.91 or later).
OAuth method
Add the MCP server by editing .vscode/mcp.json as shown here:
{ "servers": { "new-relic-mcp": { "url": "https://mcp.newrelic.com/mcp/", "type": "http" } }}
API key method
Add the MCP server by editing .vscode/mcp.json as shown here:
{ "inputs": [ { "type": "promptString", "id": "nr-api-key", "description": "New Relic User API Key", "password": true } ], "servers": { "new-relic-mcp": { "type": "http", "url": "https://mcp.newrelic.com/mcp/", "headers": { "api-key": "${input:nr-api-key}" } } }}
Setup steps
- 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 using one of the methods above.
2. 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.