npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@davidcrocq/newrelic-mcp-server

v1.0.0

Published

New Relic MCP Server for Claude Desktop - Monitor applications, run NRQL queries, manage alerts via Model Context Protocol

Readme

New Relic MCP Server

npm version License: MIT

A TypeScript-based Model Context Protocol (MCP) server for New Relic, designed for use with Claude Desktop. Query your New Relic data, monitor applications, run NRQL queries, and manage alerts directly from Claude.

Features

This MCP server provides 13 tools across 4 categories for interacting with New Relic:

Entity Tools

  • newrelic-list-entities - Search for entities (applications, hosts, services, etc.)
  • newrelic-get-entity - Get detailed entity information by GUID
  • newrelic-get-golden-metrics - Retrieve golden metrics for an entity

NRQL Tools

  • newrelic-execute-nrql - Execute NRQL queries
  • newrelic-get-dashboards - List all dashboards
  • newrelic-get-dashboard - Get dashboard details

APM Tools

  • newrelic-list-applications - List all APM applications
  • newrelic-get-application-metrics - Get application performance metrics
  • newrelic-get-transactions - Get transaction data
  • newrelic-get-errors - Get error analytics

Alert Tools

  • newrelic-list-alert-policies - List alert policies
  • newrelic-get-open-incidents - Get open incidents
  • newrelic-get-incident-details - Get incident details

Prerequisites

  • Node.js 18+ - Required for running the server
  • New Relic Account - You need a New Relic account with API access
  • New Relic API Key - A User API key from New Relic

Getting Your New Relic Credentials

  1. API Key: Go to New Relic API Keys and create a new User API key (type: NRAK-...)

  2. Account ID: Find your account ID in the URL when logged into New Relic:

    • https://one.newrelic.com/...?account=YOUR_ACCOUNT_ID
    • Or go to AdministrationAccess ManagementAccounts

Installation

Quick Start with npx (Recommended)

No installation required! Configure Claude Desktop to use npx directly (see Configuration section below).

Global Installation

npm install -g @davidcrocq/newrelic-mcp-server

Install from Source

git clone https://github.com/dcrocq/newrelic-mcp-local.git
cd newrelic-mcp-local
npm install
npm run build

Configuration

Environment Variables

The server requires two environment variables:

| Variable | Description | Example | |----------|-------------|---------| | NEW_RELIC_API_KEY | Your New Relic User API Key | NRAK-XXXXXXXXXXXXXXXXXXXX | | NEW_RELIC_ACCOUNT_ID | Your New Relic Account ID | 1234567 |

Claude Desktop Configuration

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Linux: ~/.config/Claude/claude_desktop_config.json

Using npx (Recommended - No Installation Required)

{
  "mcpServers": {
    "newrelic": {
      "command": "npx",
      "args": ["-y", "@davidcrocq/newrelic-mcp-server"],
      "env": {
        "NEW_RELIC_API_KEY": "NRAK-your-api-key-here",
        "NEW_RELIC_ACCOUNT_ID": "your-account-id"
      }
    }
  }
}

Using Global Installation

{
  "mcpServers": {
    "newrelic": {
      "command": "newrelic-mcp-server",
      "env": {
        "NEW_RELIC_API_KEY": "NRAK-your-api-key-here",
        "NEW_RELIC_ACCOUNT_ID": "your-account-id"
      }
    }
  }
}

Using Local Installation (from source)

{
  "mcpServers": {
    "newrelic": {
      "command": "node",
      "args": ["/absolute/path/to/newrelic-mcp-local/build/index.js"],
      "env": {
        "NEW_RELIC_API_KEY": "NRAK-your-api-key-here",
        "NEW_RELIC_ACCOUNT_ID": "your-account-id"
      }
    }
  }
}

Important: Replace the API key and account ID with your actual New Relic credentials.

Verify Configuration

After updating the configuration:

  1. Restart Claude Desktop completely (quit and reopen)
  2. Look for the MCP server icon (hammer icon) in the input area
  3. Click it to see the available New Relic tools

Usage Examples

Once configured, you can ask Claude to use the New Relic tools:

Query Entities

"List all APM applications in my New Relic account"

"Get details for the entity with GUID MTIzNDU2..."

Run NRQL Queries

"Run this NRQL query: SELECT count(*) FROM Transaction SINCE 1 hour ago"

"Show me the average response time by transaction name for my app"

APM Monitoring

"Show me the top 10 slowest transactions for my-app"

"What errors occurred in my-app in the last hour?"

Check Alerts

