The Prefect MCP Server enables AI assistants to interact with Prefect's workflow orchestration platform through natural language via the Model Context Protocol (MCP), providing comprehensive management and monitoring capabilities through 45+ API endpoints.
Core Capabilities:
Flow Management: List, filter, view, and delete flows; query flow runs with extensive filtering (state, deployment, tags, time ranges); control flow run lifecycle (create, restart, cancel, delete, set states); retrieve flow run details and logs
Deployment Operations: List, filter, view, update, and delete deployments; create flow runs from deployments with custom parameters, names, tags, and idempotency keys; manage deployment schedules (view, set cron/interval-based schedules, pause, resume); configure work queue assignments
Task Run Monitoring: List and filter task runs by name, state, tags, and time ranges; retrieve task run details and logs; query task runs by flow run; manually set task run states with optional messages
Work Queue Operations: Create, list, update, pause, resume, and delete work queues; manage concurrency limits and configuration; filter by name or paused status
Variable Management: Create, read, update, and delete variables with support for string, dict, list, or other JSON-serializable values; manage variable tags; filter by name with pagination
Block Management: List available block types with slug-based filtering; retrieve block type schemas; query, retrieve, and delete block documents (configuration instances)
Workspace Management: List accessible workspaces; get current workspace context; retrieve workspace details by ID or handle
Artifact Management: Perform CRUD operations on Prefect artifacts
Automation Control: Create, view, update, delete, pause, and resume automations
System Monitoring: Check Prefect server health status and connectivity; create and retrieve logs for debugging
Key Features: Comprehensive filtering on most operations (tags, names, states, dates), pagination support with limit/offset, UUID-based precise resource targeting, tag-based organization, and state management with custom messages.
Allows AI assistants to interact with Prefect through natural language, providing access to flow management, flow run management, deployment management, task run monitoring, work queue management, block management, variable management, and workspace information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Prefect MCP Servershow me my recent flow runs and their statuses"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Deprecated 27-Nov-2025
I've personally moved my efforts to a more generic OpenAPI spec based MCP: https://github.com/allen-munsch/yas-mcp
Additionally, there is actually an official beta release by prefect over here: https://pypi.org/project/prefect-mcp/
Prefect MCP Server
A Model Context Protocol (MCP) server implementation for Prefect, enabling AI assistants to interact with Prefect through natural language.
Note: The official Prefect MCP server is available here. This is a community implementation.
๐ Quick Start
docker compose upRelated MCP server: n8n MCP Server
๐ฆ Installation
pip Installation
pip install mcp-prefectFrom Source
git clone https://github.com/allen-munsch/mcp-prefect
cd mcp-prefect
pip install -e .Manual Run
PREFECT_API_URL=http://localhost:4200/api \
PREFECT_API_KEY=your_api_key_here \
MCP_PORT=8000 \
python -m mcp_prefect.main --transport http๐ ๏ธ Features
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ _ __ ___ _____ __ __ _____________ ____ ____ โ
โ _ __ ___ .'____/___ ______/ /_/ |/ / ____/ __ \ |___ \ / __ \ โ
โ _ __ ___ / /_ / __ `/ ___/ __/ /|_/ / / / /_/ / ___/ / / / / / โ
โ _ __ ___ / __/ / /_/ (__ ) /_/ / / / /___/ ____/ / __/_/ /_/ / โ
โ _ __ ___ /_/ \____/____/\__/_/ /_/\____/_/ /_____(*)____/ โ
โ โ
โ โ
โ FastMCP 2.0 โ
โ โ
โ โ
โ ๐ฅ๏ธ Server name: MCP Prefect 3.6.1 โ
โ ๐ฆ Transport: STDIO โ
โ โ
โ ๐๏ธ FastMCP version: 2.12.3 โ
โ ๐ค MCP SDK version: 1.14.1 โ
โ โ
โ ๐ Docs: https://gofastmcp.com โ
โ ๐ Deploy: https://fastmcp.cloud โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[11/11/25 02:08:06] INFO Starting MCP server 'MCP Prefect 3.6.1' with transport 'stdio' server.py:1495
โ
Initialized successfully
Server: MCP Prefect 3.6.1 1.14.1
๐ Listing tools...
๐ฏ FOUND 64 TOOLS:
================================================================================
๐ ARTIFACT (6 tools)
๐ง create_artifact
๐ง delete_artifact
๐ง get_artifact
๐ง get_artifacts
๐ง get_latest_artifacts
๐ง update_artifact
๐ AUTOMATION (7 tools)
๐ง create_automation
๐ง delete_automation
๐ง get_automation
๐ง get_automations
๐ง pause_automation
๐ง resume_automation
๐ง update_automation
๐ BLOCK (5 tools)
๐ง delete_block_document
๐ง get_block_document
๐ง get_block_documents
๐ง get_block_type
๐ง get_block_types
๐ DEPLOYMENT (8 tools)
๐ง delete_deployment
๐ง get_deployment
๐ง get_deployment_schedule
๐ง get_deployments
๐ง pause_deployment_schedule
๐ง resume_deployment_schedule
๐ง set_deployment_schedule
๐ง update_deployment
๐ FLOW (13 tools)
๐ง cancel_flow_run
๐ง create_flow_run_from_deployment
๐ง delete_flow
๐ง delete_flow_run
๐ง get_flow
๐ง get_flow_run
๐ง get_flow_run_logs
๐ง get_flow_runs
๐ง get_flow_runs_by_flow
๐ง get_flows
๐ง get_task_runs_by_flow_run
๐ง restart_flow_run
๐ง set_flow_run_state
๐ LOG (2 tools)
๐ง create_log
๐ง get_logs
๐ OTHER (1 tools)
๐ง get_health
๐ TASK (4 tools)
๐ง get_task_run
๐ง get_task_run_logs
๐ง get_task_runs
๐ง set_task_run_state
๐ VARIABLE (5 tools)
๐ง create_variable
๐ง delete_variable
๐ง get_variable
๐ง get_variables
๐ง update_variable
๐ WORK (13 tools)
๐ง create_work_queue
๐ง delete_work_queue
๐ง get_current_workspace
๐ง get_work_queue
๐ง get_work_queue_by_name
๐ง get_work_queue_runs
๐ง get_work_queues
๐ง get_workspace
๐ง get_workspace_by_handle
๐ง get_workspaces
๐ง pause_work_queue
๐ง resume_work_queue
๐ง update_work_queue
๐ TOTAL: 64 tools across 10 categories๐ฌ Example Interactions
AI assistants can help you with:
Flow Management
"Show me all my flows and their last run status"
"Create a new flow run for the 'data-processing' deployment"
"What's the current status of flow run 'abc-123'?"
Deployment Control
"Pause the schedule for the 'daily-reporting' deployment"
"Update the 'etl-pipeline' deployment with new parameters"
Infrastructure Management
"List all work pools and their current status"
"Create a new work queue for high-priority jobs"
Variable & Configuration
"Create a variable called 'api_timeout' with value 300"
"Show me all variables containing 'config' in their name"
Monitoring & Debugging
"Get the logs for the last failed flow run"
"Show me all running task runs right now"
๐ค Platform Integration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"prefect": {
"command": "mcp-prefect",
"args": ["--transport", "stdio"]
}
}
}Cursor MCP
{
"mcpServers": {
"prefect": {
"command": "mcp-prefect",
"args": ["--transport", "stdio"]
}
}
}Gemini CLI
gemini config set mcp-servers.prefect "mcp-prefect --transport stdio"Windsurf / Claude Code
{
"mcpServers": {
"prefect": {
"command": "mcp-prefect",
"args": ["--transport", "stdio"],
"env": {
"PREFECT_API_URL": "http://localhost:4200/api",
"PREFECT_API_KEY": "your_api_key_here"
}
}
}
}Generic MCP Client
{
"mcpServers": {
"prefect": {
"command": "mcp-prefect",
"args": ["--transport", "stdio"],
"env": {
"PREFECT_API_URL": "http://localhost:4200/api",
"PREFECT_API_KEY": "your_api_key_here"
}
}
}
}๐งช Development
Running Tests
pytest tests/ -vBuilding from Source
git clone https://github.com/allen-munsch/mcp-prefect
cd mcp-prefect
pip install -e .
python -m mcp_prefect