MCP server reference
Run approved PreFlight tools from compatible AI development hosts.
PreFlight MCP server
The PreFlight MCP server exposes launch-readiness operations to AI hosts such as Cursor, Claude Desktop, and other Model Context Protocol clients. Agents can list projects, trigger full check runs, read Uptime Monitoring status, evaluate Release Rules, and inspect incidents without custom glue code.
src/sdk/mcp/server.ts and talks to the same /api/v1 routes documented in the [API overview](/docs/api/overview). It runs over stdio transport and authenticates with a workspace API key.
What you can automate
Requirements
<IntegrationRequirements
items={[
"A PreFlight workspace with at least one project",
"An account API key created by the workspace owner (Settings → API keys)",
"Node.js 20+ to run the bundled MCP server via npm run mcp",
"Network access to your PreFlight host (production or local dev server)",
]}
/>
pf_live_ followed by at least 32 alphanumeric characters. Keys are shown once at creation; store them in your agent host secrets, not in the repo.
Install and run locally
From the PreFlight repository root:
npm install
npm run mcp -- --api-key pf_live_your_key_here --project-id your-project-uuid
Environment variables are loaded automatically from .env.local or .env when present:
PREFLIGHT_API_KEY=pf_live_...
PREFLIGHT_PROJECT_ID=550e8400-e29b-41d4-a716-446655440000
PREFLIGHT_API_URL=https://getpreflight.dev
If PREFLIGHT_PROJECT_ID is omitted and the account owns exactly one project, the server auto-selects it. Multiple projects require an explicit UUID or the projectId argument on each tool call.
Cursor configuration
Add a local MCP entry in Cursor settings (or .cursor/mcp.json):
{
"mcpServers": {
"preflight": {
"command": "npm",
"args": ["run", "mcp", "--prefix", "/absolute/path/to/preflight"],
"env": {
"PREFLIGHT_API_KEY": "pf_live_...",
"PREFLIGHT_PROJECT_ID": "your-project-uuid",
"PREFLIGHT_API_URL": "https://getpreflight.dev"
}
}
}
}
Replace the prefix path with your checkout location. On Windows, use forward slashes or escaped backslashes in the JSON path.
Claude Desktop configuration
{
"mcpServers": {
"preflight": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/preflight/src/sdk/mcp/server.ts"],
"env": {
"PREFLIGHT_API_KEY": "pf_live_...",
"PREFLIGHT_API_URL": "https://getpreflight.dev"
}
}
}
}
Example agent prompts
Once connected, ask your agent:
- “Run a full PreFlight check on my launch project and summarize blockers.”
- “Is the release rule allowing production right now in strict mode?”
- “List open incidents and the suggested fix for each failure.”
- “What is the 7-day uptime SLA for this project?”
The MCP server returns markdown tables and headings so agents can cite probe keys, fix suggestions, and timestamps directly in chat.
Tool reference
run_checks
<PropertyTable rows={[ { name: "projectId", type: "string (UUID)", required: false, description: "Target project. Falls back to PREFLIGHT_PROJECT_ID or single-project auto-discovery.", }, ]} />
Triggers POST /api/v1/projects/:projectId/checks and formats the response with status counts, optional AI diagnosis, and per-probe fix suggestions.
get_deploy_gate
<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 stale checks, Uptime Monitoring failures, payment drift, and provider failures.", }, ]} />
Maps to GET /api/v1/projects/:projectId/deploy-gate.
get_incidents
<PropertyTable rows={[ { name: "projectId", type: "string (UUID)", required: false, description: "Target project UUID.", }, { name: "status", type: "open | acknowledged | resolved | dismissed", required: false, description: "Filter incidents by workflow state.", }, { name: "limit", type: "integer (1–100)", required: false, description: "Maximum rows returned. Defaults to 25.", }, ]} />
Troubleshooting
<RelatedLinks links={[ { href: "/docs/api/authentication", title: "API authentication", description: "Create keys and understand rate limits." }, { href: "/docs/api/overview", title: "API overview", description: "Full REST surface area." }, { href: "/docs/guides/deploy-gates", title: "Release Rules", description: "What strict and relaxed modes require." }, { href: "/docs/getting-started/quick-start", title: "Quick start", description: "Connect providers before your first agent-triggered check." }, ]} />
