Provides comprehensive access to New Relic's monitoring and observability platform, enabling management of APM applications, execution of NRQL queries, alert policy management, synthetic monitoring, dashboard access, infrastructure monitoring, deployment tracking, and user management through both REST APIs and NerdGraph GraphQL interface.
New Relic MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to New Relic APIs, enabling AI assistants and other tools to interact with New Relic monitoring and observability data.
Features
APM Application Management: List and retrieve application details, metrics, and metric data
NRQL Queries: Execute NRQL queries via NerdGraph
Log Parsing Rules: Intelligently create, manage, and test GROK patterns for log parsing
Alert Policies: List and manage alert policies
Synthetic Monitoring: Access synthetic monitor information
Dashboards: List and retrieve dashboard configurations
Entity Search: Search across all New Relic entities
Infrastructure: Monitor servers and infrastructure components
Deployments: Track and create application deployments
User Management: List and manage users
NerdGraph: Execute custom GraphQL queries
Installation
Option 1: Install from PyPI (Recommended)
Option 2: Install from Source
Configuration
Secure Credential Setup (Recommended for macOS)
For enhanced security on macOS, use the built-in keychain storage instead of environment variables:
This will securely store your API key and account ID in the macOS Keychain, eliminating the need to store sensitive credentials in plain text files.
Environment Variables (Alternative)
If you prefer environment variables or are not on macOS, you can use:
Note: The server will automatically prefer keychain storage over environment variables when both are available.
Getting Your API Key
Log in to New Relic
Navigate to the API Keys page
Create a new User API key (starts with
NRAK
)Copy the key and set it as the
NEWRELIC_API_KEY
environment variable
Usage
With Claude Desktop
Option 1: Using Secure Keychain (Recommended for macOS)
After setting up credentials with newrelic-mcp-setup
, add the following to your Claude Desktop configuration (claude_desktop_config.json
):
Option 2: Using Environment Variables (Less Secure)
Security Note: Option 1 is strongly recommended as it keeps your sensitive API key out of configuration files.
With Other MCP Clients
Available Tools
Application Management
list_applications
- List all APM applicationsget_application
- Get details for a specific applicationget_application_metrics
- Get available metrics for an applicationget_application_metric_data
- Get metric data with time range filtering
Querying
query_nrql
- Execute NRQL queries for data analysisnerdgraph_query
- Execute custom NerdGraph GraphQL queries
Monitoring
list_alert_policies
- List all alert policiesget_alert_policy
- Get specific alert policy detailslist_synthetic_monitors
- List synthetic monitorsget_synthetic_monitor
- Get synthetic monitor details
Dashboards & Visualization
list_dashboards
- List all dashboardsget_dashboard
- Get dashboard configuration and widgets
Infrastructure
list_servers
- List monitored serversget_server
- Get server detailssearch_entities
- Search across all entity types
Deployment Tracking
list_deployments
- List application deploymentscreate_deployment
- Record new deployments
User Management
list_users
- List account usersget_user
- Get user details
Log Parsing Rules
list_log_parsing_rules
- List all log parsing rules for an accountcreate_log_parsing_rule
- Create a new log parsing rule with GROK pattern and NRQL filterupdate_log_parsing_rule
- Update an existing log parsing ruledelete_log_parsing_rule
- Delete a log parsing ruletest_log_parsing_rule
- Test a GROK pattern against sample logs (generates pattern if not provided)generate_log_parsing_rule
- Intelligently generate GROK patterns from log samples or NRQL queries
Credential Management
manage_credentials
- Securely manage API credentials in keychainaction="status"
- Show current credential storage statusaction="store"
- Store new credentials securely (requiresapi_key
parameter)action="delete"
- Remove all stored credentials
Examples
Query Application Performance
Execute NRQL Query
Search Entities
Create Deployment Marker
Log Parsing Rules
Generate GROK Pattern from Log Samples
Create Log Parsing Rule
Generate from Live Logs
Test Parsing Rules
Manage Parsing Rules
Development
Dependencies
fastmcp
- FastMCP framework for building MCP servershttpx
- Async HTTP client for API requestspython-dotenv
- Environment variable management (optional)
API Rate Limits
Be aware of New Relic's API rate limits:
REST API v2: Subject to rate limiting per account
NerdGraph: Higher rate limits but still enforced
Synthetic Monitoring API: 3 requests per second
Security
Use keychain storage on macOS: Run
newrelic-mcp-setup
to store credentials securely in the system keychainNever commit API keys to version control
Avoid storing sensitive credentials in plain text configuration files
API keys should have minimal required permissions
Consider using separate keys for different environments
The server automatically prioritizes keychain storage over environment variables for enhanced security
Troubleshooting
Authentication Errors
Ensure your API key starts with
NRAK
Verify the key has the necessary permissions
Check if you're using the correct region (US/EU)
If using keychain storage, verify credentials are stored with
manage_credentials
action="status"Try re-running
newrelic-mcp-setup
if keychain access fails
Rate Limiting
If you encounter rate limit errors:
Implement exponential backoff in your client code
Cache frequently accessed data
Batch operations where possible
Connection Issues
Verify network connectivity
Check firewall rules for API endpoints
Ensure correct base URLs for your region
Python Environment
Ensure Python 3.10+ is installed
Install dependencies with
pip install -r requirements.txt
Check that the script is executable:
chmod +x newrelic_mcp_server.py
Command Not Found Issues
If you encounter "command not found" errors after installation:
Try using the full path to the installed package:
Linux/macOS (user install):
~/.local/bin/newrelic-mcp-server
macOS (Python framework):
/Library/Frameworks/Python.framework/Versions/3.13/bin/newrelic-mcp-server
System-wide:
/usr/local/bin/newrelic-mcp-server
Or add the installation directory to your PATH:
export PATH="$HOME/.local/bin:$PATH"
In Claude Desktop config, use the full path if the command isn't found:
{ "mcpServers": { "newrelic": { "command": "/Library/Frameworks/Python.framework/Versions/3.13/bin/newrelic-mcp-server", "env": { "NEWRELIC_API_KEY": "your-api-key-here", "NEWRELIC_REGION": "US", "NEWRELIC_ACCOUNT_ID": "your-account-id" } } } }
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Support
For issues and questions:
GitHub Issues: Create an issue
New Relic Documentation: docs.newrelic.com
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI assistants to interact with New Relic monitoring and observability data through programmatic access to New Relic APIs. Supports APM management, NRQL queries, alert policies, synthetic monitoring, dashboards, infrastructure monitoring, and deployment tracking.
Related MCP Servers
- -securityFlicense-qualityEnables natural language interaction with the Avalanche blockchain through AI assistants, allowing users to execute Avalanche CLI commands and AvalancheJS API operations without technical knowledge.Last updated -1
- -securityAlicense-qualityAllows AI models to interact with Obsidian notes through the Local REST API, enabling creation, reading, updating, searching of notes, and Git-based automatic backups.Last updated -237MIT License
- -securityFlicense-qualityEnables AI assistants to monitor and interact with industrial systems, providing real-time system health monitoring, operational data analytics, and equipment maintenance tracking. Built with Next.js and designed for industrial automation environments.Last updated -
- -securityAlicense-qualityEnables interaction with the Observe platform through OPAL query execution, worksheet data export, dataset management, and monitor operations. Provides AI-powered troubleshooting assistance through vector search across documentation and specialized runbooks.Last updated -1GPL 3.0