Token导航 LogoToken导航TokenDH.com
New Relic MCP Server logo
运维云端stdio官方级别未说明来源级核验

New Relic MCP Server

MCP Server

newrelic-mcp

Run NRQL, NerdGraph, and REST v2 operations to query data, manage incidents, create synthetics, and annotate deployments — all from your MCP client.\\n\\nA full‑featured New Relic MCP server that goes far beyond basic NRQL. It exposes safe, typed tools for APM discovery, alert policy/incident workflows (including acknowledge), entity search and deep details, creating Synthetics Browser monitors, and New Relic REST v2 coverage for deployments and metrics with region awareness and auto‑pagination.

工具数

20

提示词数

0

GitHub Stars

12

资源数

0
JavaScriptClaude云端部署CursorWindsurfClaude DesktopClaudeClineVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

@cloudbring

提供方

@cloudbring

最后核验

2026/5/18 04:56

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

NEW_RELIC_API_KEY={NEW_RELIC_API_KEY} NEW_RELIC_ACCOUNT_ID={NEW_RELIC_ACCOUNT_ID} npx -y newrelic-mcp {"NEW_RELIC_API_KE...

详细介绍

New Relic MCP服务器

](https://smithery.ai/server/@cloudbring/newrelic-mcp)

一种模型上下文协议(MCP)服务器,可与New Relic的可观察性平台无缝集成。查询指标、管理警报、监控应用程序,并通过简单统一的界面与整个可观察性堆栈进行交互。

免责声明:这是一个非官方的社区项目,与New Relic,股份有限公司无关、不受其认可或支持。所有商标均为其各自所有者的财产。

特性

  • 📊 NRQL查询 -执行强大的查询来分析您的数据
  • 🚀 APM集成 -监控应用程序性能和运行状况
  • 🔔 警报管理 -查看和确认警报和事件
  • 🔍 实体搜索 -发现并检查整个基础架构中的实体
  • 📈 综合监测 -管理合成监视器和检查
  • 🔧 NerdGraph API -直接访问New Relic的GraphQL API
  • 🌐 REST v2工具(2.0+) -用于部署、APM应用程序、指标和警报的高价值REST端点

安装

使用Smithery快速安装

要通过Smithery安装或部署,请参阅官方文档: 部署, 项目配置,以及 smithery.yaml 参考.

通过以下方式自动安装克劳德桌面版New Relic MCP 铁匠铺:

npx @smithery/cli install @cloudbring/newrelic-mcp --client claude

Smithery CLI(推荐)

我们建议使用Smithery CLI进行本地开发、检查和部署流程。优点:

  • 统一的开发/构建/部署工作流,与客户端无关
  • 带热重载和游乐场的开发服务器(可选隧道)
  • 构建捆绑包 stdioshttp 运输
  • 交互式检查服务器;使用提供的配置运行
  • 每个客户端安装简单

示例:

# Hot‑reload dev server
npx @smithery/cli dev src/server.ts --port 8181 --no-open

# Build production bundle (shttp transport)
npx @smithery/cli build src/server.ts --out .smithery/index.cjs --transport shttp

# Inspect a published server
npx @smithery/cli inspect @cloudbring/newrelic-mcp

# Run with config (env via JSON)
npx @smithery/cli run @cloudbring/newrelic-mcp --config '{"NEW_RELIC_API_KEY":"...","NEW_RELIC_ACCOUNT_ID":"...","NEW_RELIC_REGION":"US"}'

# Install into a specific client
npx @smithery/cli install newrelic-mcp --client claude

# Open playground
npx @smithery/cli playground --port 3001

笔记:

  • 此回购包括最低 smithery.yamlruntime: "typescript" 与TypeScript优先部署保持一致。
  • 有关所有命令和标志,请参阅CLI参考: 史密斯ai/cli.

手动安装

Claude Desktop

添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json\ 视窗: %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",
        "NEW_RELIC_REGION": "US"
      }
    }
  }
}

Cline (VS Code)

添加到VS Code中的Cline设置:

{
  "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",
        "NEW_RELIC_REGION": "US"
      }
    }
  ]
}

Zed Editor

添加到Zed配置文件 ~/.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

添加到您的Windsurf Cascade配置中:

