Preflight

io.github.newrelic-experimental由 GitHub 帳號 newrelic-experimental 發布v1.71.0更新於 Nov 4, 2026

New Relic MCP server for observing AI coding assistants (Claude Code, Cursor, Copilot, etc.)

發布方自己的服務:Preflight

概覽

AI 產生的概覽

New Relic 推出的本機 MCP 伺服器,用來擷取並分析 AI 程式助手的工具呼叫、成本與效率,可選擇連接 New Relic 雲端。

可以做什麼
  • 透過 nr_observe_* 工具查詢已擷取的 session 遙測:動作、工具呼叫、成本與效率資料
  • 檢查安裝健康狀態,並在明確允許時安裝用來擷取工具呼叫的 hook
  • 在 localhost:7777 執行本機即時儀表板,顯示 session、花費與效率分數
  • 設定 New Relic 帳號後可部署預建儀表板與警示
  • 提供成本明細、反模式偵測、效率分數與每週輔導報告
適用情境
適合使用 Claude Code、Cursor、Copilot 等 AI 程式助手,並想了解它做了什麼、花了多少錢、在哪裡浪費時間的人。本機模式不需要帳號;只有需要團隊彙總、警示和跨 session 歷史時才連接 New Relic。
執行需求
透過 npx 從 npm 套件 @newrelic/preflight 在本機執行;需要 Node.js v22 或以上版本,以及支援的 AI 程式工具。本機模式不需要帳號。cloud 或 both 模式需要 NEW_RELIC_ACCOUNT_ID 與 NEW_RELIC_LICENSE_KEY,並以 NR_AI_MODE 指定遙測去向。部署儀表板與警示還需要另一組 New Relic 使用者 API 金鑰。
安裝前請注意
hook 會擷取 session 中每一次檔案讀取、編輯、指令與搜尋;cloud 或 both 模式會把這些遙測送到 New Relic,計入帳號的資料擷取量,可能產生費用。在命令列傳入的授權金鑰可能被本機其他使用者透過 ps 看到。安裝 hook 的工具可被任何已連線的 MCP 用戶端呼叫,因此預設會拒絕執行;開啟無介面安裝會擴大這個範圍。切換到雲端前請先查看隱私清單。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Preflight,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Preflight]

Preflight

Observability for AI Coding Assistants

[License] [Node 22+] [Local First] [Dashboards Included]

Docs • What's New • Examples • Community • Contributing


Why Your AI Tool Needs Observability

Your AI coding assistant makes hundreds of decisions every session — what to read, what to edit, when to run commands. But you can't see any of it. You know it was fast, but was it efficient? You got a PR merged, but how much did it cost? You fixed a bug, but did it get stuck in a loop first?

Preflight is observability for agentic coding — the actions, cost, and efficiency of your AI coding assistant as it works. See exactly what's happening, how much it costs, and where your AI is wasting time.

Local-first by design. Preflight runs entirely on your machine and sends your data nowhere by default. A live dashboard at localhost:7777 shows your sessions in real time, fully offline. Connect a New Relic account only when you want more — team rollups, alerting, and cross-session history. You choose: local-only, New Relic, or both.


Demo

[Preflight dashboard animation]

See cost breakdown, efficiency scoring, anti-patterns, and live session tracking in action.


What You Get

Visibility

  • Every action captured — file reads, edits, commands, searches
  • Live session dashboard — see what's happening right now
  • Historical trends — analyze patterns over weeks and months

Cost Control

  • USD spend tracking — per session, day, and week
  • Per-model and cache breakdown — know which models cost most and how efficiently context is reused
  • Budget alerts — get notified before you overspend
  • Forecasting — project monthly burn rate

Efficiency Insights

  • Efficiency score — 0–100 score per task, based on how directly the AI worked
  • Anti-pattern detection — catches re-reads, blind edits, stuck loops
  • Personalized recommendations — optimize your AI workflow
  • Weekly coaching reports — narrative analysis vs. your historical baseline

Dashboards

  • Local dashboard — live session view at localhost:7777, no account required
  • 8 pre-built New Relic dashboards — deploy in seconds (New Relic mode):
    • Overview — session stats, cost summary, top tools
    • Personal — 30-day self-reflection scoped to you
    • Session Detail — deep-dive into a single session's tool calls
    • Team View — aggregated cost and efficiency across developers
    • Manager View — high-level team metrics, no tool-call content
    • Adoption & Cost — adoption momentum, spend, skill and MCP usage, and per-developer outcomes for engineering managers
    • Platform Comparison — Claude Code vs. Cursor vs. Windsurf, etc.
    • Security Audit — audit trail of sensitive file access

