Repository avatar
AI Tools
v0.2.0
active

preflight-review

io.github.mqfarooqi1/preflight-review

Launch-readiness reviews for AI workflows: blocker-first checks, evidence, sign-off, client brief

Documentation

Preflight Review website

Preflight Review

Project website · Sample client brief · Releases

CI Python 3.11 to 3.15 MCP MIT licence

Launch-readiness reviews for AI agents and automations, as an MCP server.

Before a workflow that drafts customer replies, searches internal documents or moves data goes live, ask who approves its riskiest action, who can stop it, and what happens when it receives an unexpected input. Preflight asks those questions one at a time, blockers first, records the evidence for each answer, keeps the human sign-off separate from the checks, and exports a brief you can hand to a client.

  • Blocker-first checklist. Approval boundary, rollback, scope and silent failure on every review, plus checks for the kind of workflow it is.
  • Evidence and retests. Each test result needs a named owner and a control. The recommendation comes from the current results, and the brief retains earlier attempts, including results withdrawn as recorded in error.
  • A human decides. The decision is recorded separately and freezes the review. The brief captures the findings that were open at sign-off.
  • Linked revisions. A changed workflow starts a review that shows the old and new values and asks for fresh evidence.
  • Plain-text evidence in the brief. Preflight escapes recorded text before inserting it into Markdown, so pasted evidence cannot add sections or links.
  • Two storage modes. Local mode stores reviews in SQLite. In stateless mode, the client carries signed review records between calls.

Quick start

Preflight supports Python 3.11 to 3.15. Check the package version with uv.

uvx preflight-review-mcp --version

Add it to Claude Code with this command.

claude mcp add preflight -- uvx preflight-review-mcp

For Claude Desktop, add the server to claude_desktop_config.json.

{
  "mcpServers": {
    "preflight": { "command": "uvx", "args": ["preflight-review-mcp"] }
  }
}

To use pip, run python -m pip install preflight-review-mcp, then configure your stdio-capable client to run preflight-review-mcp. To install directly from GitHub, use python -m pip install git+https://github.com/mqfarooqi1/Preflight-MCP. If the client cannot find the command, use the full path of the executable or of the Python you installed it into with the arguments -m preflight_mcp.

Try this request in your MCP client.

Start a customer-support launch review for a workflow that drafts refund replies from our support policy. An agent reviews each draft. Our support lead can disable the workflow. Ask one question at a time. Use synthetic evidence for this demo and label it as such.

Try the demo

From the repository root, install Preflight and run the synthetic refund review through a real stdio MCP session in both storage modes.

python -m pip install .
python examples/demo.py

The demo records an approval failure, updates the control, records a passing retest, and links a follow-up review. It uses a temporary database for local mode. Read the sample client brief or see what changed in 0.2.0.

Use Preflight in Codex

In a trusted project, add this to .codex/config.toml and replace the example paths. The database setting is optional. See the Codex MCP configuration guide.

[mcp_servers.preflight]
command = "/absolute/path/to/python"
args = ["-m", "preflight_mcp"]

[mcp_servers.preflight.env]
PREFLIGHT_DB = "/absolute/path/to/client-reviews.sqlite3"

For a virtual environment named .venv, the Python executable is .venv/bin/python on macOS and Linux and .venv/Scripts/python.exe on Windows. TOML accepts forward slashes in Windows paths or backslashes in single quotes.

Start from a skill

Copy the six folders in skills/ into .agents/skills/ in the project you want to review. Keep each folder with its SKILL.md. Open the project in Codex and invoke $preflight to start, resume, or compare a review. In another Agent Skills client, import the folders according to its skill setup. Codex skills guide

SkillUse it to
preflightChoose where to begin or pick up an existing review.
preflight-scopeDefine the workflow and pick a template.
preflight-challengeIdentify risks and define checks.
preflight-verifyRecord observed outcomes and follow up on failed or inconclusive checks.
preflight-handoffExport a brief and capture an explicit human decision.
preflight-compareReview what changed and identify the evidence the revision needs.

The skills also guide an unsaved draft in the conversation when the MCP server is unavailable.

Start from an MCP prompt

In local mode, clients that expose MCP prompts can use any of these entry points. You can also call the tools from a plain-language request. In stateless mode, use the tools with the current signed record.

