Odel
New Relic MCP

New Relic MCP

Local
@karldaneGoUpdated 2mo ago

New Relic MCP server with 55 tools for APM, alerts, dashboards, synthetics, workflows, and more.

New Relic MCP Server

A Go-native MCP (Model Context Protocol) server for the New Relic observability platform, providing comprehensive access to APM, infrastructure, logs, traces, alerts, dashboards, synthetics, workflows, notifications, service levels, tags, entities, and workloads — all through a single GraphQL endpoint.

Overview

  • 55 registered MCP tools covering the full NerdGraph API surface
  • Safety-first design: every tool carries EnforcerProfile metadata (risk, impact, resource cost, PII flag, idempotency) for automated policy enforcement via MCP Bridge
  • Write protection: all mutation tools gated behind a -write-enabled flag; disabled by default
  • Multi-region: US and EU data center support (NEWRELIC_REGION=us|eu)
  • TDD-built: 80%+ test coverage across all tools

Registries

This server is published on the following MCP registries:

API Architecture

All tools communicate with a single NerdGraph endpoint:

RegionEndpoint
US (default)https://api.newrelic.com/graphql
EUhttps://api.eu.newrelic.com/graphql

Internal query helpers determine the response-scope:

HelperReturnsUsed For
actorGraphQuerydata.actor.*Entity queries, cross-account NRQL
nerdGraphQuerydata.actor.account.*Account-scoped queries (alerts, workflows, etc.)
rawGraphQuerydata.<mutationName>All mutations
executeNRQLParsed NRQL resultsNRQL-based tools

Tools

NRQL Querying

ToolDescriptionGraphQL OperationRiskImpact
nrql_queryExecute arbitrary NRQL queriesactor.account.nrqlMedRead

APM & Applications

ToolDescriptionGraphQL OperationRiskImpact
list_applicationsList all APM-monitored applicationsactor.entitySearch (domain:APM, type:APPLICATION)LowRead
get_apm_metricsGet APM performance metricsactor.account.nrql (FROM APMApplication)LowRead
get_application_metricsGet detailed metrics for a specific appactor.account.nrql (FROM APMApplication)LowRead
query_tracesQuery distributed tracesactor.account.nrql (FROM Transaction)LowRead
get_transaction_tracesGet transaction trace detailsNRQL via executeNRQLLowRead
get_trace_detailsGet specific trace detailsNRQL via executeNRQLLowRead

Alert Policies & Conditions

ToolDescriptionGraphQL OperationRiskImpact
list_alertsList all alert policiesactor.account.alerts.policiesSearchLowRead
get_alert_policyGet a single alert policy by IDactor.account.alerts.policyLowRead
get_alert_conditionsGet conditions for a policyactor.account.alerts.alertConditionsSearchLowRead
get_alert_violationsGet active alert violationsactor.account.nrql (NRQL alert query)LowRead
list_nrql_alert_conditionsList NRQL conditions for a policyactor.account.alerts.nrqlConditionsSearchLowRead
create_alert_policyCreate a new alert policyalertsPolicyCreateLowWrite
update_alert_policyUpdate an alert policyalertsPolicyUpdateLowWrite
delete_alert_policyDelete an alert policyalertsPolicyDeleteHighWrite
create_alert_conditionCreate an NRQL alert conditionalertsNrqlConditionCreateMedWrite
acknowledge_alert_violationAcknowledge an alert violationalertsViolationAcknowledgeMedWrite

Synthetic Monitoring

ToolDescriptionGraphQL OperationRiskImpact
list_synthetic_monitorsList all synthetic monitorsactor.entitySearch (domain:SYNTH, type:MONITOR)LowRead
get_synthetic_monitorGet a synthetic monitor by GUIDactor.entity (SyntheticMonitorEntityOutline)LowRead
list_private_locationsList private locationsactor.entitySearch (domain:SYNTH, type:PRIVATE_LOCATION)LowRead
create_ping_monitorCreate a simple ping monitorsyntheticsCreateSimpleMonitorLowWrite
delete_synthetic_monitorDelete a synthetic monitorsyntheticsDeleteMonitorMedWrite

Dashboards

ToolDescriptionGraphQL OperationRiskImpact
list_dashboardsList all dashboardsactor.entitySearch (domain:DASH, type:DASHBOARD)LowRead
get_dashboardGet full dashboard configuration by GUIDactor.entity (DashboardEntity)LowRead
get_dashboard_dataGet dashboard widget dataactor.entity (DashboardEntity)LowRead
create_dashboardCreate a new dashboarddashboardCreateLowWrite
update_dashboardUpdate an existing dashboarddashboardUpdateLowWrite
delete_dashboardDelete a dashboarddashboardDeleteMedWrite
add_dashboard_widgetAdd a widget to a dashboarddashboardUpdateMedWrite

Logs

ToolDescriptionGraphQL OperationRiskImpact
search_logsSearch logs with Lucene syntaxactor.account.nrql (FROM Log)MedRead
tail_logsStream recent log entriesactor.account.nrql (FROM Log)MedRead

Infrastructure

ToolDescriptionGraphQL OperationRiskImpact
get_infrastructure_metricsGet host/container metricsactor.account.nrql (FROM SystemSample)LowRead

Alert Workflows (aiWorkflows)

ToolDescriptionGraphQL OperationRiskImpact
list_workflowsList alert notification workflowsactor.account.aiWorkflows.workflowsLowRead
get_workflowGet a workflow by IDactor.account.aiWorkflows.workflows (filter)LowRead
create_workflowCreate a new alert workflowaiWorkflowsCreateWorkflowLowWrite
update_workflowUpdate a workflowaiWorkflowsUpdateWorkflowLowWrite
delete_workflowDelete a workflowaiWorkflowsDeleteWorkflowHighWrite

Notification Channels & Destinations (aiNotifications)

ToolDescriptionGraphQL OperationRiskImpact
list_notification_channelsList all notification channelsactor.account.aiNotifications.channelsLowRead
list_destinationsList notification destinationsactor.account.aiNotifications.destinationsLowRead
create_slack_channelCreate a Slack notification channelaiNotificationsCreateChannel (type:SLACK)LowWrite
create_email_channelCreate an email notification channelaiNotificationsCreateChannel (type:EMAIL)LowWrite
delete_notification_channelDelete a notification channelaiNotificationsDeleteChannelHighWrite

Service Levels

ToolDescriptionGraphQL OperationRiskImpact
list_service_levelsList SLIs for an entityactor.entity (... EntityInterfaceWithServiceLevel)LowRead
create_service_levelCreate an SLI with SLOserviceLevelCreateMedWrite
update_service_levelUpdate an SLI's SLO targetserviceLevelUpdateLowWrite

Tag Management (tagging)

ToolDescriptionGraphQL OperationRiskImpact
get_entity_tagsGet all tags for an entityactor.entity.tagsLowRead
add_entity_tagsAdd tags to an entitytaggingAddTagsToEntityLowWrite
remove_entity_tagsRemove tags from an entitytaggingDeleteTagFromEntityMedWrite
replace_entity_tagsReplace all tags on an entitytaggingReplaceTagsOnEntityMedWrite

Entity Operations

ToolDescriptionGraphQL OperationRiskImpact
search_entitiesAdvanced entity searchactor.entitySearch (queryBuilder)LowRead
delete_entityDelete entities by GUIDentityDeleteHighWrite

Cross-Account NRQL

ToolDescriptionGraphQL OperationRiskImpact
cross_account_nrqlRun NRQL across multiple accountsactor.nrql (multi-account)MedRead

Workloads

ToolDescriptionGraphQL OperationRiskImpact
list_workloadsList all workloads for an accountactor.account.workload.workloadsLowRead
get_workloadGet a workload by GUIDactor.entity (WorkloadEntity)LowRead

NerdGraph Reference

All tools access the New Relic NerdGraph API. The following NerdGraph query/mutation names are used:

GraphQL OperationDocumentation
actor.entityEntity
actor.entitySearchEntity Search
actor.account.nrqlNRQL
alertsPolicyCreate / Update / DeleteAlert Policies
alertsNrqlConditionCreateNRQL Alert Conditions
syntheticsCreateSimpleMonitorSynthetic Monitoring
dashboardCreate / Update / DeleteDashboards
aiWorkflowsCreate / Update / DeleteWorkflowWorkflows
aiNotificationsCreateChannel / DeleteChannelNotification Channels
serviceLevelCreate / UpdateService Levels
taggingAddTagsToEntity / DeleteTagFromEntity / ReplaceTagsOnEntityTags
entityDeleteEntity Deletion

Installation

Prerequisites

  • Go 1.22 or later
  • New Relic account with API access

Building from Source

git clone https://github.com/karldane/newrelic-mcp.git
cd newrelic-mcp
make

Build Options

make              # Download deps and build (default)
make deps         # Download dependencies only
make build        # Build binary only (assumes deps exist)
make build-all    # Build for Linux, macOS, and Windows
make test         # Run tests
make clean        # Remove build artifacts
make install      # Install to GOPATH/bin
make help         # Show all options

Configuration

Environment Variables

VariableDescriptionRequiredDefault
NEWRELIC_API_KEYNew Relic API key (User or Admin)Yes-
NEWRELIC_REGIONData center region (us or eu)Nous

Obtaining an API Key

  1. Log in to your New Relic account
  2. Go to API Keys in the account settings
  3. Create a User Key (for read-only) or Admin Key (for write operations)
  4. Copy the key and set it as NEWRELIC_API_KEY

Usage

Basic Usage (Read-Only)

