preflightBLOCK
Observability for AI coding assistants — cost tracking, efficiency scoring, and anti-pattern detection for Claude Code, Cursor, Copilot, and more. Local-first; New Relic optional.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Preflight Observability for AI Coding Assistants
[](LICENSE) [](.nvmrc) [](#quick-start) [](#dashboards)
**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
See cost breakdown, efficiency scoring, anti-patterns, and live session tracking in action.
What You Get
Visibility
- Every action captured — file reads, edits, commands, searche
18f01b0ede1aOBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add preflight --env NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY} -- npx -y @newrelic/[email protected]Exposed tools (55)
48 read · 5 write · 2 destructive. Blast radius: 2 tools can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
deep-research | read | Fan-out web research workflow |
live-demo | read | x |
live-fix-demo | read | x |
nr_observe_get_anti_patterns | read | Get detected anti-patterns (thrashing, re-reading, stuck loops, blind editing, over-delegation) for the most recent task. |
nr_observe_get_api_failures | read | Get API failure tracking: per-model reliability scorecards, tokens lost, cost impact, throttle alerts, and mean time to recovery. Failures are captured via Claude Code |
nr_observe_get_budget_status | read | Get current AI spend vs. configured budget caps (session, daily, weekly). Returns remaining budget, % used, and any threshold alerts fired this session. |
nr_observe_get_claudemd_impact | read | Get the impact report for the most recent change to the project |
nr_observe_get_collaboration_profile | read | Get a developer |
nr_observe_get_compute_waste | read | Get compute waste summary: total tokens wasted on retried tool calls and anti-pattern activity (stuck loops, redundant reads, thrashing). Includes per-pattern breakdown and a status assessment (clean / moderate / needs_attention). |
nr_observe_get_config | read | Show the current server configuration (sensitive fields masked): mode, developer, account, region, storage path, dashboard URL, and config file location. Use to diagnose misconfiguration without exposing credentials. |
nr_observe_get_context_composition | read | Get per-turn token breakdown by category (system prompt, conversation history, tool results, injected files). Shows context window fill percentage and dominance alerts. LIMITATION: system_prompt and injected_file_content are always 0 -- the model API |
nr_observe_get_context_efficiency | read | Get context window efficiency metrics: unique vs. repeated file reads, repeated-read ratio, and top re-read files. A high ratio suggests the model is losing context. |
nr_observe_get_context_tracking | read | Get context window tracking: per-turn token growth, category breakdown (System/Tools/User/Assistant), fill percentage, and per-tool output contribution. Shows which tools consume the most context. |
nr_observe_get_cost_breakdown | read | Get a breakdown of session costs by task, model, and efficiency metrics like cost per line of code. Cost figures are Preflight |
nr_observe_get_cost_forecast | read | Project AI spending forward based on current session rate. Returns forecast cost for end-of-day, end-of-week, and end-of-session (8h), with a confidence note. |
nr_observe_get_cost_per_outcome | read | Get cost breakdown by outcome type (bug fix, feature, refactor, etc.) with waste ratio and ROI estimate. |
nr_observe_get_cost_per_tool | read | Cost attribution per tool type — approximate, based on turn-level token correlation. Shows which tools cost the most and average cost per call. Also breaks Skill calls down per skill in costBySkill (calls, estimated cost and tokens, total duration). |
nr_observe_get_decision_tree | read | Get decision branch analysis: reasoning and action extraction per turn for triggered branches (recovery, retry, delegation), with outcome tagging. Includes post-mortem of failure chains and longest failure streak. LIMITATION: the reasoning field is the model |
nr_observe_get_efficiency_score | read | Get the AI coding efficiency score for the most recent task or the session-wide rolling average. |
nr_observe_get_git_efficiency | destructive | Get Git workflow efficiency metrics: merge conflicts, aborted operations, force pushes, stale branch detection, and actionable suggestions to reduce Git friction. |
nr_observe_get_instruction_drift | read | Get instruction/prompt drift analysis: tracks how the project |
nr_observe_get_latency_decomposition | read | Get latency decomposition: how much time is spent in LLM API calls vs tool execution vs overhead, with p50/p95 percentiles for each component. |
nr_observe_get_latency_percentiles | read | Get p50/p95/p99 latency percentiles for tool calls, broken down by tool type. Use to identify which tools are slowest in the current session. |
nr_observe_get_model_recommendation | read | Get a data-driven model recommendation ranked by historical efficiency score, cost, and task success rate across past sessions, both overall and broken down by task outcome type (bug_fix, feature, refactor, investigation, configuration, documentation, failed_attempt). |
nr_observe_get_personal_insights | read | Returns a narrative coaching report comparing this week |
nr_observe_get_platform_comparison | read | Compare AI coding assistant platforms side-by-side on a given metric: efficiency, cost, task_success, tool_calls, or error_rate. |
nr_observe_get_prompt_cache_health | read | Get prompt cache health: hit rate, savings, and a concrete recommendation for improving cache efficiency. |
nr_observe_get_quality_proxy | write | Get quality proxy metrics: diff apply rate, test pass rate, backtrack count, self-correction count, and degradation detection over the session lifetime. |
nr_observe_get_recommendations | read | Get personalized optimization recommendations covering cost, efficiency, prompt engineering, CLAUDE.md impact, and model selection. |
nr_observe_get_retry_alerts | read | Get thrashing/retry detection alerts: repeated failures or highly similar inputs within a sliding window. Identifies when the agent is stuck in a loop. |
nr_observe_get_session_history | read | Get a list of past sessions with summary metrics (efficiency, cost, tool calls, outcome). |
nr_observe_get_session_stats | read | Get current session observability metrics: tool call counts, success rates, file access stats, and duration summaries. |
nr_observe_get_session_timeline | read | Get an ordered list of recent tool calls with timestamps, names, durations, and success/failure status. |
nr_observe_get_task_completion_rate | read | Get task lifecycle metrics: completed task count, average task duration, and average tool calls per task. |
nr_observe_get_team_summary | read | Get aggregated AI coding cost and efficiency metrics for all developers in the configured team, queried via New Relic NRQL. Requires teamId to be set in config. |
nr_observe_get_tool_selection_score | read | Get tool selection quality score: evaluates efficiency of tool usage by detecting redundant reads, repeated failures, and unused large outputs. Score 0-1 where 1 is perfect. |
nr_observe_get_trends | read | Get trend data for a metric over time: weekly efficiency, cost, task success rate, or tool call counts. |
nr_observe_get_turn_analysis | read | Conversation turn analysis — groups tool calls by AI response, shows parallelism and turn patterns. |
nr_observe_get_weekly_summary | read | Get a weekly summary report with per-developer breakdown, cost, efficiency, and anti-pattern counts. |
nr_observe_get_workflow_trace | read | Get the complete tool call trace for a task, including sequence, duration, and anti-pattern/efficiency analysis. |
nr_observe_health | read | Check server health: version, uptime, session ID, and connection timestamp. Also reports whether telemetry event sends are succeeding. Use when the MCP connection feels stale or tools are behaving unexpectedly. |
nr_observe_install_hooks | write | Install PreToolUse, PostToolUse, PermissionRequest, and PermissionDenied monitoring hooks into ~/.claude/settings.json. |
nr_observe_mark_task_boundary | read | Explicitly mark the end of the current task (a discrete unit of work between user |
nr_observe_report_feedback | read | Record user quality feedback for a task. Helps correlate efficiency metrics with perceived quality. |
nr_observe_report_session_end | read | Report that the current AI coding session has ended. Call this at the end of a session |
nr_observe_report_session_start | write | Report that a new AI coding session has begun. Call this at the start of a session |
nr_observe_report_tokens | write | Report token usage for cost tracking. Call periodically to enable accurate cost metrics. |
nr_observe_report_tool_call | read | Report a tool call event for observability. Use this to report non-MCP tool calls |
nr_observe_send_digest | write | Generate the current weekly AI coding summary and POST it to the configured Slack webhook immediately. |
nr_observe_subscribe_digest | read | Register a Slack webhook URL to receive weekly AI coding cost and efficiency summaries. |
nr_observe_unsubscribe_digest | destructive | Remove the registered Slack webhook for weekly digests. |
sample | read | short |
tool_a | read | A |
tool_b | read | B |
tool_c | read | C |
Trust audit
BLOCKgrade F · trust 48/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (4 observation(s))
- Network
- declared (5 observation(s))
- Shell
- declared (1 observation(s))
- Dependencies
- not all pinned
- Secrets in source
- found
Findings (25)
' (typically ~/.aws/amazonq/mcp.json or project-level .amazonq/mcp.json)',
' file (~/.aws/amazonq/cli-agents/<agent-name>.json for a global',
$PF up # prints: up pid=<pid> url=http://127.0.0.1:7791 run=<run dir>
URL="http://127.0.0.1:$PORT"
agent_description: 'Use api key sk-ant-api03-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
const SECRET = 'sk-ant-api03-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
const input = 'db: mongodb+srv://admin:[email protected]/db';
const input = 'db: mysql://root:rootpass@localhost/db';
const fullDbUrl = 'postgres://user:[email protected]:5432/mydb';
const token = 'ghs_16C7e42F292c6912E7710c838347Ae178B4a';
{ token: 'ghp_abcd1234efgh5678ijkl9012mnop3456qrst', name: 'GitHub PAT' },{ token: 'sk_live_abcd1234567890abcdefghijkl', name: 'Stripe live key' },{ token: 'pypi-AgEIcHlwaS5vcmc123456789abcdefghijklmnopq', name: 'PyPI token' },{ token: 'hf_abcdefghijklmnopqrstuvwxyzABCDEFG', name: 'Hugging Face token' },const input = 'token: ghs_16c7e42f292c6912191abc123def456';
expect(result).not.toContain('ghs_16c7e42f292c6912191abc123def456');expect(redact('ghp_1234567890abcdef01234567890abcdef01')).toBe('[REDACTED]');const token = 'ghs_16C7e42F292c6912E7710c838347Ae178B4a';
'git push https://x-access-token:[email protected]/a/b.git',
'data -----BEGIN RSA PRIVATE KEY-----\nMIIE...base64...\n-----END RSA PRIVATE KEY----- end';
const input = '-----BEGIN RSA PRIVATE KEY-----' + 'A'.repeat(200);
const input = '-----BEGIN RSA PRIVATE KEY-----' + 'B'.repeat(200);
'xoxa-123-456-789-abc',
'xoxb-123-456-789-abc',
'xoxp-123-456-789-abc',
Gates applied: no_behavioural_pass.
18f01b0ede1afull audit observations/trust-audit/mcp-server/newrelic-experimental__preflight.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 18f01b0ede1a | BLOCK | F | 48 | first audit |
Questions
What is the preflight MCP server?
Observability for AI coding assistants — cost tracking, efficiency scoring, and anti-pattern detection for Claude Code, Cursor, Copilot, and more. Local-first; New Relic optional.
What tools does preflight expose?
55 in total: 48 read-only, 5 that write, and 2 that can delete or overwrite (nr_observe_get_git_efficiency, nr_observe_unsubscribe_digest). Every one is listed on this page with its risk.
Is preflight safe to connect to an agent?
No — not without reading the findings first. The audit graded it F (48/100) and found 2 critical or high issues in the source. Each one is listed on this page with the file and line it is on. Separately from the audit: 2 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does preflight need?
It reads NEW_RELIC_AI_HOMELAB_TOKEN, NEW_RELIC_API_KEY and NEW_RELIC_LICENSE_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does preflight run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as preflight-docs at 0.0.1.
How current is this page?
The grade is for one exact copy of the source (18f01b0ede1a), read on 2026-10-08. The repository is watched and re-audited when it changes.