{
  "mcpServers": {
    "newrelic": {
      "command": "npx",
      "args": ["-y", "newrelic-mcp"],
      "env": {
        "NEW_RELIC_API_KEY": "your-api-key-here",
        "NEW_RELIC_ACCOUNT_ID": "your-account-id",
        "NEW_RELIC_REGION": "US"
      }
    }
  }
}

Local Development

  1. 克隆存储库:
git clone https://github.com/cloudbring/newrelic-mcp.git
cd newrelic-mcp
  1. 安装依赖项并构建:
npm install
npm run build
  1. 添加到MCP客户端配置中:
{
  "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",
        "NEW_RELIC_REGION": "US"
      }
    }
  }
}

配置

所需的环境变量

  • NEW_RELIC_API_KEY -您的新Relic用户API密钥(必需)
  • NEW_RELIC_ACCOUNT_ID -您的New Relic帐户ID(可选,可在每次工具调用时提供)
  • NEW_RELIC_REGION -New Relic数据中心区域: US (默认)或 EU (可选)

获取您的新文物证书

  1. API密钥:

- 登录到 新遗迹 - 导航至 API密钥 在左侧边栏中 - 创建具有适当权限的新用户API密钥

  1. 账户ID:

- 登录New Relic时,在URL中查找您的帐户ID - 或导航到 行政访问管理账户

  1. 区域:

- 集 NEW_RELIC_REGION=US 适用于美国数据中心(默认) - 集 NEW_RELIC_REGION=EU 欧盟数据中心 - 如果未指定,则默认为 US

有关详细的设置说明,请参阅 docs/new-relic-setup.md.

用法示例

配置后,您可以通过MCP客户端与New Relic交互:

查询您的数据

"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"

监控应用程序

"List all my APM applications and their current status"
"Show me the health of my Node.js services"
"Which applications have active alerts?"

管理警报

"Show me all open incidents"
"What critical alerts fired in the last 24 hours?"
"Acknowledge incident #12345"

搜索基础架构

"Find all Redis databases in production"
"Show me entities with high CPU usage"
"List all synthetic monitors and their success rates"

工具参考

下面是此服务器公开的所有MCP工具的简明目录。有关详细的故事/规格,请参阅docs文件夹。

NerdGraph/GraphQL工具

工具摘要
run_nrql_query执行NRQL查询(需要 target_account_id)
run_nerdgraph_query执行原始NerdGraph GraphQL查询
list_apm_applications通过NerdGraph列出APM应用程序
search_entities搜索实体(名称、类型、标签)
get_entity_details获取GUID的详细信息
list_alert_policies通过NerdGraph列出警报策略
list_open_incidents通过NerdGraph列出未解决的事件
acknowledge_incident确认事件(仅限NerdGraph)
list_synthetics_monitors列出合成药物监测器
create_browser_monitor创建浏览器监视器
get_account_details获取帐户元数据

REST v2工具(在v2.0中添加)

工具摘要注释
create_deployment为APM应用程序创建部署标记输入: application_id, revision;可选 changelog, description, user;支持 region
list_deployments_rest列出应用程序的部署支持 page, auto_paginate, region
delete_deployment删除部署标记需要 confirm: true;用户API密钥必须具有管理员角色权限
list_apm_applications_rest通过REST列出APM应用程序筛选器: filter[name], filter[host], filter[ids], filter[language];自动分页
list_metric_names_for_host列出主机的度量名称/值输入: application_id, host_id,可选 name;自动分页
get_metric_data_for_host获取主机的时间片度量数据输入: application_id, host_id, names[];可选 values[], from, to, period, summarize;自动分页
list_application_hosts列出APM应用程序的主机筛选器: filter[hostname], filter[ids];自动分页
list_alert_policies_rest通过REST列出警报策略可选 filter_name;支持分页
list_open_incidents_rest通过REST列出事件服务器没有 only_open/priority 过滤器;这些是客户端应用的;自动分页

参考文献

  • 详细规格和模式: docs/REST_ENDPOINT_TOOL.mddocs/rest-tools-stories/*

故障排除

Connection Issues

如果您在连接时遇到问题:

  1. 验证您的API密钥是否有效:

对于美国地区:

   curl -X POST https://api.newrelic.com/graphql \
     -H 'Content-Type: application/json' \
     -H 'API-Key: YOUR_API_KEY' \
     -d '{"query":"{ actor { user { email } } }"}'

对于欧盟地区:

   curl -X POST https://api.eu.newrelic.com/graphql \
     -H 'Content-Type: application/json' \
     -H 'API-Key: YOUR_API_KEY' \
     -d '{"query":"{ actor { user { email } } }"}'
  1. 检查您的帐户ID是否正确
  1. 确保您的API密钥具有必要的权限
  1. 检查MCP客户端日志以了解详细的错误消息

Permission Errors

如果您收到权限错误:

  1. 验证您的API密钥是否具有所需的权限:

- 对于NRQL查询: NRQL query 许可 - 对于APM数据: APM 读取权限 - 对于警报: Alerts 读/写权限

  1. 如果需要,创建具有更广泛权限的新API密钥

发展

项目结构

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

设置开发环境

  1. 克隆存储库:
git clone https://github.com/cloudbring/newrelic-mcp.git
cd newrelic-mcp
  1. 安装依赖项:
npm install
  1. 创建 .env 文件:
NEW_RELIC_API_KEY=your-api-key-here
NEW_RELIC_ACCOUNT_ID=your-account-id
NEW_RELIC_REGION=US
  1. 构建项目:
npm run build

开发命令

# Start development server with hot reload
npm run dev

# Build for production
npm run build

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Run linting
npm run lint

# Format code
npm run format

# Test server startup
npm run test:server

测试

该项目使用测试驱动开发(TDD),包括:

  • 维测试 用于单元测试
  • Gherkin 用于BDD测试
  • 埃瓦利特 用于LLM响应验证
# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Run BDD tests only
npm run test:bdd

# Run integration tests with real API
USE_REAL_ENV=true npm test

调试

使用MCP检查器测试和调试服务器:

# Run with MCP Inspector
npm run inspect

# Run with development server
npm run inspect:dev

# Run with environment variables
npm run inspect:env

docs/mcp-inspector-setup.md 详细说明。

建筑

服务器采用模块化架构,具有:

  • 客户端层:处理New Relic API通信
  • 工具层:实施MCP工具规范
  • 服务器层:管理MCP协议和工具路由

每个工具:

  • 有一个单一的、专注的目标
  • 使用Zod模式验证输入
  • 返回结构化、类型化的响应
  • 包括全面的错误处理

贡献

我们欢迎捐款!请查看我们的 贡献指南 了解详情。

开发工作流程

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 先写测试(TDD方法)
  4. 实现您的功能
  5. 确保所有测试通过(npm test)
  6. 保持90%以上的代码覆盖率
  7. 跑linting(npm run lint)
  8. 提交您的更改(提交将自动格式化)
  9. 推到您的分支
  10. 打开拉取请求

代码的风格

本项目使用:

  • 生物群系 用于裁剪和格式化
  • TypeScript 严格模式
  • 2个空间 用于压痕
  • 单引号 对于字符串
  • 分号 总是

文档

比较

我们研究了其他公共New Relic MCP服务器,在撰写本文时没有发现任何积极维护、功能完整的替代方案。如果你知道一个,请在这里打开一个问题来添加它。

项目状态传输部署APM应用程序指标警报合成注释
此项目(newrelic-mcp)活动NerdGraph+REST v2创建/列表/删除列表(NerdGraph+REST)主机名+时间戳(REST)策略+事件(NG+REST)列表/创建(浏览器)综合测试和文档

计划中的增强功能(基于REST v2目录和用户需求):

  • 警报:通过REST(如果可用)进行违规和条件管理
  • 指标:超越每台主机的更广泛的应用级指标端点(名称/数据)
  • 额外的REST覆盖范围:标签、关键事务、移动应用程序(根据反馈进行优先级排序)

支持

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

免责声明

本项目不隶属于New Relic,股份有限公司,也不受其认可或支持。它是一个独立的开源项目,使用New Relic的公共API。

致谢

______________________________________________________________________

由...制作❤️ 通过 @云带来 使用Cursor和Claude代码

目录标签

目录标签

JavaScriptClaude云端部署New RelicNerdGraphobservabilitylogsmetricsOTelOpen TelemetryDevOps可观测性集成本地部署性能监控警报管理应用程序性能管理基础设施监控

支持客户端

CursorWindsurfClaude DesktopClaudeClineVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

remote-capable

来源包(packageName,安装包名)

newrelic-mcp

工具数量(toolCount,工具数)

20

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP