prefect-mcp-server
[!WARNING]
This project is under active development and may change drastically at any time.
This is an experimental MCP server for Prefect. APIs, features, and behaviors are subject to change without notice. We encourage you to try it out, provide feedback, and contribute. Please create issues or open PRs with your ideas and suggestions.
An MCP server for interacting with prefect resources.
The server gives MCP clients read-only tools for inspecting Prefect Cloud and self-hosted Prefect instances, plus a docs proxy so assistants can look up current Prefect CLI, SDK, and deployment guidance.
Choose Your Setup
See the agent setup guides for client-specific instructions and setup prompts, or give your agent the plain-text setup index.
| Use case | Recommended setup | Authentication |
|---|
| ChatGPT | Prefect plugin | Prefect Cloud OAuth |
| Claude | Prefect connector | Prefect Cloud OAuth |
| Claude Code or Codex | Prefect plugin for your client | Prefect Cloud OAuth |
| Claude Tag or Cowork | The same Prefect plugin | Organization-managed Prefect Cloud OAuth |
| Local MCP client | uvx stdio server | Active local Prefect profile or env vars |
| Self-hosted Prefect or custom Cloud workspace | Self-hosted HTTP or stdio server | API key, basic auth, env vars, or headers |
| Team-operated shared server | HTTP deployment with per-request headers | User or service-account credentials in headers |
ChatGPT Plugin and Claude Connector
Install the Prefect plugin in ChatGPT
or connect the Prefect connector in Claude.
Sign in to Prefect Cloud and select the workspaces the assistant may read. Both
use Prefect's hosted MCP server; no local installation or API key is required.
In ChatGPT, installing the plugin and connecting your Prefect account are separate
steps. Start a chat with Prefect selected and complete the Connect prompt. If
an existing chat does not discover the newly connected tools, start a fresh chat.
In Claude, connect from the directory listing and approve tool calls when prompted.
Try asking: "Which Prefect workspaces can you access?" Then choose a workspace and
ask: "Why did my most recent failed flow run fail?" The hosted tools inspect runs,
logs, and workspace health and search documentation; they do not change Prefect state.
See the Prefect MCP setup guide
for more connection options.
Claude Code Plugin
The easiest setup for Claude Code is the Prefect plugin:
# add from marketplace
/plugin marketplace add prefecthq/prefect-mcp-server
# install the plugin
/plugin install prefect
This connects Claude to Prefect's hosted, read-only MCP server for diagnostics,
documentation, and current release notes. Claude opens Prefect Cloud OAuth during
installation so you can select the workspaces it may access.
[!NOTE]
The plugin does not read ~/.prefect/profiles.toml or require a local Prefect
installation. For self-hosted Prefect or explicit credentials, use the local
uvx setup below.
Codex Plugin
The same hosted MCP server and workflow guidance are available as a Codex plugin:
# add from marketplace
codex plugin marketplace add prefecthq/prefect-mcp-server
# install the plugin
codex plugin add prefect@prefect
Like the Claude Code plugin, Codex authenticates directly with Prefect Cloud OAuth.
The plugin contains no API keys or placeholder credentials.
If you also configure a local MCP server, give it a distinct name such as
prefect-local. The plugin endpoint uses Prefect Cloud OAuth; a local server uses
the Prefect profile or environment variables available to its process. Call
get_identity before acting on workspace state to confirm which target is active.
The same plugin bundle is suitable for Cowork and Claude Tag because it references
the hosted MCP URL instead of launching a process on the user's machine. Claude Tag
administrators attach it and its Prefect credential to the appropriate Access bundle.
Prefect's privacy policy and
terms and conditions apply to the hosted service.
Run Locally
When running the MCP server locally with stdio transport, it automatically uses your local Prefect configuration from ~/.prefect/profiles.toml if available.