preflight — Claude Code MCP server: features and setup
Tracks AI assistant tool calls, session costs, and efficiency signals. Use it to inspect agent activity and spending as it happens.
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/preflightWhat preflight 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.
What it helps with
- 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 for the agent
- 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.
How to install preflight
Platform CLI
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/preflightReplace <…> with your own values
Platform CLI
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/preflightReplace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
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/preflightReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about preflight
How do I install preflight in Claude Code?
Run claude mcp add preflight -e NEW_RELIC_LICENSE_KEY=<NEW_RELIC_LICENSE_KEY> -- npx -y @newrelic/preflight. This method uses a New Relic license key.
What does preflight do?
It records assistant tool activity and presents session data, costs, and efficiency signals. You can inspect them in a local dashboard.
Does preflight require a New Relic account?
No account is needed for local mode. Cloud mode, or using local and New Relic reporting together, requires a New Relic account.