nr-mcp-server
v1.0.1
Published
New Relic MCP server for AI assistants - Monitor applications, infrastructure, and run NRQL queries
Downloads
6
Maintainers
Readme
New Relic MCP Server
A Model Context Protocol (MCP) server that integrates New Relic observability data with AI assistants like GitHub Copilot in VS Code.
Features
- Query Applications: Get list of monitored applications
- Application Metrics: Retrieve performance metrics for specific applications
- Alerts & Incidents: Monitor alerts and incident status
- NRQL Queries: Execute custom NRQL queries for advanced analysis
- Infrastructure Monitoring: Get host and infrastructure metrics
- Synthetics: Monitor synthetic test results
Installation
\\ash npm install -g nr-mcp-server \\
Quick Start
Get your New Relic credentials:
- API Key: Go to New Relic API Keys Create User API Key
- Account ID: Found in your New Relic account settings
Configure VS Code MCP (%APPDATA%\Code\User\globalStorage\github.copilot-chat\mcp.json): \\json { "mcpServers": { "newrelic": { "command": "nr-mcp-server", "env": { "NEW_RELIC_API_KEY": "your_api_key", "NEW_RELIC_ACCOUNT_ID": "your_account_id" } } } } \\
Restart VS Code and start using New Relic data in GitHub Copilot!
Usage Examples
Get Applications
\
@newrelic get applications
\\
Query Application Metrics
\
@newrelic get metrics for application "MyApp" since 1 hour ago
\\
Execute NRQL Queries
\
@newrelic run NRQL: SELECT count(*) FROM TransactionError SINCE 3 days ago
\\
Get Alerts
\
@newrelic get alerts with status "open"
\\
Available Tools
| Tool | Description | Parameters |
|------|-------------|------------|
| \get_applications\ | List all monitored applications | None |
| \get_application_metrics\ | Get metrics for a specific application | \pplicationId, \metricNames?, \rom?, \ o?\ |
| \get_alerts\ | Get alerts and incidents | \status?\ (open/closed/all) |
|
un_nrql_query\ | Execute custom NRQL queries | \query, \ imeout?\ |
| \get_infrastructure_hosts\ | Get infrastructure host metrics | \ilter?\ |
| \get_synthetics_monitors\ | Get synthetic monitor results | None |
Example NRQL Queries
Transaction Errors Analysis
\\sql SELECT count(*) FROM TransactionError SINCE 3 days ago FACET \error.class\ LIMIT 10 \\
Application Performance
\\sql SELECT average(duration), count(*) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago \\
Infrastructure Health
\\sql SELECT latest(cpuPercent), latest(memoryUsedPercent) FROM SystemSample FACET hostname LIMIT 100 \\
Troubleshooting
Common Issues
- SSL Certificate Issues: The server includes SSL certificate bypass for corporate environments
- MCP Integration Fails: Ensure VS Code is reloaded after updating MCP configuration
- API Key Invalid: Verify your API key has the correct permissions
License
MIT License - see LICENSE file for details.
Support
For issues and questions, please check:
