MCP integration
Connect Cursor, Claude, Windsurf, Kiro, and other MCP hosts to approved PreFlight tools.
MCP integration guide
A hands-on walkthrough for connecting PreFlight to AI coding assistants via the Model Context Protocol. By the end of this guide, your agent can trigger checks, evaluate Release Rules, and inspect incidents in natural language.
Why MCP matters for launch readiness
MCP turns context-switching into conversation. The agent reads structured tool responses and can chain actions — run checks, read the gate, and suggest fixes in one prompt.
Prerequisites
<IntegrationRequirements items={[ "PreFlight workspace with at least one project and connected providers", "Account API key (Settings → API keys) — starts with pf_live_", "Node.js 20+ installed locally", "An MCP-compatible AI host (Cursor, Claude Desktop, Windsurf, Kiro, or similar)", "Network access to your PreFlight instance (production or localhost)", ]} />
Step-by-step setup
cursor-mcp-key. Copy the full pf_live_… value immediately — it's shown only once.
src/sdk/mcp/server.ts. Run npm install if you haven't already.
npm run mcp -- --api-key pf_live_... --project-id YOUR_UUID and verify it starts without errors.
Host configuration examples
Cursor
Create or edit .cursor/mcp.json in your workspace (or configure via Cursor Settings → MCP):
{
"mcpServers": {
"preflight": {
"command": "npm",
"args": ["run", "mcp", "--prefix", "C:/path/to/preflight"],
"env": {
"PREFLIGHT_API_KEY": "pf_live_your_key_here",
"PREFLIGHT_PROJECT_ID": "550e8400-e29b-41d4-a716-446655440000",
"PREFLIGHT_API_URL": "https://getpreflight.dev"
}
}
}
}
Claude Desktop
Edit claude_desktop_config.json (usually in ~/.config/Claude/ on macOS/Linux or %APPDATA%/Claude/ on Windows):
{
"mcpServers": {
"preflight": {
"command": "npx",
"args": ["tsx", "C:/path/to/preflight/src/sdk/mcp/server.ts"],
"env": {
"PREFLIGHT_API_KEY": "pf_live_your_key_here",
"PREFLIGHT_PROJECT_ID": "550e8400-e29b-41d4-a716-446655440000",
"PREFLIGHT_API_URL": "https://getpreflight.dev"
}
}
}
}
Kiro
Add to .kiro/settings/mcp.json in your workspace:
{
"mcpServers": {
"preflight": {
"command": "npm",
"args": ["run", "mcp", "--prefix", "C:/path/to/preflight"],
"env": {
"PREFLIGHT_API_KEY": "pf_live_your_key_here",
"PREFLIGHT_API_URL": "https://getpreflight.dev"
},
"disabled": false,
"autoApprove": ["list_projects", "get_status"]
}
}
}
Windsurf
Add to your Windsurf MCP configuration:
{
"mcpServers": {
"preflight": {
"command": "npx",
"args": ["tsx", "/path/to/preflight/src/sdk/mcp/server.ts"],
"env": {
"PREFLIGHT_API_KEY": "pf_live_your_key_here",
"PREFLIGHT_PROJECT_ID": "your-project-uuid"
}
}
}
}
Tool reference
list_projects
Lists all projects accessible via the configured API key. No parameters required.
Example prompt: "Show me all my PreFlight projects."
Returns: Project names, UUIDs, workspace IDs, and creation dates in a markdown table.
run_checks
Runs the full pre-flight readiness suite for a project.
<PropertyTable rows={[ { name: "projectId", type: "string (UUID)", required: false, description: "Target project. Falls back to PREFLIGHT_PROJECT_ID or auto-discovery if only one project exists." }, ]} />
Example prompt: "Run a full PreFlight check and tell me what's failing."
Returns: Status summary, pass/warning/failure counts, AI diagnosis (if enabled), and detailed probe results with fix suggestions.
get_status
Returns overall project health including uptime, Uptime Monitoring state, and provider connectivity.
<PropertyTable rows={[ { name: "projectId", type: "string (UUID)", required: false, description: "Target project UUID." }, ]} />
Example prompt: "What's the current health status of my project?"
Returns: Overall status (healthy/degraded/failing), 7-day uptime percentage, average response time, Uptime Monitoring sampling state, incident count, and per-provider connection status.
get_deploy_gate
Evaluates whether a deployment should proceed.
<PropertyTable rows={[ { name: "projectId", type: "string (UUID)", required: false, description: "Target project UUID." }, { name: "mode", type: ""strict" | "relaxed"", required: false, description: "Evaluation mode. Strict blocks on warnings; relaxed allows warnings through." }, ]} />
Example prompt: "Is the release rule allowing production right now in strict mode?"
Returns: Allowed/blocked verdict, evaluation mode, blocking reasons with dashboard URLs, and latest check run context.
get_incidents
Retrieves active incidents and recent probe failures.
<PropertyTable rows={[ { name: "projectId", type: "string (UUID)", required: false, description: "Target project UUID." }, { name: "status", type: "open | acknowledged | resolved | dismissed", required: false, description: "Filter by incident lifecycle state." }, { name: "limit", type: "integer (1–100)", required: false, description: "Max results returned (default 25)." }, ]} />
Example prompt: "List open incidents and suggest a fix for each."
Returns: Incident summary, individual incident records with keys and timestamps, plus recent probe failures with error messages and fix suggestions.
get_uptime
Returns uptime percentages across trailing windows.
<PropertyTable rows={[ { name: "projectId", type: "string (UUID)", required: false, description: "Target project UUID." }, ]} />
Example prompt: "What's our 7-day uptime SLA?"
Returns: 24h/7d/30d uptime percentages, sample counts, failure counts, consecutive success streak, and latest sample status.
get_activity
Returns the recent audit log for a project.
<PropertyTable rows={[ { name: "projectId", type: "string (UUID)", required: false, description: "Target project UUID." }, { name: "event_type", type: "string", required: false, description: "Filter by event type (check, integration, alert, settings, deploy_gate, incident)." }, { name: "status", type: "success | failure | warning | info", required: false, description: "Filter by event outcome." }, { name: "limit", type: "integer (1–100)", required: false, description: "Max results (default 25)." }, ]} />
Example prompt: "Show me the last 10 release rule events."
Returns: Activity timeline with status, event type, title, actor, and timestamp.
Workflow recipes
Pre-merge readiness check
Ask your agent before merging a PR:
"Run a PreFlight check, then tell me if the release rule would allow this to ship. If it's blocked, summarize what I need to fix."
The agent will:
- Call
run_checksto run fresh probes - Call
get_deploy_gatewith mode=strict - If blocked, explain each blocker with the fix suggestion from probe results
Morning health review
Start your workday with:
"Give me a health summary: uptime SLA, any open incidents, and whether the gate is clear."
The agent chains get_status, get_incidents, and get_deploy_gate into a single concise briefing.
Incident triage
When an alert fires:
"What incidents are open? For each one, what probe failed and what's the suggested fix?"
The agent calls get_incidents and formats the response with probe keys, error messages, and actionable fix suggestions.
Post-deploy verification
After shipping:
"Trigger a full check run and report back. If anything fails, check if it was already failing before the deploy by looking at recent activity."
The agent runs checks, then cross-references get_activity to distinguish pre-existing issues from new regressions.
Environment variable reference
PREFLIGHT_API_URL=https://getpreflight.dev (or your self-hosted domain) in the MCP host config.
Security best practices
Troubleshooting
<RelatedLinks links={[ { href: "/docs/api/mcp-server", title: "MCP server reference", description: "Technical details, tool schemas, and transport." }, { href: "/docs/api/authentication", title: "API authentication", description: "Key creation and management." }, { href: "/docs/getting-started/cli-and-sdk", title: "CLI and SDK", description: "All automation interfaces compared." }, { href: "/docs/guides/deploy-gates", title: "Release Rules", description: "What strict and relaxed modes evaluate." }, ]} />
