Skip to main content
Glama
NewRelic MCP Server

NewRelic MCP Server

by ruminaider

newrelic-mcp-server

A comprehensive MCP server for NewRelic with 25 tools for querying, monitoring, and analyzing your observability data — NRQL, entities, alerts, dashboards, logs, and more.

npm version License: MIT

Quick Start

Using npx

Add to your .mcp.json:

{
  "mcpServers": {
    "newrelic": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@ruminaider/newrelic-mcp-server"],
      "env": {
        "NEW_RELIC_API_KEY": "NRAK-XXXXXXXXXXXX",
        "NEW_RELIC_ACCOUNT_ID": "1234567"
      }
    }
  }
}

Using Docker

docker build -t newrelic-mcp-server .
{
  "mcpServers": {
    "newrelic": {
      "type": "stdio",
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "NEW_RELIC_API_KEY", "-e", "NEW_RELIC_ACCOUNT_ID", "-e", "NEW_RELIC_REGION", "newrelic-mcp-server"],
      "env": {
        "NEW_RELIC_API_KEY": "NRAK-XXXXXXXXXXXX",
        "NEW_RELIC_ACCOUNT_ID": "1234567",
        "NEW_RELIC_REGION": "US"
      }
    }
  }
}

Related MCP server: nr-mcp

Authentication

The server authenticates via a NewRelic User API key (recommended over license keys):

Variable

Required

Default

Description

NEW_RELIC_API_KEY

Yes

-

User API key (format: NRAK-XXXXXXXXXXXX)

NEW_RELIC_ACCOUNT_ID

Yes

-

NewRelic Account ID

NEW_RELIC_REGION

No

US

API region (US or EU)

LOG_LEVEL

No

info

Log level (debug / info / warn / error)

API keys are automatically redacted in log output.

Performance

Response Optimization

All tool responses use compact JSON (no whitespace) to reduce token usage. Tools that build structured response objects include only essential fields — verbose NerdGraph metadata like __typename, permalink, and rawConfiguration is stripped when raw API data is returned.

Rate Limiting

The server enforces NewRelic's API limits:

  • 25 concurrent requests with semaphore-based backpressure

  • Exponential backoff on 429 responses (base 1s, max 30s, with jitter)

  • Automatic retry for rate limit and network errors (3 attempts)

Tools

Data Access — 5 tools

Tool

Description

execute_nrql_query

Execute arbitrary NRQL queries with full result parsing

list_recent_logs

List recent logs with filtering by time range and entity

analyze_entity_logs

Analyze logs for a specific entity with pattern detection

query_logs

Search logs by field/value with configurable limits

natural_language_to_nrql_query

Get NRQL query suggestions from natural language descriptions

Entity Management — 5 tools

Tool

Description

get_entity

Get entity details by GUID including summary metrics

list_related_entities

Find entities related to a given entity

search_entity_with_tag

Search entities by tag key/value pairs

list_entity_types

List all available entity types and domains

list_available_new_relic_accounts

List accessible NewRelic accounts

Alerts & Incidents — 8 tools

Tool

Description

list_alert_policies

List alert policies with condition counts

list_alert_conditions

List NRQL alert conditions for a policy

list_recent_issues

List recent AI-detected issues (experimental)

search_incident

Search incidents by time range and entity

analyze_deployment_impact

Analyze deployment effects on error rates and throughput

generate_alert_insights_report

Generate comprehensive alert analysis reports

get_entity_error_groups

Get error groups for an entity with occurrence counts

list_change_events

List deployment and change tracking events

Dashboards & Synthetics — 3 tools

Tool

Description

get_dashboard

Get dashboard details including widgets and NRQL queries

list_dashboards

List all dashboards with pagination

list_synthetic_monitors

List synthetic monitors with status and locations

Performance Analysis — 3 tools

Tool

Description

analyze_golden_metrics

Analyze entity golden metrics (throughput, errors, latency)

analyze_transactions

Analyze transaction performance with slowest breakdown

convert_time_period_to_epoch_ms

Convert human-readable time periods to epoch milliseconds

Utility — 1 tool

Tool

Description

convert_time_period_to_epoch_ms

Convert time descriptions like "last 6 hours" to epoch timestamps

Example Usage

Query Error Rates

execute_nrql_query with:
  query: "SELECT percentage(count(*), WHERE error IS true) FROM Transaction SINCE 1 hour ago"

Find Slow Transactions

analyze_transactions with:
  entityGuid: "YOUR_APM_ENTITY_GUID"
  sinceMinutesAgo: 60

Search Logs for Errors

query_logs with:
  field: "level"
  value: "ERROR"
  limit: 100

Get Help Writing NRQL

natural_language_to_nrql_query with:
  description: "Show me error rates by service over the last 6 hours"

Development