"List all my alert policies"

"Are there any open incidents right now?"

Development

Build Commands

# Build the TypeScript code
npm run build

# Watch mode for development
npm run dev

# Clean build directory
npm run clean

# Rebuild from scratch
npm run rebuild

Project Structure

newrelic-mcp-server/
├── src/
│   ├── index.ts              # Main server entry point
│   ├── types.ts              # TypeScript type definitions
│   ├── client.ts             # New Relic GraphQL client
│   ├── logger.ts             # Logging utility
│   └── tools/
│       ├── entity-tools.ts   # Entity search & golden metrics
│       ├── nrql-tools.ts     # NRQL queries & dashboards
│       ├── apm-tools.ts      # APM monitoring
│       └── alert-tools.ts    # Alert policies & incidents
├── build/                    # Compiled JavaScript (after build)
├── package.json
├── tsconfig.json
├── LICENSE
└── README.md

Testing the Server

You can test the server directly by running:

# Set environment variables
export NEW_RELIC_API_KEY="NRAK-your-key"
export NEW_RELIC_ACCOUNT_ID="your-account-id"

# Run the server
npm start

The server will start and wait for MCP protocol messages on stdin.

Logging

The MCP server logs all New Relic API requests and tool calls to a log file for debugging and auditing purposes.

Log File Location

The log file is located at:

~/.newrelic-mcp/newrelic-mcp.log
  • macOS/Linux: ~/.newrelic-mcp/newrelic-mcp.log
  • Windows: C:\Users\<username>\.newrelic-mcp\newrelic-mcp.log

Viewing Logs

Real-time monitoring (macOS/Linux):

tail -f ~/.newrelic-mcp/newrelic-mcp.log

View recent logs:

# Last 50 lines
tail -50 ~/.newrelic-mcp/newrelic-mcp.log

# Search for errors
grep ERROR ~/.newrelic-mcp/newrelic-mcp.log

# Search for specific tool calls
grep "Tool Call" ~/.newrelic-mcp/newrelic-mcp.log

Windows PowerShell:

# View log file
Get-Content $env:USERPROFILE\.newrelic-mcp\newrelic-mcp.log

# Real-time monitoring
Get-Content $env:USERPROFILE\.newrelic-mcp\newrelic-mcp.log -Wait -Tail 50

Log Format

Each log entry includes:

  • Timestamp: ISO 8601 format
  • Level: DEBUG, INFO, WARN, or ERROR
  • Context: Component that generated the log
  • Message: Description of the event
  • Data: Additional JSON data (for requests/responses)

Example log entries:

[2025-01-13T10:30:45.123Z] [INFO] [MCPServer] Tool Call: newrelic-list-applications
{
  "tool": "newrelic-list-applications",
  "arguments": {}
}
[2025-01-13T10:30:45.456Z] [INFO] [NewRelicClient] API Request: ListApplications
{
  "operation": "ListApplications",
  "variables": { "cursor": null }
}
[2025-01-13T10:30:46.789Z] [INFO] [NewRelicClient] API Response: ListApplications
{
  "operation": "ListApplications",
  "durationMs": 1333,
  "success": true
}

Log Rotation

  • The log file is automatically rotated when it exceeds 10MB
  • The previous log is saved as newrelic-mcp.log.old
  • Only one backup file is kept

Clearing Logs

To clear the log file:

# macOS/Linux
rm ~/.newrelic-mcp/newrelic-mcp.log

# Windows PowerShell
Remove-Item $env:USERPROFILE\.newrelic-mcp\newrelic-mcp.log

Troubleshooting

Server Not Appearing in Claude

  1. Ensure the build was successful: npm run build
  2. Check the path in claude_desktop_config.json is correct and absolute
  3. Verify environment variables are set in the config
  4. Restart Claude Desktop completely

Authentication Errors

  1. Verify your API key starts with NRAK-
  2. Ensure the API key has not expired
  3. Check that your account ID is correct

GraphQL Errors

  1. Some queries may require specific permissions
  2. Ensure your API key has access to the account
  3. Check New Relic's API Explorer to test queries

Debug Mode

To see server output, run Claude Desktop from a terminal:

macOS:

/Applications/Claude.app/Contents/MacOS/Claude

Server logs will appear in the terminal (stderr).

API Reference

New Relic GraphQL API

This server uses the New Relic GraphQL API (NerdGraph) for all operations.

MCP Protocol

Learn more about the Model Context Protocol at modelcontextprotocol.io.

License

MIT License - See LICENSE for details.