Quick Start

1. Install

bash
npm install -g @newrelic/preflight

Using Smithery? Installing Preflight from the Smithery MCP registry wires up the MCP server for you, but Smithery has no mechanism to write Claude Code hooks. After install, either run preflight install in a terminal, or set "allowHeadlessInstall": true in your Preflight config (or NEW_RELIC_AI_ALLOW_HEADLESS_INSTALL=true) and ask Claude Code to call the nr_observe_install_hooks MCP tool. The tool refuses by default, because any connected MCP client can call it. With the flag on, it offers to do this automatically once nr_observe_health reports setup_required: true. Then restart Claude Code to activate monitoring.

2. Run setup

bash
preflight setup

The wizard defaults to local mode — press Enter through the prompts and you're set. It wires Preflight into your AI tool (hooks + MCP server) and writes config to ~/.newrelic-preflight/. Takes under a minute, no account required.

Using GitHub Copilot? The wizard also asks to install Copilot hooks — saying yes configures both the Copilot CLI and VS Code Copilot Chat automatically (hooks, MCP registration, and the fix for VS Code's hook double-capture), so Copilot gets the same tool-call and cost metrics Claude Code does. Run it standalone anytime with preflight install --copilot. See docs/ADAPTERS.md for details.

When prompted, pick a mode:

ModeWhat it doesNew Relic account?
local (default)Everything stays on your machine; live dashboard at localhost:7777Not needed
cloudShips telemetry to New RelicRequired
bothLocal dashboard and New RelicRequired

3. Start coding

Restart your AI tool — hooks and the MCP server load at session start. Every tool call is captured automatically. Open http://localhost:7777 to watch your session live.

Using Kiro? Add Preflight as a Kiro Power for the nr_observe_* query tools — see the doc for install steps and how to add automatic tool-call capture on top.

Using Claude Code? You can skip the npm install above and add Preflight as a Claude Code plugin instead:

/plugin marketplace add newrelic-experimental/preflight/plugin install newrelic-preflight@newrelic-preflight-marketplace

Other ways to install

Cursor — Add to Cursor installs the MCP server via a one-click deeplink; run preflight setup afterwards for hook capture.

Homebrew (macOS):

bash
brew tap newrelic-experimental/preflightbrew trust newrelic-experimental/preflightbrew install preflight

Run preflight setup afterwards for hook capture.


Works With

Claude Code • Amazon Kiro • Amazon Q Developer CLI • Factory Droid • OpenAI Codex • opencode • Kilo Code • Pi • GitHub Copilot • GitHub Copilot SDK • GitHub Copilot app • Google Gemini CLI • Cursor • Windsurf • Google Antigravity • Zed • Continue.dev • Cline

Coverage isn't uniform — some platforms capture every built-in tool call, others (Zed, Continue.dev, Cline) only see calls routed to Preflight's own MCP tools. See ADAPTERS.md for what each platform can and can't observe, and per-platform setup steps.


Connect New Relic (optional)

Local mode is fully featured on its own. Connect a New Relic account to unlock:

  • Team & manager dashboards across multiple developers
  • Alerting on cost spikes, low efficiency, and stuck loops
  • Cross-session history, trends, and weekly coaching reports

Re-run preflight setup and choose cloud or both, or configure it non-interactively:

bash
preflight install \  --mode cloud \  --license-key YOUR_LICENSE_KEY \  --account-id YOUR_ACCOUNT_ID

EU accounts add --eu. FedRAMP accounts add --fedramp. Japan accounts add --jp.

A key passed with --license-key is visible to every local user through ps. For scripts, read it from a file instead (--license-key-file ~/.nr-key, which warns if other users can read the file) or set NEW_RELIC_LICENSE_KEY and NEW_RELIC_ACCOUNT_ID in the environment. The flag wins over the file, and the file wins over the environment. The environment is used only when config.json has no stored licenseKey or licenseKeyCommand, so a shell that already exports these variables for an APM agent never overwrites your stored key. To replace a stored key, pass --license-key-file. With --copilot, the key is still handed to copilot mcp add as an argument, so it is briefly visible in ps for that one call.

Then deploy the prebuilt dashboards:

bash
NEW_RELIC_API_KEY=NRAK-... NEW_RELIC_ACCOUNT_ID=12345 \  preflight deploy-dashboards --all

You'll need a license key (telemetry ingest) and your account ID, plus a user API key (NRAK-…) to deploy dashboards and alerts. See ADVANCED.md for alerts, OTLP export to other backends, and Terraform.

No dashboard until you run deploy-dashboards. Cloud mode ships telemetry to New Relic as soon as it's configured, but nothing creates a dashboard automatically — that's the separate step above, and it needs a different credential (a user API key, not your license key). Until you run it, there's no UI to look at. In the meantime, query the raw events directly in New Relic's Query Builder, e.g.:

sql
SELECT * FROM AiToolCall SINCE 1 hour ago

Once deploy-dashboards succeeds, find the dashboards under your New Relic account's Dashboards section.

Data ingest note: Telemetry sent to New Relic counts against your account's data ingest. On paid plans, standard ingest rates apply. Monitor your usage under NR One → Data Management → Data Ingestion.


Requirements

Required

  • Node.js v22 or higher (get it or use nvm)
  • An AI coding tool (Claude Code recommended for deepest integration)

Optional

  • New Relic account — only for cloud/both mode. Skip it to run local-only (the default).
  • User API key (NRAK-…) — only needed to deploy dashboards and alerts

Other Commands

bash
preflight doctor               # Run 10 diagnostic checks and print actionable fix commandspreflight validate             # Check config for syntax errors and unknown keyspreflight update               # Pull latest version, rebuild, and offer to restart a running dashboard (source installs only — npm installs: npm install -g @newrelic/preflight@latest; Homebrew installs: brew upgrade preflight)preflight local                # List running --local dashboard processes and live --stdio MCP processespreflight local --clean        # Kill orphaned --local processes and --stdio processes with a missing binary (prompts for confirmation)preflight uninstall            # Remove hooks and MCP config (prompts with a summary first)preflight uninstall --yes      # Skip the confirmation prompt (for scripts and CI)preflight uninstall --daemon   # Remove only the background dashboard daemon

Add --project to install/uninstall to scope changes to the current directory only.

WSL users: preflight setup will ask which Claude Code you're running. You can also set it explicitly:

  • --windows-cc — Windows Claude Code (the desktop app); uses wsl.exe hooks and Windows paths
  • --linux-cc — Linux Claude Code installed via npm inside WSL

Documentation

  • ADVANCED.md — Configuration, dashboards, alerts, Terraform
  • SCORECARDS.md — New Relic Scorecard rules for team attribution
  • ARCHITECTURE.md — Data flow, component reference, and operating modes
  • ADAPTERS.md — Per-platform integration mechanism, setup steps, and known gaps
  • FLEET_DEPLOYMENT.md — Roll out the Claude Code plugin to many machines with managed settings and MDM
  • TROUBLESHOOTING.md — Common setup and connection problems, and how to fix them
  • CONTRIBUTING.md — Development, testing, submitting PRs
  • SECURITY.md — Security guidelines and best practices
  • PRIVACY.md — Data collection inventory and pre-cloud checklist

From Source

Develop, test, or run the latest unreleased version:

bash
git clone https://github.com/newrelic-experimental/preflightcd preflightnvm use              # Switch to Node v24npm ci               # Install dependencies from the lockfilenpm run build        # Build the server and the dashboard bundlenpm link             # Register preflight on PATH

Then run preflight setup as usual.


License

Preflight is open source under the Apache License 2.0.


Contributing

We welcome contributions! See CONTRIBUTING.md for how to get started. Join the New Relic Community to share ideas, ask questions, or discuss features.


Built by New Relic • Designed for developers who use AI

來源:README.md,提交 861a9a7

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

22
  1. v1.71.0最新Nov 4, 2026
  2. v1.70.0Nov 3, 2026
  3. v1.68.0Oct 29, 2026
  4. v1.67.3Oct 26, 2026
  5. v1.67.2Oct 14, 2026
  6. v1.67.1Oct 13, 2026
  7. v1.67.0Oct 12, 2026
  8. v1.65.0Oct 12, 2026
  9. v1.63.4Oct 9, 2026
  10. v1.63.1Oct 8, 2026
  11. v1.61.0Oct 8, 2026
  12. v1.60.0Oct 8, 2026
  13. v1.59.4Oct 7, 2026
  14. v1.59.0Oct 7, 2026
  15. v1.58.3Oct 6, 2026
  16. v1.57.3Oct 6, 2026
  17. v1.57.0Sep 18, 2026
  18. v1.56.0Sep 18, 2026
  19. v1.55.1Sep 17, 2026
  20. v1.55.0Sep 17, 2026
  21. v1.54.0Sep 16, 2026
  22. v1.53.1Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Preflight 整合