newrelic-mcp-server
Provides tools for New Relic observability, including entity discovery, NRQL data access, alerting, incident response, performance analytics, and advanced analysis like SLO reports and dependency analysis.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@newrelic-mcp-servershow me recent errors in the last hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
New Relic MCP Server
A Model Context Protocol (MCP) server that provides New Relic observability tools for integration with Cursor and other MCP-compatible AI assistants.
Features
This MCP server provides comprehensive New Relic tools organized into the following categories:
Discovery (Entity and Account Management)
convert_time_period_to_epoch_ms- Convert time periods to epoch millisecondsget_entity- Fetch entities by GUID or search by namelist_related_entities- List related entities (1 hop away)list_available_new_relic_accounts- List all available accountslist_dashboards- List dashboards for an accountget_dashboard- Get dashboard detailslist_entity_types- List all entity typessearch_entity_with_tag- Search entities by tag
Data Access
execute_nrql_query- Execute NRQL queries against NRDBnatural_language_to_nrql_query- Convert natural language to NRQL and execute
Alerting
list_alert_conditions- List alert conditions for a policysearch_incident- Search alert incidentslist_alert_policies- List alert policieslist_recent_issues- List open issueslist_synthetic_monitors- List synthetic monitors
Incident Response
analyze_deployment_impact- Analyze deployment performance impactgenerate_alert_insights_report- Generate alert analysis reportgenerate_user_impact_report- Generate user impact reportget_entity_error_groups- Get error groups from Errors Inboxlist_change_events- List deployment and config changes
Performance Analytics
analyze_entity_logs- Analyze logs for patterns and anomaliesanalyze_golden_metrics- Analyze throughput, response time, error rateanalyze_kafka_metrics- Analyze Kafka consumer lag, throughputanalyze_threads- Analyze JVM thread metricsanalyze_transactions- Identify slow and error-prone transactionslist_garbage_collection_metrics- Get GC and memory metricslist_recent_logs- List recent log entries
Advanced Analysis
comprehensive_entity_analysis- Full entity health analysiscorrelate_metrics_and_events- Correlate metrics with eventsanalyze_service_dependencies- Analyze service dependenciesgenerate_slo_report- Generate SLO compliance report
Related MCP server: New Relic MCP Server
Prerequisites
Python 3.10+ (required by MCP SDK)
New Relic account with API access
New Relic User API Key
Installation
Clone the repository:
cd /Users/vickykumar/projects/newrelic-mcpCreate and activate a virtual environment (Python 3.10+ required):
python3.11 -m venv venv # or python3.10, python3.12, etc. source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtConfigure environment variables:
cp env.example .envEdit
.envand set your New Relic credentials:NEW_RELIC_API_KEY=NRAK-your-api-key-here NEW_RELIC_ACCOUNT_ID=your-account-id
Getting Your New Relic API Key
Go to New Relic API Keys
Click "Create a key"
Select "User" as the key type
Give it a name (e.g., "MCP Server")
Copy the key (starts with
NRAK-)
Usage with Cursor
Option 1: Add to Cursor MCP Settings (Recommended)
Open Cursor Settings (⌘/Ctrl + ,)
Search for "MCP" or navigate to Features → MCP Servers
Click "Add MCP Server" or edit your
~/.cursor/mcp.jsonAdd the following configuration:
{
"mcpServers": {
"newrelic": {
"command": "/Users/vickykumar/projects/newrelic-mcp/venv/bin/python",
"args": ["/Users/vickykumar/projects/newrelic-mcp/server.py"],
"env": {
"NEW_RELIC_API_KEY": "NRAK-your-api-key",
"NEW_RELIC_ACCOUNT_ID": "your-account-id",
"NEW_RELIC_REGION": "US"
}
}
}
}Note: Update the paths if your project is located elsewhere.
Option 2: Using the startup script
Create a wrapper script for easier configuration:
#!/bin/bash
# save as: run-newrelic-mcp.sh
export NEW_RELIC_API_KEY="NRAK-your-api-key"
export NEW_RELIC_ACCOUNT_ID="your-account-id"
cd /Users/vickykumar/projects/newrelic-mcp
./venv/bin/python server.pyThen configure Cursor to use this script:
{
"mcpServers": {
"newrelic": {
"command": "/Users/vickykumar/projects/newrelic-mcp/run-newrelic-mcp.sh",
"args": []
}
}
}Example Queries in Cursor
Once configured, you can ask the AI assistant to:
Discovery
"List all my New Relic accounts"
"Find all APM applications with the tag environment=production"
"Show me the entities related to my payment service"
Data Access
"Execute this NRQL query: SELECT count(*) FROM Transaction SINCE 1 hour ago"
"Show me errors from the last 30 minutes"
"What's the throughput trend for my API?"
Alerting
"List all open incidents"
"Show me alert policies for my account"
"What synthetic monitors are failing?"
Incident Response
"Analyze the impact of the last deployment on my checkout service"
"Generate an alert insights report for issue ID xyz123"
"What error groups are affecting my service?"
Performance Analytics
"Analyze the golden metrics for entity ABC123"
"Show me slow transactions in my payment service"
"What are the error patterns in my application logs?"
Advanced Analysis
"Run a comprehensive health analysis on my API service"
"Generate an SLO report for my checkout service with 99.9% target"
"Correlate metrics with recent deployments"
Testing the Server
You can test the server manually:
# Activate virtual environment
source venv/bin/activate
# Set environment variables
export NEW_RELIC_API_KEY="NRAK-your-key"
export NEW_RELIC_ACCOUNT_ID="your-account-id"
# Run the server (it will wait for MCP protocol messages on stdin)
python server.pyTroubleshooting
Server not starting
Check that Python 3.9+ is installed
Verify the virtual environment is activated
Ensure all dependencies are installed
Authentication errors
Verify your API key is correct and starts with
NRAK-Check that the account ID is correct
Ensure the API key has the necessary permissions
No data returned
Verify the entity GUID is correct
Check the time window (some queries default to 60 minutes)
Ensure your account has data for the requested time period
Cursor not finding the server
Check the path in your MCP configuration
Ensure the server script is executable
Look at Cursor logs for MCP-related errors
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Your New Relic User API Key |
| Yes | - | Default New Relic Account ID |
| No |
| Region: |
| No |
| Max lookback period (7 days) |
| No |
| Max results per query |
| No |
| Default result limit |
Architecture
newrelic-mcp/
├── server.py # Main MCP server entry point
├── requirements.txt # Python dependencies
├── .env # Environment configuration
├── .env.example # Example configuration
└── app/
├── __init__.py
├── config.py # Configuration management
├── nr_client.py # New Relic GraphQL client
└── tools/
├── __init__.py
├── discovery.py # Entity/account tools
├── data_access.py # NRQL query tools
├── alerting.py # Alert/incident tools
├── incident_response.py # Incident analysis
├── performance_analytics.py # Performance tools
└── advanced_analysis.py # Advanced analysisLicense
MIT License - See LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vickykr26941/newrelic-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server