Prefect MCP Server
Published · Updated
At a glance
- Category
- Data & analytics
- GitHub repository
- PrefectHQ/prefect-mcp-server
- Watch out for
- The project is experimental and the README warns its APIs and behaviour may change without notice.
PrefectHQ, the company behind the Prefect workflow orchestrator, publishes this server in the open on GitHub and lists it in the official MCP registry as io.github.PrefectHQ/prefect-mcp-server. It is built with FastMCP and is still marked experimental: the README warns that it may change drastically at any time, and the registry entry points to a beta PyPI package, prefect-mcp.
The tools are read-only. An agent can inspect deployments, flow runs, task runs, logs, work pools, events and automations on Prefect Cloud or a self-hosted Prefect server, and it can search the current Prefect documentation through a mounted docs proxy. When a change is needed, the idea is that the agent looks up the right CLI or SDK command and you run it.
You can use it in three ways. Prefect runs a hosted HTTP endpoint at https://prefect.fastmcp.app/mcp that signs in with Prefect Cloud OAuth, which is what the Claude connector and the Claude Code and Codex plugins use. You can also run it locally over stdio with uvx, which reads your Prefect profile, or fork the repo and deploy your own HTTP server.
How it connects
Your AI app
An assistant or agent that supports MCP
Prefect MCP Server
Runs as
- Python (uv / pip)
- Remote (HTTP)
Gives the agent
- Identity and workspaces
- Dashboard overview
- Deployments, flows and runs
- Logs and events
- Infrastructure and automations
- Rate limits and docs
Prefect
Signs in with
- OAuth / browser sign-in
- API key
What it can do
- Identity and workspaces
- get_identity confirms which Prefect target is active, and list_authorized_workspaces shows the workspaces you consented to in Cloud OAuth mode.
- Dashboard overview
- get_dashboard returns flow run statistics and work pool status in one call.
- Deployments, flows and runs
- get_deployments, get_flows, get_flow_runs and get_task_runs query those objects with filtering.
- Logs and events
- get_flow_run_logs pulls execution logs for a flow run, and read_events reads the event stream.
- Infrastructure and automations
- get_work_pools and get_automations show work pool health and configured automations; get_object_schema returns object schemas.
- Rate limits and docs
- review_rate_limits reports Prefect Cloud rate limit usage, and the docs proxy searches current Prefect documentation for CLI and SDK syntax.
Setting it up
For a local setup in Claude Code that reuses the profile in ~/.prefect/profiles.toml, run claude mcp add prefect -- uvx --from prefect-mcp prefect-mcp-server. To pass credentials explicitly, add -e PREFECT_API_URL=https://api.prefect.cloud/api/accounts/[ACCOUNT_ID]/workspaces/[WORKSPACE_ID] and -e PREFECT_API_KEY=your-cloud-api-key before the --; self-hosted servers with basic auth use PREFECT_API_AUTH_STRING instead of the key. To use Prefect's hosted server with OAuth, run claude mcp add prefect --transport http https://prefect.fastmcp.app/mcp, or install the plugin with /plugin marketplace add prefecthq/prefect-mcp-server and /plugin install prefect. The README gives matching configs for Codex (codex mcp add prefect -- uvx --from prefect-mcp prefect-mcp-server), Gemini CLI, Windsurf and VS Code with GitHub Copilot, where the workspace-root .mcp.json takes the same uvx command, args and env values.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Ask why the most recent failed flow run failed and have the agent read its logs and task runs.
- Check which work pools are unhealthy or why a deployment's runs are stuck on concurrency.
- Compare deployment health between staging and production workspaces over OAuth.
- Look up the correct Prefect CLI or SDK syntax for a change before running it yourself.
- Review Prefect Cloud rate limit usage when API calls start getting throttled.
Limitations and things to watch
- The project is experimental and the README warns its APIs and behaviour may change without notice.
- All tools are read-only, so the agent cannot trigger, cancel or edit runs or deployments; it can only suggest commands.
- The hosted plugin endpoint uses Prefect Cloud OAuth and does not read local profiles, so self-hosted Prefect needs the local uvx or your own HTTP deployment.
- In Cloud OAuth mode, workspace-scoped calls must include a workspace_id and only reach workspaces chosen at consent.
- Service-account bearer tokens for unattended agents expire, so long-running agents have to request a new token.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /PrefectHQ/prefect-mcp-server
- github.com /PrefectHQ/prefect-mcp-server/blob/main/src/prefect_mcp_server/server.py
- registry.modelcontextprotocol.io /v0/servers/io.github.PrefectHQ%2Fprefect-mcp-server/versions/latest
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.