export NEWRELIC_API_KEY="your-api-key"
./newrelic-mcp

Enable Write Operations

Write operations require the -write-enabled flag:

export NEWRELIC_API_KEY="your-api-key"
./newrelic-mcp -write-enabled

Write tools are disabled by default. When -write-enabled is set, all mutations (create, update, delete, acknowledge) become available. Each write tool carries an EnforcerProfile with ImpactWrite so MCP Bridge operators can enforce policies independently.

Tools List

Query the full tool list via MCP:

{
  "tool": "tools/list"
}

Safety Features

EnforcerProfile Metadata

Every tool declares its safety profile:

FieldDescriptionValues
RiskLevelPotential impact of misuselow, med, high, critical
ImpactScopeWhat the tool affectsread, write
ResourceCostAPI call weight (1-10)integer
PIIExposureWhether tool returns sensitive datatrue / false
IdempotentWhether retries are safetrue / false

This metadata enables automated policy enforcement by MCP Bridge without hardcoding tool lists.

Risk Classification

  • Low Risk: Read-only queries, log searches, metric retrieval, listing operations
  • Medium Risk: Creating non-destructive resources (alert conditions, service levels, dashboards, channels), acknowledging alerts
  • High Risk: Deleting resources (policies, entities, dashboards, workflows, channels)

Write Protection

Write tools are disabled by default and require:

  1. Valid New Relic API key with appropriate permissions
  2. -write-enabled command-line flag

Examples

Query Application Performance

{
  "tool": "nrql_query",
  "arguments": {
    "query": "SELECT average(duration) FROM Transaction WHERE appName = 'MyApp' TIMESERIES SINCE 1 hour ago"
  }
}

List Active Alerts

{
  "tool": "get_alert_violations",
  "arguments": {}
}

Create a Ping Monitor

{
  "tool": "create_ping_monitor",
  "arguments": {
    "name": "My Monitor",
    "uri": "https://example.com/health",
    "locations": "US_EAST_1,US_WEST_1",
    "period": "EVERY_5_MINUTES"
  }
}

Cross-Account NRQL Query

{
  "tool": "cross_account_nrql",
  "arguments": {
    "query": "SELECT count(*) FROM Transaction",
    "account_ids": "1234567,7654321"
  }
}

Architecture

The server wraps the New Relic GraphQL client and registers each tool through the MCP Framework. The tools map 1:1 to NerdGraph operations — no REST API calls are made.

Client (MCP Host)
    │
    ▼
newrelic-mcp (MCP Server)
    │
    ├── actorGraphQuery  →  actor.*  (entities, entitySearch, cross-account NRQL)
    ├── nerdGraphQuery   →  actor.account.*  (alerts, workflows, notifications, workloads)
    ├── rawGraphQuery    →  mutation results
    └── executeNRQL      →  actor.account.nrql  (NRQL query tools)
         │
         ▼
New Relic NerdGraph (api.newrelic.com/graphql)

Testing

go test ./newrelic -v

Tests cover:

  • Happy path (mock NerdGraph responses)
  • Empty/no-results responses
  • Missing required parameters
  • Write-enabled / write-disabled gating
  • API error responses
  • Unexpected response format

License

This project is licensed under the Functional Source License, Version 1.1, ALv2 Future License.

Copyright 2026 Karl Dane

See LICENSE file for full terms.

References

Tool Inventory

The server registers 55 tools total:

  • 6 NRQL / APM / Trace tools: nrql_query, list_applications, get_apm_metrics, get_application_metrics, query_traces, get_transaction_traces, get_trace_details
  • 10 Alert tools: list_alerts, get_alert_policy, get_alert_conditions, get_alert_violations, list_nrql_alert_conditions, create_alert_policy, update_alert_policy, delete_alert_policy, create_alert_condition, acknowledge_alert_violation
  • 5 Synthetic Monitoring tools: list_synthetic_monitors, get_synthetic_monitor, list_private_locations, create_ping_monitor, delete_synthetic_monitor
  • 7 Dashboard tools: list_dashboards, get_dashboard, get_dashboard_data, create_dashboard, update_dashboard, delete_dashboard, add_dashboard_widget
  • 2 Log tools: search_logs, tail_logs
  • 1 Infrastructure tool: get_infrastructure_metrics
  • 5 Workflow tools: list_workflows, get_workflow, create_workflow, update_workflow, delete_workflow
  • 5 Notification tools: list_notification_channels, list_destinations, create_slack_channel, create_email_channel, delete_notification_channel
  • 3 Service Level tools: list_service_levels, create_service_level, update_service_level
  • 4 Tag tools: get_entity_tags, add_entity_tags, remove_entity_tags, replace_entity_tags
  • 2 Entity tools: search_entities, delete_entity
  • 1 Cross-account NRQL tool: cross_account_nrql
  • 2 Workload tools: list_workloads, get_workload