🚀 New Relic MCP Server
The New Relic MCP Server is a Model Context Protocol (MCP) server that seamlessly integrates with New Relic's observability platform. It offers a unified interface for querying metrics, managing alerts, monitoring applications, and interacting with your entire observability stack.

⚠️ Important Note
This is an unofficial community project and is not affiliated with, endorsed by, or supported by New Relic, Inc. All trademarks are the property of their respective owners.
🚀 Quick Start
Once you've configured the New Relic MCP Server, you can start interacting with New Relic through your MCP client. For example, you can query your data, monitor applications, manage alerts, and search your infrastructure.
✨ Features
- 📊 NRQL Queries: Execute powerful queries to analyze your data.
- 🚀 APM Integration: Monitor application performance and health.
- 🔔 Alert Management: View and acknowledge alerts and incidents.
- 🔍 Entity Search: Discover and inspect entities across your infrastructure.
- 📈 Synthetics Monitoring: Manage synthetic monitors and checks.
- 🔧 NerdGraph API: Direct access to New Relic's GraphQL API.
- 🌐 REST v2 Tools (2.0+): High‑value REST endpoints for deployments, APM apps, metrics, and alerts.
📦 Installation
Quick Install with Smithery
To install or deploy via Smithery, refer to the official docs: Deployments, Project Configuration, and smithery.yaml
Reference.
To automatically install New Relic MCP for Claude Desktop via Smithery:
npx @smithery/cli install newrelic-mcp --client claude
Smithery CLI (recommended)
We recommend using the Smithery CLI for local development, inspection, and deployment. Benefits include:
- Unified dev/build/deploy workflow, client‑agnostic.
- Dev server with hot‑reload and playground (optional tunnel).
- Build bundles for
stdio
or shttp
transports.
- Inspect a server interactively; run with supplied config.
- Simple install per client.
Examples:
npx @smithery/cli dev src/server.ts --port 8181 --no-open
npx @smithery/cli build src/server.ts --out .smithery/index.cjs --transport shttp
npx @smithery/cli inspect @cloudbring/newrelic-mcp
npx @smithery/cli run @cloudbring/newrelic-mcp --config '{"NEW_RELIC_API_KEY":"...","NEW_RELIC_ACCOUNT_ID":"..."}'
npx @smithery/cli install newrelic-mcp --client claude
npx @smithery/cli playground --port 3001
Note: This repo includes a minimal smithery.yaml
with runtime: "typescript"
to align with TypeScript‑first deployments. See the CLI reference for all commands and flags: smithery-ai/cli.
Manual Installation
Claude Desktop
Add the following to your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"newrelic": {
"command": "npx",
"args": [
"-y",
"newrelic-mcp"
],
"env": {
"NEW_RELIC_API_KEY": "your-api-key-here",
"NEW_RELIC_ACCOUNT_ID": "your-account-id"
}
}
}
}
Cline (VS Code)
Add the following to your Cline settings in VS Code:
{
"cline.mcpServers": [
{
"name": "newrelic",
"command": "npx",
"args": ["-y", "newrelic-mcp"],
"env": {
"NEW_RELIC_API_KEY": "your-api-key-here",
"NEW_RELIC_ACCOUNT_ID": "your-account-id"
}
}
]
}
Zed Editor
Add the following to your Zed configuration file at ~/.config/zed/settings.json
:
{
"language_models": {
"mcp": {
"servers": {
"newrelic": {
"command": "npx",
"args": ["-y", "newrelic-mcp"],
"env": {
"NEW_RELIC_API_KEY": "your-api-key-here",
"NEW_RELIC_ACCOUNT_ID": "your-account-id"
}
}
}
}
}
}
Windsurf Editor
Add the following to your Windsurf Cascade configuration:
{
"mcpServers": {
"newrelic": {
"command": "npx",
"args": ["-y", "newrelic-mcp"],
"env": {
"NEW_RELIC_API_KEY": "your-api-key-here",
"NEW_RELIC_ACCOUNT_ID": "your-account-id"
}
}
}
}
Local Development
- Clone the repository:
git clone https://github.com/cloudbring/newrelic-mcp.git
cd newrelic-mcp
- Install dependencies and build:
npm install
npm run build
- Add to your MCP client configuration:
{
"mcpServers": {
"newrelic": {
"command": "node",
"args": ["/path/to/newrelic-mcp/dist/server.js"],
"env": {
"NEW_RELIC_API_KEY": "your-api-key-here",
"NEW_RELIC_ACCOUNT_ID": "your-account-id"
}
}
}
}
🔧 Configuration
Required Environment Variables
NEW_RELIC_API_KEY
: Your New Relic User API Key (required).
NEW_RELIC_ACCOUNT_ID
: Your New Relic Account ID (optional, can be provided per tool call).
Getting Your New Relic Credentials
- API Key:
- Log in to New Relic.
- Navigate to API Keys in the left sidebar.
- Create a new User API Key with appropriate permissions.
- Account ID:
- Find your Account ID in the URL when logged into New Relic.
- Or navigate to Administration → Access management → Accounts.
For detailed setup instructions, see docs/new-relic-setup.md.
💻 Usage Examples
Once configured, you can interact with New Relic through your MCP client.
Basic Usage
Query Your Data
"Show me the average response time for my web application over the last hour"
"What are the top 10 slowest database queries today?"
"Display error rate trends for the production environment"
Monitor Applications
"List all my APM applications and their current status"
"Show me the health of my Node.js services"
"Which applications have active alerts?"
Manage Alerts
"Show me all open incidents"
"What critical alerts fired in the last 24 hours?"
"Acknowledge incident #12345"
Search Infrastructure
"Find all Redis databases in production"
"Show me entities with high CPU usage"
"List all synthetic monitors and their success rates"
📚 Documentation
Tool Reference
Below is a concise catalog of all MCP tools exposed by this server. See the docs folder for detailed stories/specs.
NerdGraph/GraphQL tools
Tool |
Summary |
run_nrql_query |
Execute NRQL queries (requires target_account_id ). |
run_nerdgraph_query |
Execute raw NerdGraph GraphQL queries. |
list_apm_applications |
List APM applications via NerdGraph. |
search_entities |
Search entities (name, type, tags). |
get_entity_details |
Fetch details for a GUID. |
list_alert_policies |
List alert policies via NerdGraph. |
list_open_incidents |
List open incidents via NerdGraph. |
acknowledge_incident |
Acknowledge an incident (NerdGraph only). |
list_synthetics_monitors |
List Synthetics monitors. |
create_browser_monitor |
Create a browser monitor. |
get_account_details |
Fetch account metadata. |
REST v2 tools (added in v2.0)
Tool |
Summary |
Notes |
create_deployment |
Create deployment marker for an APM application. Inputs: application_id , revision ; optional changelog , description , user ; supports region . |
|
list_deployments_rest |
List deployments for an app. Supports page , auto_paginate , region . |
|
delete_deployment |
Delete deployment marker. Requires confirm: true ; User API key must have admin role permissions. |
|
list_apm_applications_rest |
List APM apps via REST. Filters: filter[name] , filter[host] , filter[ids] , filter[language] ; auto‑paginate. |
|
list_metric_names_for_host |
List metric names/values for host. Inputs: application_id , host_id , optional name ; auto‑paginate. |
|
get_metric_data_for_host |
Get timeslice metric data for host. Inputs: application_id , host_id , names[] ; optional values[] , from , to , period , summarize ; auto‑paginate. |
|
list_application_hosts |
List hosts for an APM app. Filters: filter[hostname] , filter[ids] ; auto‑paginate. |
|
list_alert_policies_rest |
List alert policies via REST. Optional filter_name ; supports pagination. |
|
list_open_incidents_rest |
List incidents via REST. Server has no only_open /priority filters; these are applied client‑side; auto‑paginate. |
|
References:
- Detailed specs and schemas:
docs/REST_ENDPOINT_TOOL.md
and docs/rest-tools-stories/*
.
🔧 Technical Details
Troubleshooting
Connection Issues
If you're having trouble connecting:
- Verify your API key is valid:
curl -X POST https://api.newrelic.com/graphql \
-H 'Content-Type: application/json' \
-H 'API-Key: YOUR_API_KEY' \
-d '{"query":"{ actor { user { email } } }"}'
- Check that your Account ID is correct.
- Ensure your API key has the necessary permissions.
- Check the MCP client logs for detailed error messages.
Permission Errors
If you receive permission errors:
- Verify your API key has the required permissions:
- For NRQL queries:
NRQL query
permission.
- For APM data:
APM
read permissions.
- For alerts:
Alerts
read/write permissions.
- Create a new API key with broader permissions if needed.
Development
Project Structure
src/
├── server.ts # Main MCP server implementation
├── client/
│ └── newrelic-client.ts # New Relic API client
└── tools/
├── nrql.ts # NRQL query tool
├── apm.ts # APM applications tool
├── entity.ts # Entity management tools
├── alert.ts # Alert and incident tools
├── synthetics.ts # Synthetics monitoring tools
└── nerdgraph.ts # NerdGraph query tool
Setup Development Environment
- Clone the repository:
git clone https://github.com/cloudbring/newrelic-mcp.git
cd newrelic-mcp
- Install dependencies:
npm install
- Create a
.env
file:
NEW_RELIC_API_KEY=your-api-key-here
NEW_RELIC_ACCOUNT_ID=your-account-id
- Build the project:
npm run build
Development Commands
npm run dev
npm run build
npm test
npm run test:coverage
npm run lint
npm run format
npm run test:server
Testing
The project uses Test-Driven Development (TDD) with:
- Vitest for unit testing.
- Gherkin for BDD testing.
- Evalite for LLM response validation.
npm test
npm run test:coverage
npm run test:bdd
USE_REAL_ENV=true npm test
Debugging
Use the MCP Inspector to test and debug the server:
npm run inspect
npm run inspect:dev
npm run inspect:env
See docs/mcp-inspector-setup.md for detailed instructions.
Architecture
The server follows a modular architecture with:
- Client Layer: Handles New Relic API communication.
- Tools Layer: Implements MCP tool specifications.
- Server Layer: Manages MCP protocol and tool routing.
Each tool:
- Has a single, focused purpose.
- Validates inputs using Zod schemas.
- Returns structured, typed responses.
- Includes comprehensive error handling.
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Workflow
- Fork the repository.
- Create a feature branch (
git checkout -b feature/amazing-feature
).
- Write tests first (TDD approach).
- Implement your feature.
- Ensure all tests pass (
npm test
).
- Maintain >90% code coverage.
- Run linting (
npm run lint
).
- Commit your changes (commits will be auto-formatted).
- Push to your branch.
- Open a Pull Request.
Code Style
This project uses:
- Biome for linting and formatting.
- TypeScript with strict mode.
- 2 spaces for indentation.
- Single quotes for strings.
- Semicolons always.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Disclaimer
This project is not affiliated with, endorsed by, or supported by New Relic, Inc. It is an independent open-source project that uses New Relic's public APIs.
🙏 Acknowledgments
Made with ❤️ by @cloudbring using Cursor and Claude Code