PromptArgumentsUse it to
launch_reviewtemplate (default customer_support)Start scoping a workflow.
continue_reviewreview_idResume the next open check from saved state.
client_handoffreview_idDraft a private brief with findings and any recorded decision.

How a review runs

  1. Start with what triggers the workflow, the data it reads, the actions it can take, who approves them, and how it is stopped and undone. Pick from customer_support, document_search or internal_operations.
  2. Answer the next question. get_next_question returns one open check at a time, blockers first. Name an owner and the control. Add a custom check if the template misses a risk.
  3. Test the control in your test environment and record what happened, with a ticket, log or run reference. Update a failed control before retesting. Pass the tested control_version as expected_control_version to reject results for a control that changed since the test. If evidence is pending, pass the check ID in deferred_check_ids to skip the question for this session while keeping the finding open. blocked_by_deferral means the remaining checks were deferred. A result recorded in error, such as evidence from another check, is withdrawn with withdraw_test_result and a reason; the check reopens and the attempt stays in its history.
  4. Decide. Record a named reviewer's explicit decision and reason. approve requires every check to pass. With findings open, the reviewer can choose approve with conditions or hold, and the decision records the open findings. Recording the decision freezes the review. A review that will not reach a decision, such as one for an abandoned workflow, is closed with close_review instead; it leaves list_reviews unless include_closed is set.
  5. Hand over the brief. export_brief exports the decision, the workflow and every check with its evidence and test history, in Markdown. get_review returns the same review as structured data.
  6. Start a linked revision. Use revise_workflow when the workflow changes or provide a revision_reason to start a fresh evidence cycle after a recorded decision or a closure on the same workflow. If a custom check no longer applies, give the reason and pass its ID in omit_custom_check_ids. The original finding stays in the earlier review.
RecommendationWhen
blockeda blocker check is open
ready with conditionsevery blocker passed, other checks are open
ready for reviewevery check passed

The recommendation is advice. The decision belongs to the named reviewer.

Tools

ToolWhat it does
list_templatesthe templates and the checks each one asks
start_reviewstart a review of a new workflow, with its checklist
get_next_questionthe next open check and the question to ask about it
add_review_checkadd a custom check to an open review
record_controlname the owner and the control for a check
record_test_resultrecord a test outcome and its evidence
withdraw_test_resultwithdraw a result recorded in error; it stays in the history
record_decisionstore a named reviewer's decision and freeze the review
close_reviewclose a review that will not reach a decision
revise_workflowstart a linked review with a fresh evidence cycle
get_reviewthe whole review as data, with its state and recommendation
export_briefthe review as a Markdown brief for people
list_reviewssaved reviews, newest first (local mode)

Every tool returns typed structured output, and its description says when to use it rather than the tool next to it. The server supplies read-only annotations for clients that use them; only record_control is marked destructive, because it replaces a check's owner and control. An unknown check error lists the valid checks, and an early approve names the checks still open.

Storage modes

Local (default). Reviews are kept in SQLite at ~/.preflight-review/reviews.sqlite3. Set PREFLIGHT_DB to an absolute path to keep a separate file per client. Reuse that database when resuming a review. Tools refer to reviews by review_id.

Stateless, for hosting. Start the server as preflight-review-mcp --mode stateless (or set PREFLIGHT_MODE=stateless), and set PREFLIGHT_SIGNING_KEY to a secret of at least 32 characters, the same for every copy of the server. Generate a signing key with this command.

python -c "import secrets; print(secrets.token_hex(32))"

In stateless mode, tools that load a review take the full signed object in the review argument. After a tool changes a review, keep the new review from its structured output and pass it back exactly as returned, signature included. Keep both records when creating a linked revision so you can compare them later. Preflight verifies the HMAC-SHA256 signature and rejects edited records. The client can still load any older signed version it holds. The brief prints the record's signature and last-updated time.

Reviewer responsibilities

Your team runs the workflow tests, verifies the evidence, confirms the reviewer's identity, and controls deployment. Preflight records the reported observations, references and decision. Keep customer records and secrets in their source systems.

Development

pip install -e ".[dev]"
pytest
ruff check src tests examples
python examples/demo.py

CI runs the tests and the demo on Linux, Windows and macOS with Python 3.11 to 3.15.

Licence

MIT