A Model Context Protocol (MCP) server for querying New Relic errors and metrics. This server provides tools that Claude can use to monitor and analyze application performance and errors.
- Error Querying: Query application errors with customizable time ranges and filters
- Custom NRQL Queries: Execute any NRQL query directly
- Performance Metrics: Query response times, throughput, error rates, and Apdex scores
- Easy Integration: Works seamlessly with Claude Desktop and other MCP clients
Install globally via npm:
npm install -g mcp-new-relic
Or install locally in a project:
npm install mcp-new-relic
Pull from Docker Hub:
docker pull kivanio/mcp-new-relic
Or build locally:
git clone https://github.com/kivanio/mcp-new-relic.git
cd mcp-new-relic
docker build -t mcp-new-relic .
- Clone the repository:
git clone https://github.com/kivanio/mcp-new-relic.git cd mcp-new-relic
- Install dependencies:
npm install
- Build the TypeScript code:
npm run build
-
Copy
.env.example
to.env
:cp .env.example .env
-
Edit
.env
with your New Relic credentials:NEW_RELIC_API_KEY=your-api-key-here NEW_RELIC_ACCOUNT_ID=your-account-id-here NEW_RELIC_REGION=US # or EU
To get your New Relic API key:
- Log in to New Relic
- Go to Account Settings → API Keys
- Create a new User Key (not an Ingest Key)
Add the server to your Claude Desktop configuration. The configuration depends on how you installed the package:
- Open Claude Desktop settings
- Go to the "Developer" tab
- Add to your MCP servers configuration:
{
"mcpServers": {
"new-relic": {
"command": "mcp-new-relic",
"env": {
"NEW_RELIC_API_KEY": "your-api-key",
"NEW_RELIC_ACCOUNT_ID": "your-account-id",
"NEW_RELIC_REGION": "US"
}
}
}
}
{
"mcpServers": {
"new-relic": {
"command": "node",
"args": ["/path/to/mcp-new-relic/dist/index.js"],
"env": {
"NEW_RELIC_API_KEY": "your-api-key",
"NEW_RELIC_ACCOUNT_ID": "your-account-id",
"NEW_RELIC_REGION": "US"
}
}
}
}
{
"mcpServers": {
"new-relic": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--env-file",
"/path/to/.env",
"kivanio/mcp-new-relic"
]
}
}
}
If you have a .env
file configured, you can omit the env
section:
{
"mcpServers": {
"new-relic": {
"command": "mcp-new-relic"
}
}
}
Query application errors from New Relic.
Parameters:
-
timeRange
(optional): Time range for the query (default: "4 hours ago")- Examples: "1 hour ago", "24 hours ago", "7 days ago"
-
appName
(optional): Application name pattern (default: "%kivanio%")- Supports SQL LIKE patterns
-
limit
(optional): Maximum number of error types to return (default: 20, max: 100)
Example usage in Claude:
Use the New Relic tool to check for errors in the last 24 hours
Execute a custom NRQL query.
Parameters:
-
query
(required): The NRQL query to execute
Example usage in Claude:
Run this NRQL query: SELECT count(*) FROM Transaction WHERE appName = 'kivanio-production' SINCE 1 hour ago
Query application performance metrics.
Parameters:
-
timeRange
(optional): Time range for the query (default: "1 hour ago") -
appName
(optional): Application name pattern (default: "%kivanio%") -
metrics
(optional): Array of metrics to query (default: ["response_time", "throughput", "error_rate"])- Available metrics: "response_time", "throughput", "error_rate", "apdex"
Example usage in Claude:
Check the performance metrics for the last 6 hours
npm run dev
npm run build
mcp-new-relic/
├── src/
│ └── index.ts # Main server implementation
├── dist/ # Compiled JavaScript (generated)
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── .env.example # Example environment variables
└── README.md # This file
- Authentication errors: Ensure your API key is valid and has the necessary permissions
- No results returned: Check that your application name pattern matches your New Relic app names
- Connection errors: Verify your region setting (US vs EU) matches your New Relic account
To see detailed logs, run the server with debug output:
DEBUG=* node dist/index.js
MIT