pnpm install       # install dependencies
pnpm build         # compile TypeScript
pnpm test          # run tests
pnpm dev           # run with tsx (no build needed)
pnpm watch         # recompile on change
pnpm lint          # lint with Biome
pnpm format        # format with Biome

Project Structure

src/
  index.ts                    # Entry point (stdio transport)
  server.ts                   # MCP server creation and tool registration
  config.ts                   # Environment variable parsing and validation
  services/
    nerdgraph-client.ts       # Core GraphQL client with rate limiting and retry
    nrql-service.ts           # NRQL query execution
    log-service.ts            # Log querying and analysis
    entity-service.ts         # Entity retrieval and relationships
    alert-service.ts          # Alert policies, conditions, and incidents
    dashboard-service.ts      # Dashboard retrieval and listing
    synthetic-service.ts      # Synthetic monitor management
    performance-service.ts    # Transaction and golden metrics analysis
  tools/
    nrql-tools.ts             # NRQL query tools
    entity-tools.ts           # Entity management tools
    alert-tools.ts            # Alert and incident tools
    incident-tools.ts         # Incident search and analysis tools
    dashboard-tools.ts        # Dashboard tools
    log-tools.ts              # Log query tools
    performance-tools.ts      # Performance analysis tools
    synthetic-tools.ts        # Synthetic monitor tools
    account-tools.ts          # Account listing tools
    utility-tools.ts          # Time conversion utilities
  types/
    newrelic.ts               # NewRelic API type definitions
  utils/
    errors.ts                 # Custom error types (AuthenticationError, RateLimitError, etc.)
    logger.ts                 # Structured stderr logging with API key redaction
    response.ts               # Response optimization (field stripping, compact JSON)
    retry.ts                  # Exponential backoff retry with jitter

Docker Development

docker compose build                              # build image
docker compose run --rm newrelic-mcp               # run server
docker compose --profile dev up newrelic-mcp-dev   # dev mode with hot reload

Troubleshooting

"Missing required environment variables"

Ensure NEW_RELIC_API_KEY and NEW_RELIC_ACCOUNT_ID are set and passed to Docker.

"Authentication failed"

Verify your API key has appropriate permissions. User API keys (NRAK-...) are recommended.

"Rate limit exceeded"

The server automatically retries with backoff. If persistent, reduce query frequency.

aiIssues endpoints failing

These use experimental NerdGraph headers. The server handles this automatically for list_recent_issues and search_incident.

License

MIT

Available Tools

24 tools
analyze_deployment_impactB

Analyze the impact of a deployment by comparing metrics (error rate, throughput, response time) before and after the deployment. Helps identify if a deployment caused performance degradation.

Inputs: entityGuid (required), deploymentTimestamp, beforeMinutes, afterMinutes.

analyze_entity_logsB

Analyze logs for a specific NewRelic entity by GUID. Use this to investigate issues with a particular service, application, or infrastructure component.

Inputs: entityGuid (required), limit, sinceMinutesAgo, level, +1 more.

analyze_golden_metricsB

Get the golden metrics defined for a NewRelic entity. Golden metrics are the key performance indicators that NewRelic recommends monitoring for each entity type (APM applications, hosts, etc.). Returns metric names, titles, and the NRQL queries used to calculate them. Use these queries to understand what metrics are important for an entity.

Inputs: guid (required).

analyze_transactionsA

Analyze transaction performance using NRQL with FACET grouping. Query the Transaction event type to analyze web requests, API calls, and background jobs. Group by transaction name, host, or other attributes. Calculate metrics like count, average duration, error rate, and throughput. Useful for identifying slow transactions, high-error endpoints, or traffic patterns.

Inputs: since, until, facets, appName, +4 more.

convert_time_period_to_epoch_msA

Convert human-readable time strings to epoch milliseconds. Supports relative times like '1 hour ago', '30 minutes ago', '7 days ago' and absolute times like ISO 8601 dates. Useful for constructing NRQL time ranges or comparing timestamps. This is a local utility that does not make API calls.

Inputs: timeString (required), timezone, referenceTime.

execute_nrql_queryB

Execute an arbitrary NRQL query against NewRelic. Returns raw query results with metadata. Use this for custom analytics, metrics, and data exploration.

Inputs: query (required), timeout.

generate_alert_insights_reportC

Generate a comprehensive alert insights report combining AI issues, error groups, and recent deployments. Provides actionable recommendations based on the current state of alerts and incidents.

Inputs: entityGuid, sinceDays.

get_dashboardA

Get a NewRelic dashboard with full page and widget details. Returns the dashboard structure including all pages, their widgets, and widget configurations. Use this to understand dashboard layout and widget queries.

Inputs: guid (required).

get_entityA

Retrieve detailed information about a NewRelic entity by its GUID. Returns entity metadata, tags, and type-specific metrics (APM throughput/error rate, Browser page views, etc).

Inputs: guid (required).

get_entity_error_groupsB

Get error groups from TransactionError events. Groups errors by class and message to identify the most frequent and impactful errors.

Inputs: entityGuid, transactionName, sinceDays, limit.

list_alert_conditionsB

List NewRelic NRQL alert conditions with optional filtering by policy, name, or enabled status. Returns condition details including NRQL query, thresholds, and configuration.

Inputs: policyId, nameFilter, enabledOnly, limit.

list_alert_policiesA

List NewRelic alert policies with optional name filtering. Returns policy ID, name, and incident preference settings.

Inputs: nameFilter, limit.

list_available_new_relic_accountsA

List all NewRelic accounts accessible with the current API key. Shows account IDs and names. Also indicates the currently configured account.

Inputs: no named parameters.

list_change_eventsC

List change events from NrChangeTracking. Includes deployments, configuration changes, and other tracked changes with version and user information.

Inputs: entityGuid, changeType, sinceDays, limit.

list_dashboardsA

List NewRelic dashboards with optional account filtering. Returns dashboard names and GUIDs. Use pagination cursor for large result sets. Useful for discovering available dashboards before fetching full details.

Inputs: accountId, cursor, limit.

list_entity_typesA

List all available entity types in NewRelic. Returns domain/type combinations like APM/APPLICATION, INFRA/HOST, BROWSER/APPLICATION, etc.

Inputs: no named parameters.

list_recent_issuesB

List recent AI-detected issues from NewRelic. Uses the experimental aiIssues API to fetch active and recent incidents with priority and state information.

Inputs: states, priorities, entityGuids, limit.

list_recent_logsB

List recent logs from NewRelic. Useful for getting an overview of recent log activity, filtering by level, or searching with custom conditions.

Inputs: limit, sinceMinutesAgo, level, whereClause.

list_synthetic_monitorsA

List NewRelic synthetic monitors with status and success rate information. Synthetic monitors are automated tests that check endpoint availability and performance. Filter by account or status. Returns monitor GUIDs, names, current status, and success rates.

Inputs: accountId, status, cursor, limit.

natural_language_to_nrql_queryB

Convert a natural language description into NRQL query suggestions. Returns matching query patterns, templates, and NRQL syntax guidance. Use this when you need help constructing NRQL queries for NewRelic.

Inputs: description (required), eventType, includeExamples.

query_logsA

Search logs by field and value with optional time range. Supports wildcards (%) for pattern matching. Use this for targeted log searches based on specific criteria.

Inputs: field (required), value (required), limit, startTime, +2 more.

search_entity_with_tagB

Search for NewRelic entities using tags and NerdGraph query syntax. Use this to find entities by environment, team, service name, or any custom tag.

Inputs: query, tagKey, tagValue, additionalFilters, +1 more.

search_incidentC

Search NewRelic incidents with filtering by state, priority, and entity. Uses NRQL to query the NrAiIncident event type.

Inputs: state, priority, entityGuid, sinceDays, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 24 tools

    Disambiguation4/5

    Most tools have distinct purposes, such as analyze_deployment_impact for deployment analysis and get_entity for entity retrieval. However, some overlap exists between analyze_entity_logs and query_logs, which both handle logs but with different scopes, potentially causing minor confusion. Overall, descriptions help clarify boundaries, but a few tools like list_recent_logs and query_logs might be ambiguous without careful reading.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout, such as analyze_deployment_impact, list_alert_conditions, and get_dashboard. All tools use snake_case without deviation, making them predictable and easy to parse. This consistency aids in agent selection and understanding of the toolset's structure.

    Tool Count4/5

    With 24 tools, the count is slightly high but reasonable for a comprehensive NewRelic monitoring and analytics server. It covers various aspects like alerts, dashboards, entities, logs, and queries, which justifies the breadth. However, it borders on feeling heavy, as some tools might be consolidated or specialized, but it remains well-scoped for the domain.

    Completeness5/5

    The toolset provides complete coverage for NewRelic's domain, including CRUD-like operations for entities, dashboards, alerts, and logs, along with advanced analytics and query capabilities. Tools like execute_nrql_query and natural_language_to_nrql_query support custom exploration, while list_related_entities and analyze_golden_metrics offer lifecycle insights. No obvious gaps are present, enabling agents to handle typical workflows without dead ends.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Run NRQL, NerdGraph, and REST v2 operations to query data, manage incidents, create synthetics, and annotate deployments — all from your MCP client.
      18
      1,164 npm
      15
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for New Relic workflows, enabling NRQL queries, NerdGraph access, entity lookup, logs, alerts, dashboards, and service levels.
      1,164 npm
      3
      MIT