nr-mcp
Allows AI agents to query New Relic for debugging incidents, using API key, account ID, and region.
Click on "Deploy 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., "@nr-mcpcheck recent high-severity incidents in my account"
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.
nr-mcp: New Relic MCP Server
MCP server allowing AI agents to query New Relic for debugging incidents.
For Users: How to use nr-mcp with your AI assistants
For Developers: How to contribute to nr-mcp
Documentation: Detailed documentation on tools and resources
For Users
This section is for users who want to use the nr-mcp server with their AI assistants.
For detailed information on available tools and resources, see the Documentation section.
Prerequisites
New Relic account with:
API key
Account ID
Region (US or EU)
Related MCP server: triage-agent-mcp
Quick Start
To connect an AI assistant to nr-mcp, add the following configuration to your MCP client setup:
Docker Connection
{
"mcpServers": {
"newrelic": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"NEW_RELIC_API_KEY",
"-e",
"NEW_RELIC_ACCOUNT_ID",
"-e",
"NEW_RELIC_REGION",
"danielng123/nr-mcp:latest"
],
"env": {
"NEW_RELIC_API_KEY": "<YOUR_API_KEY>",
"NEW_RELIC_ACCOUNT_ID": "<YOUR_ACCOUNT_ID>",
"NEW_RELIC_REGION": "US"
}
}
}
}For Developers
This section is for developers who want to contribute to the nr-mcp project.
Development Setup
# Clone the repository
git clone https://github.com/ducduyn31/nr-mcp.git
cd nr-mcp
# Install dependencies
pnpm install
# Build the project
pnpm buildThe MCP Inspector is a powerful tool for debugging and testing MCP servers and clients. We've added a streamlined development workflow that automatically watches for file changes, rebuilds the project, and runs the inspector:
# Start the development workflow
pnpm devThis command:
Watches the
srcdirectory for changes to.tsfilesAutomatically rebuilds the project when changes are detected
Runs the MCP Inspector in parallel
Manual Testing
You can also run these commands separately:
# Watch for file changes and rebuild
pnpm watch
# Start the inspector
pnpm inspectorUsing the Inspector
Once the inspector is running:
Open the web interface (typically at http://localhost:5173)
Select "Connect to Server"
Choose "Stdio" as the transport type
Enter the command to start your server:
node dist/index.jsClick "Connect"
After connecting, you can:
Browse available tools
Make test calls with custom parameters
View responses and any errors
Record and replay testing sessions
Debugging Tips
Use the inspector to compare expected vs. actual responses
Monitor the full request/response cycle for each tool call
Check for proper error handling by intentionally sending invalid inputs
Verify that your tools adhere to their declared schemas
Development
# Create a new tool
pnpm create-tool
# Lint code
pnpm lint
# Format code
pnpm formatLicense
MIT
Documentation
Tools Documentation: Detailed information on available tools and their parameters
Available Tools
2 toolsquery-logsB
Query New Relic logs by field and value with customizable parameters
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of logs to return (default: 100) | |
| queryField | No | Field name to query on (default: 'trace.id') | |
| queryValue | Yes | Value to search for in the specified field | |
| endTimeRange | No | End time range in minutes to look back from now (default: 0, meaning now) | |
| endTimestamp | No | End timestamp in milliseconds since epoch (null means now) | |
| selectFields | No | Fields to select in the query (default: timestamp, message, tag, userAgent) | |
| startTimeRange | No | Start time range in minutes to look back from now (default: 60) | |
| startTimestamp | No | Start timestamp in milliseconds since epoch | |
| additionalConditions | No | Additional NRQL where clause conditions |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden of behavioral disclosure. It only says 'query', which implies a read operation, but it does not explicitly state read-only behavior, authentication needs, rate limits, or potential costs. The lack of detail could lead to misuse for a data retrieval tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the core action ('Query New Relic logs'). It is concise with no unnecessary words. However, it could be slightly more informative without losing conciseness, such as specifying the default time range.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 9 parameters (time ranges, conditions, selection) and no output schema, the description is too generic. It fails to explain behavior like default time windows, how 'queryField' and 'queryValue' interact, or what the return format looks like. This is insufficient given the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so each parameter is already documented. The description adds no extra meaning beyond the schema, merely saying 'by field and value with customizable parameters'. This meets the baseline for high-coverage schemas but adds no additional value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it queries New Relic logs by field and value, which is a specific verb-resource combination. It distinguishes itself from the sibling 'run-nrql-query' by implying a simpler, field-specific query rather than a general NRQL query.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus the sibling 'run-nrql-query'. It does not mention when not to use it or any prerequisites, leaving the agent without decision support for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run-nrql-queryC
Execute a NRQL query and return the results as data points
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | NRQL query to execute | |
| timeout | No | Query timeout in milliseconds (default: 30000) | |
| valueKey | No | The key to extract values from for visualization (required if visualize is true) | |
| visualize | No | Whether to visualize the results as a Mermaid chart (default: false) | |
| chartTitle | No | The title for the chart (default: 'NRQL Query Results') | |
| yAxisLabel | No | The label for the y-axis (default: 'Value') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It fails to mention that executing a query may incur costs, require specific permissions, or have rate limits. It does not explain what happens on errors or the structure of returned data points. The description is too brief for a tool with no annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no filler, which is efficient. However, it could be slightly more descriptive without adding much length, balancing conciseness with completeness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 6 parameters, no output schema, and no annotations, the description is insufficient. It does not explain the purpose of the charting parameters or how the visualization feature works. The output format is not described, leaving the agent to guess how to handle results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the parameters are clearly documented in the schema. The description adds no additional semantics beyond 'return the results as data points', which is generic. Baseline 3 is appropriate as the schema already does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the verb 'Execute' and resource 'NRQL query', which clarifies the tool's function. However, it does not distinguish it from the sibling tool 'query-logs', as both involve querying data. The description is clear but lacks specificity about the type of data returned.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus the sibling 'query-logs'. It does not mention that NRQL is specific to New Relic or that results can be visualized. The context suggests there is an alternative, but no comparison or selection criteria are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.8.7- First observed
query-logs - First observed
run-nrql-query
TDQS
Scored across 2 tools
The two tools target different data types: 'run-nrql-query' returns generic data points from NRQL queries, while 'query-logs' specifically targets log data with field/value filtering. There's a small risk of confusion since NRQL can also query logs, but the descriptions clearly differentiate the intended use cases.
Both tool names follow a verb_noun pattern with hyphens ('run-nrql-query', 'query-logs'), which is consistent. The only minor inconsistency is that one uses 'run-' prefix while the other uses 'query-' prefix, but both are action verbs and the pattern is maintained.
Two tools feels thin for a server called 'nr-mcp' given New Relic's broad API surface (alerts, dashboards, entities, etc.). While the two tools may serve a focused need, the count is borderline—adequate for a minimal implementation but missing many common operations.
The tool surface is severely incomplete for New Relic's capabilities. There are no tools for managing alerts, dashboards, entities, deployments, or even fetching raw NRQL query results beyond data points. An agent relying on this server will hit dead ends quickly when needing anything beyond logs or basic NRQL queries.
Maintenance
Related MCP Connectors
- mttrlyOAuthcom.mttrly
AI-powered incident management and server monitoring via MCP.
Access New Relic observability data through MCP - query metrics, logs, traces, entities, and more
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseAqualityDmaintenanceA comprehensive MCP server providing over 26 tools for querying, monitoring, and analyzing NewRelic data through NRQL queries and entity management. It enables interaction with NewRelic's NerdGraph API for managing alerts, logs, and incidents directly within Claude Code sessions.24100 npm2MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that guides an AI agent through stack trace triage, from raw error to the commit and PR that introduced it.2MIT
- AlicenseAqualityDmaintenanceMCP server that gives AI agents access to your application's OpenTelemetry traces for querying, analysis, and debugging.57 npm2MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for New Relic workflows, enabling NRQL queries, NerdGraph access, entity lookup, logs, alerts, dashboards, and service levels.712 npm4MIT