# preflight

Tracks AI assistant tool calls, session costs, and efficiency signals. Use it to inspect agent activity and spending as it happens.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 65
- Author: newrelic-experimental
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/newrelic-experimental/preflight
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/preflight

## What it does

preflight captures tool activity, including file reads and edits, commands, and searches. Its local dashboard at `localhost:7777` displays live sessions, USD costs, an efficiency score, and patterns such as repeated reads, blind edits, and stuck loops. It also breaks costs down by model and cache, and includes budget alerts and monthly burn-rate forecasts.

The default mode keeps data on your machine. Choose New Relic mode or both local and New Relic reporting when you want cloud features; cloud mode requires a New Relic account. The npm setup requires Node 22+ and `preflight setup`, which connects the MCP server and hooks to your AI tool. Hook setup matters: without it, automatic capture of tool calls described by the project is not configured.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `NEW_RELIC_LICENSE_KEY`, `NEW_RELIC_ACCOUNT_ID` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env NEW_RELIC_LICENSE_KEY=<NEW_RELIC_LICENSE_KEY> --env NEW_RELIC_ACCOUNT_ID=<NEW_RELIC_ACCOUNT_ID> --transport stdio preflight -- npx -y @newrelic/preflight
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add preflight --env NEW_RELIC_LICENSE_KEY=<NEW_RELIC_LICENSE_KEY> --env NEW_RELIC_ACCOUNT_ID=<NEW_RELIC_ACCOUNT_ID> -- npx -y @newrelic/preflight
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "preflight": {
            "command": "npx",
            "args": [
                "-y",
                "@newrelic/preflight"
            ],
            "env": {
                "NEW_RELIC_LICENSE_KEY": "<NEW_RELIC_LICENSE_KEY>",
                "NEW_RELIC_ACCOUNT_ID": "<NEW_RELIC_ACCOUNT_ID>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "preflight": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@newrelic/preflight"
            ],
            "env": {
                "NEW_RELIC_LICENSE_KEY": "<NEW_RELIC_LICENSE_KEY>",
                "NEW_RELIC_ACCOUNT_ID": "<NEW_RELIC_ACCOUNT_ID>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e NEW_RELIC_LICENSE_KEY=<NEW_RELIC_LICENSE_KEY> -e NEW_RELIC_ACCOUNT_ID=<NEW_RELIC_ACCOUNT_ID> preflight npx -y @newrelic/preflight
```
Replace <…> with your own values

## When to use it
- inspect tool calls during an assistant session
- break down spending by session and model
- spot repeated reads and stuck loops
- compare task efficiency scores
- review tool-use history

## Example prompts
- Show the current session and its costs.
- Find repeated file reads and stuck loops in the agent's activity.
- Compare spending across models for my sessions.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74559
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
