### Start Prefect MCP Server with Docker Compose Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Use this command to quickly start the Prefect MCP Server using Docker Compose. Ensure Docker is installed and running. ```bash docker compose up ``` -------------------------------- ### Install MCP Prefect Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Install the MCP Prefect package from PyPI or build from source. ```bash pip install mcp-prefect ``` ```bash git clone https://github.com/allen-munsch/mcp-prefect cd mcp-prefect pip install -e . ``` -------------------------------- ### Build and Install MCP Prefect from Source Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Clone the repository, navigate into the directory, install the package in editable mode, and run the mcp_prefect module. ```bash git clone https://github.com/allen-munsch/mcp-prefect cd mcp-prefect pip install -e . python -m mcp_prefect ``` -------------------------------- ### Install mcp-prefect from Source Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Install the Prefect MCP Server directly from its GitHub repository. This is useful for development or if you need the latest unreleased changes. ```bash git clone https://github.com/allen-munsch/mcp-prefect cd mcp-prefect pip install -e . ``` -------------------------------- ### Install Dev Dependencies Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Installs development dependencies using uv pip. Ensure you have uv installed. ```bash uv pip install -e ".[dev"] ``` -------------------------------- ### Start Prefect Server Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Starts the Prefect server in detached mode using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Install mcp-prefect via pip Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Install the Prefect MCP Server package using pip. This is the recommended method for most users. ```bash pip install mcp-prefect ``` -------------------------------- ### Install Dependencies and Run Tests Source: https://github.com/allen-munsch/mcp-prefect/blob/main/tests/README.md Installs project dependencies in editable mode with development extras and then runs pytest tests. Ensure Docker is running for any containerized services. ```bash uv pip install -e ".[dev]" docker compose up pytest -svvl tests/ ``` -------------------------------- ### Run MCP Prefect Server Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Start the MCP Prefect server using Docker Compose or manually with environment variables. ```bash docker compose up ``` ```bash PREFECT_API_URL=http://localhost:4200/api \ PREFECT_API_KEY=your_api_key_here \ MCP_PORT=8000 \ python -m mcp_prefect.main --transport http ``` -------------------------------- ### Get Deployment Details Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves detailed information about a specific deployment. Use this to inspect schedule configuration, parameters, and other settings. ```python # MCP Tool Call - Get deployment details await get_deployment(deployment_id="deploy-123-xyz") # Response: # { # "id": "deploy-123-xyz", # "name": "daily-etl", # "flow_id": "flow-abc...", # "parameters": {"batch_size": 1000}, # "schedule": {"cron": "0 6 * * *", "timezone": "UTC"}, # "is_schedule_active": true, # "work_queue_name": "default", # "ui_url": "http://localhost:4200/deployments/deploy-123-xyz" # } ``` -------------------------------- ### Get Deployment Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves detailed information about a specific deployment including schedule configuration and parameters. ```APIDOC ## get_deployment ### Description Retrieves detailed information about a specific deployment including schedule configuration and parameters. ### Method GET (assumed, based on action) ### Endpoint /deployments/{deployment_id} ### Parameters #### Path Parameters - **deployment_id** (string) - Required - The ID of the deployment to retrieve. ### Response #### Success Response (200) - **id** (string) - The deployment ID. - **name** (string) - The deployment name. - **flow_id** (string) - The ID of the associated flow. - **parameters** (object) - The default parameters for the deployment. - **schedule** (object) - The schedule configuration. - **cron** (string) - The cron expression if applicable. - **timezone** (string) - The timezone for the schedule. - **is_schedule_active** (boolean) - Whether the schedule is active. - **work_queue_name** (string) - The name of the work queue. - **ui_url** (string) - The URL to the deployment in the UI. ### Request Example ```json { "deployment_id": "deploy-123-xyz" } ``` ### Response Example ```json { "id": "deploy-123-xyz", "name": "daily-etl", "flow_id": "flow-abc...", "parameters": {"batch_size": 1000}, "schedule": {"cron": "0 6 * * *", "timezone": "UTC"}, "is_schedule_active": true, "work_queue_name": "default", "ui_url": "http://localhost:4200/deployments/deploy-123-xyz" } ``` ``` -------------------------------- ### Get Block Types Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists available block types in the Prefect instance with optional limit. ```APIDOC ## GET /block-types ### Description Lists available block types in the Prefect instance. ### Method GET ### Endpoint /block-types ### Query Parameters - **limit** (integer) - Optional - The maximum number of block types to return. ### Response #### Success Response (200) - **block_types** (array) - A list of block type objects. - **id** (string) - The unique identifier of the block type. - **name** (string) - The name of the block type. - **slug** (string) - The slug identifier for the block type. ### Response Example ```json { "block_types": [ {"id": "bt-123...", "name": "Slack Webhook", "slug": "slack-webhook"}, {"id": "bt-456...", "name": "S3 Bucket", "slug": "s3-bucket"} ] } ``` ``` -------------------------------- ### Get Variable by Name Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves a specific variable by its name. Use this to get the current value and metadata of a particular variable. ```python # MCP Tool Call - Get variable by name await get_variable(name="api_timeout") # Response: # { # "id": "var-123...", # "name": "api_timeout", # "value": 300, # "tags": ["config"], # "created": "2024-01-15T10:00:00Z", # "updated": "2024-01-18T14:30:00Z" # } ``` -------------------------------- ### Get Variables Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists variables with optional filtering by name pattern. ```APIDOC ## get_variables ### Description Lists variables with optional filtering by name pattern. ### Method GET (assumed, based on action) ### Endpoint /variables ### Parameters #### Query Parameters - **name** (string) - Optional - Filter variables by name (supports pattern matching). - **limit** (integer) - Optional - The maximum number of variables to return. ### Response #### Success Response (200) - **variables** (array) - A list of variable objects. - **id** (string) - The variable ID. - **name** (string) - The variable name. - **value** (any) - The variable value (JSON-serializable). - **tags** (array of strings) - Tags associated with the variable. - **created** (string) - Timestamp of creation (ISO 8601 format). ### Request Example ```json { "limit": 20 } ``` ### Request Example (with name filter) ```json { "name": "config", "limit": 10 } ``` ### Response Example ```json { "variables": [ { "id": "var-123...", "name": "api_timeout", "value": 300, "tags": ["config"], "created": "2024-01-15T10:00:00Z" } ] } ``` ``` -------------------------------- ### Get Automations (Prefect Cloud Only) Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists automations with filtering by name and enabled status. This function is specific to Prefect Cloud. ```python # MCP Tool Call - Get automations await get_automations(name="*", enabled=True) ``` -------------------------------- ### Prefect MCP Server Initialization Log Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Log message indicating the successful start of the MCP server with its name and transport protocol. It also confirms successful initialization. ```text [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 ``` -------------------------------- ### Get Artifacts Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists artifacts with filtering by flow run, task run, type, or key. ```APIDOC ## GET /artifacts ### Description Lists artifacts with filtering by flow run, task run, type, or key. ### Method GET ### Endpoint /artifacts ### Query Parameters - **flow_run_id** (string) - Optional - Filter artifacts by flow run ID. - **task_run_id** (string) - Optional - Filter artifacts by task run ID. - **artifact_type** (string) - Optional - Filter artifacts by type (e.g., "table", "markdown"). - **key** (string) - Optional - Filter artifacts by key. - **limit** (integer) - Optional - The maximum number of artifacts to return. ### Response #### Success Response (200) - **artifacts** (array) - A list of artifact objects. - **id** (string) - The unique identifier for the artifact. - **key** (string) - The key of the artifact. - **type** (string) - The type of the artifact (e.g., "table", "markdown"). - **data** (object/string) - The artifact data. - **flow_run_id** (string) - The ID of the flow run the artifact belongs to. - **task_run_id** (string) - The ID of the task run the artifact belongs to. ### Response Example ```json { "artifacts": [ { "id": "artifact-123...", "key": "data-summary", "type": "table", "data": {"columns": ["metric", "value"], "rows": [...]}, "flow_run_id": "run-123-abc" } ] } ``` ``` -------------------------------- ### Get Enabled Automations Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves a list of enabled automations with optional limit. ```APIDOC ## GET /automations ### Description Retrieves a list of enabled automations. ### Method GET ### Endpoint /automations ### Query Parameters - **enabled** (boolean) - Optional - Filter for enabled automations. - **limit** (integer) - Optional - The maximum number of automations to return. ### Response #### Success Response (200) - **automations** (array) - A list of automation objects. - **id** (string) - The unique identifier of the automation. - **name** (string) - The name of the automation. - **enabled** (boolean) - Whether the automation is enabled. - **trigger** (object) - The trigger configuration for the automation. - **actions** (array) - A list of actions to perform when the trigger fires. ### Response Example ```json { "automations": [ { "id": "auto-123...", "name": "Notify on Failure", "enabled": true, "trigger": {"type": "flow_run_state_change", "state": "FAILED"}, "actions": [{"type": "send_notification", "channel": "slack"}] } ] } ``` ``` -------------------------------- ### Get Variable Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves a specific variable by its name. ```APIDOC ## get_variable ### Description Retrieves a specific variable by its name. ### Method GET (assumed, based on action) ### Endpoint /variables/{name} ### Parameters #### Path Parameters - **name** (string) - Required - The name of the variable to retrieve. ### Response #### Success Response (200) - **id** (string) - The variable ID. - **name** (string) - The variable name. - **value** (any) - The variable value (JSON-serializable). - **tags** (array of strings) - Tags associated with the variable. - **created** (string) - Timestamp of creation (ISO 8601 format). - **updated** (string) - Timestamp of last update (ISO 8601 format). ### Request Example ```json { "name": "api_timeout" } ``` ### Response Example ```json { "id": "var-123...", "name": "api_timeout", "value": 300, "tags": ["config"], "created": "2024-01-15T10:00:00Z", "updated": "2024-01-18T14:30:00Z" } ``` ``` -------------------------------- ### Get Deployments Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists deployments with filtering by flow name, deployment name, tags, schedule status, and work queue. ```APIDOC ## get_deployments ### Description Lists deployments with filtering by flow name, deployment name, tags, schedule status, and work queue. ### Method GET (assumed, based on action) ### Endpoint /deployments ### Parameters #### Query Parameters - **flow_name** (string) - Optional - Filter by flow name. - **deployment_name** (string) - Optional - Filter by deployment name. - **tags** (array of strings) - Optional - Filter by tags. - **is_schedule_active** (boolean) - Optional - Filter by schedule active status. - **work_queue_name** (string) - Optional - Filter by work queue name. - **limit** (integer) - Optional - The maximum number of deployments to return. ### Response #### Success Response (200) - **deployments** (array) - A list of deployment objects. - **id** (string) - The deployment ID. - **name** (string) - The deployment name. - **flow_id** (string) - The ID of the associated flow. - **is_schedule_active** (boolean) - Whether the schedule is active. - **schedule** (object) - The schedule configuration. - **cron** (string) - The cron expression if applicable. - **timezone** (string) - The timezone for the schedule. - **ui_url** (string) - The URL to the deployment in the UI. ### Request Example ```json { "is_schedule_active": true, "limit": 10 } ``` ### Request Example (with tags) ```json { "flow_name": "data-processing", "tags": ["production"] } ``` ### Response Example ```json { "deployments": [ { "id": "deploy-123...", "name": "daily-etl", "flow_id": "flow-abc...", "is_schedule_active": true, "schedule": {"cron": "0 6 * * *"}, "ui_url": "http://localhost:4200/deployments/deploy-123..." } ] } ``` ``` -------------------------------- ### Get Deployments Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists deployments with filtering capabilities. Useful for finding active deployments or deployments matching specific criteria like flow name or tags. ```python # MCP Tool Call - Get active deployments await get_deployments(is_schedule_active=True, limit=10) # Response: # { # "deployments": [ # { # "id": "deploy-123...", # "name": "daily-etl", # "flow_id": "flow-abc...", # "is_schedule_active": true, # "schedule": {"cron": "0 6 * * *"}, # "ui_url": "http://localhost:4200/deployments/deploy-123..." # } # ] # } ``` ```python # Get deployments by flow name await get_deployments(flow_name="data-processing", tags=["production"]) ``` -------------------------------- ### Get Prefect Flow Runs Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt List Prefect flow runs with filtering by state, deployment, tags, and time ranges. The response includes UI URLs. ```python # MCP Tool Call - Get running flow runs await get_flow_runs(state_type="RUNNING", limit=10) ``` ```python # Get failed flow runs for a specific deployment await get_flow_runs( deployment_id="deploy-456...", state_type="FAILED", start_time_after="2024-01-15T00:00:00Z", limit=20 ) ``` ```python # Get flow runs by flow name await get_flow_runs(flow_name="etl-pipeline", limit=5) ``` -------------------------------- ### Get Variables Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists variables with optional filtering by name pattern. Useful for retrieving configuration values or other stored data. ```python # MCP Tool Call - Get all variables await get_variables(limit=20) # Response: # { # "variables": [ # { # "id": "var-123...", # "name": "api_timeout", # "value": 300, # "tags": ["config"], # "created": "2024-01-15T10:00:00Z" # } # ] # } ``` ```python # Filter variables by name await get_variables(name="config", limit=10) ``` -------------------------------- ### Get Automations (Prefect Cloud Only) Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists automations with filtering by name and enabled status. This endpoint is only available in Prefect Cloud. ```APIDOC ## GET /automations ### Description Lists automations with filtering by name and enabled status. This endpoint is only available in Prefect Cloud. ### Method GET ### Endpoint /automations ### Query Parameters - **name** (string) - Optional - Filter automations by name. - **is_enabled** (boolean) - Optional - Filter automations by enabled status. - **limit** (integer) - Optional - The maximum number of automations to return. ### Response #### Success Response (200) - **automations** (array) - A list of automation objects. - **id** (string) - The unique identifier for the automation. - **name** (string) - The name of the automation. - **is_enabled** (boolean) - Indicates if the automation is enabled. - **description** (string) - Description of the automation. ### Response Example ```json { "automations": [ { "id": "auto-123...", "name": "High CPU Alert", "is_enabled": true, "description": "Alerts when CPU usage exceeds 90%" } ] } ``` ``` -------------------------------- ### Get Work Queues Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists work queues with filtering by name, paused status, and work pool. ```APIDOC ## GET /work_queues ### Description Lists work queues with filtering by name, paused status, and work pool. ### Method GET ### Endpoint /work_queues ### Query Parameters - **name** (string) - Optional - Filter work queues by name. - **is_paused** (boolean) - Optional - Filter work queues by paused status. - **work_pool_name** (string) - Optional - Filter work queues by work pool name. - **limit** (integer) - Optional - The maximum number of work queues to return. ### Response #### Success Response (200) - **work_queues** (array) - A list of work queue objects. - **id** (string) - The unique identifier for the work queue. - **name** (string) - The name of the work queue. - **is_paused** (boolean) - Indicates if the work queue is paused. - **concurrency_limit** (integer) - The concurrency limit for the work queue. - **work_pool_name** (string) - The name of the work pool the queue belongs to. ### Response Example ```json { "work_queues": [ { "id": "queue-123...", "name": "default", "is_paused": false, "concurrency_limit": 10, "work_pool_name": "default-pool" } ] } ``` ``` -------------------------------- ### Get Block Documents Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves configured block instances by block type slug. Use to find specific block configurations, like Slack webhooks. ```python await get_block_documents( block_type_slug="slack-webhook", limit=10 ) ``` -------------------------------- ### Get Task Runs Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists task runs with filtering by task name, state, tags, and time ranges. ```APIDOC ## get_task_runs ### Description Lists task runs with filtering by task name, state, tags, and time ranges. ### Method GET (assumed, based on action) ### Endpoint /task_runs ### Parameters #### Query Parameters - **task_name** (string) - Optional - Filter by task name. - **state_type** (string) - Optional - Filter by state type (e.g., FAILED, RUNNING, COMPLETED). - **tags** (array of strings) - Optional - Filter by tags. - **start_time_min** (string) - Optional - Filter by minimum start time (ISO 8601 format). - **start_time_max** (string) - Optional - Filter by maximum start time (ISO 8601 format). - **end_time_min** (string) - Optional - Filter by minimum end time (ISO 8601 format). - **end_time_max** (string) - Optional - Filter by maximum end time (ISO 8601 format). - **limit** (integer) - Optional - The maximum number of task runs to return. ### Response #### Success Response (200) - **task_runs** (array) - A list of task run objects. - **id** (string) - The task run ID. - **name** (string) - The task name. - **state** (object) - The state of the task run. - **type** (string) - The type of the state. - **tags** (array of strings) - Tags associated with the task run. - **start_time** (string) - Timestamp of when the task run started (ISO 8601 format). - **end_time** (string) - Timestamp of when the task run ended (ISO 8601 format). ### Request Example ```json { "state_type": "FAILED", "limit": 10 } ``` ### Response Example ```json { "task_runs": [ { "id": "task-run-123...", "name": "process_data", "state": {"type": "FAILED"}, "tags": ["data-quality"], "start_time": "2024-01-18T10:00:00Z", "end_time": "2024-01-18T10:05:00Z" } ] } ``` ``` -------------------------------- ### Get Enabled Automations Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves a list of enabled automations with optional limit. Useful for monitoring active automation rules. ```python await get_automations(enabled=True, limit=10) ``` -------------------------------- ### Get Block Documents Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves block documents (configured block instances) by type with optional limit. ```APIDOC ## GET /block-documents ### Description Retrieves block documents (configured block instances) by type. ### Method GET ### Endpoint /block-documents ### Query Parameters - **block_type_slug** (string) - Required - The slug of the block type to filter by. - **limit** (integer) - Optional - The maximum number of block documents to return. ### Response #### Success Response (200) - **block_documents** (array) - A list of block document objects. - **id** (string) - The unique identifier of the block document. - **name** (string) - The name of the block document. - **block_type_slug** (string) - The slug of the block type. ### Response Example ```json { "block_documents": [ { "id": "block-123...", "name": "team-notifications", "block_type_slug": "slack-webhook" } ] } ``` ``` -------------------------------- ### Get Specific Prefect Flow Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieve detailed information for a specific Prefect flow using its UUID. The response includes the UI URL. ```python # MCP Tool Call - Get specific flow details await get_flow(flow_id="abc123-def456-ghi789") ``` -------------------------------- ### Get Prefect Flows Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieve a list of Prefect flows, with options to filter by name, tags, and creation date. The response includes UI URLs for direct access. ```python # MCP Tool Call - Get all flows await get_flows(limit=10) ``` ```python # Get flows by name pattern await get_flows(flow_name="etl", tags=["production"], limit=5) ``` ```python # Get flows created after a specific date await get_flows(created_after="2024-01-01T00:00:00Z", limit=20) ``` -------------------------------- ### Get Specific Prefect Flow Run Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieve detailed information about a specific Prefect flow run, including its state, timing, and parameters. The response includes the UI URL. ```python # MCP Tool Call - Get flow run details await get_flow_run(flow_run_id="run-123-abc-def") ``` -------------------------------- ### Get Artifacts Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists artifacts with filtering by flow run, task run, type, or key. Useful for retrieving stored data, tables, or markdown content. ```python # MCP Tool Call - Get artifacts for a flow run await get_artifacts( flow_run_id="run-123-abc", artifact_type="table", limit=10 ) # Response: # { # "artifacts": [ # { # "id": "artifact-123...", # "key": "data-summary", # "type": "table", # "data": {"columns": ["metric", "value"], "rows": [...]}, # "flow_run_id": "run-123-abc" # } # ] # } ``` -------------------------------- ### Get Task Runs Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists task runs with filtering by task name, state, tags, and time ranges. Useful for monitoring task execution and debugging. ```python # MCP Tool Call - Get failed task runs await get_task_runs(state_type="FAILED", limit=10) # Response: # { # "task_runs": [ # { ``` -------------------------------- ### Get Task Run Logs Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves logs for a specific task run, with optional filtering by log level. Useful for debugging individual task executions. ```python # MCP Tool Call - Get task run logs await get_task_run_logs( task_run_id="task-123-abc", limit=50, level=30 # WARNING level and above ) # Response: # { # "task_run_logs": [ # {"timestamp": "2024-01-20T14:05:00Z", "level": 30, "message": "Slow response from API", "name": "prefect.task"} # ] # } ``` -------------------------------- ### Running Tests Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Instructions for setting up the development environment and running tests for MCP Prefect. ```APIDOC ## Running Tests ### Description Instructions to install dependencies, start the Prefect server, and run tests. ### Commands 1. **Install dev dependencies** ```bash uv pip install -e ".[dev]" ``` 2. **Start Prefect server** ```bash docker compose up -d ``` 3. **Run tests** ```bash pytest -svvl tests/ ``` ``` -------------------------------- ### Prefect MCP Server Tool Listing Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Output showing the total number of tools available and a categorized list of tools supported by the Prefect MCP Server, including Artifact, Automation, Block, Deployment, Flow, Log, Other, Task, Variable, and Work. ```text 🔄 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 ``` -------------------------------- ### Get Health Status Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Checks the health status of the connected Prefect server. ```APIDOC ## GET /health ### Description Checks the health status of the connected Prefect server. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - The health status of the server (e.g., "OK"). ### Response Example ``` "OK" ``` ``` -------------------------------- ### Platform Integration - Cursor / Windsurf Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Configuration for integrating MCP Prefect into IDEs like Cursor and Windsurf via MCP. ```APIDOC ## MCP Configuration for Cursor / Windsurf ### Description Add MCP Prefect to your IDE's MCP configuration. ### Configuration ```json { "mcpServers": { "prefect": { "command": "mcp-prefect", "args": ["--transport", "stdio"], "env": { "PREFECT_API_URL": "http://localhost:4200/api", "PREFECT_API_KEY": "your_api_key_here" } } } } ``` ``` -------------------------------- ### Create Work Queue Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Creates a new work queue with optional configuration. ```APIDOC ## POST /work_queues ### Description Creates a new work queue with optional configuration. ### Method POST ### Endpoint /work_queues ### Request Body - **name** (string) - Required - The name of the new work queue. - **description** (string) - Optional - A description for the work queue. - **concurrency_limit** (integer) - Optional - The concurrency limit for the work queue. - **work_pool_name** (string) - Optional - The name of the work pool to associate with the queue. ### Request Example ```json { "name": "high-priority", "description": "Queue for high-priority jobs", "concurrency_limit": 5, "work_pool_name": "production-pool" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the newly created work queue. - **name** (string) - The name of the work queue. - **description** (string) - The description of the work queue. - **concurrency_limit** (integer) - The concurrency limit for the work queue. - **is_paused** (boolean) - Indicates if the work queue is paused (defaults to false). ### Response Example ```json { "id": "queue-new-123...", "name": "high-priority", "description": "Queue for high-priority jobs", "concurrency_limit": 5, "is_paused": false } ``` ``` -------------------------------- ### Configure Gemini CLI for MCP Prefect Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Use this command to set up the Gemini CLI for MCP Prefect integration, specifying the command and transport protocol. ```bash gemini config set mcp-servers.prefect "mcp-prefect --transport stdio" ``` -------------------------------- ### Create Prefect Flow Run from Deployment Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Trigger a new Prefect flow run from an existing deployment. Supports specifying parameters, name, and tags. ```python # MCP Tool Call - Create flow run from deployment await create_flow_run_from_deployment( deployment_id="deploy-456-xyz", parameters={"batch_size": 500, "environment": "staging"}, name="manual-trigger-20240120", tags=["manual", "test"] ) ``` ```python # Simple trigger without parameters await create_flow_run_from_deployment(deployment_id="deploy-456-xyz") ``` -------------------------------- ### Get Task Run Logs Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves logs for a specific task run with optional level filtering. ```APIDOC ## GET /task_runs/{task_run_id}/logs ### Description Retrieves logs for a specific task run with optional level filtering. ### Method GET ### Endpoint /task_runs/{task_run_id}/logs ### Path Parameters - **task_run_id** (string) - Required - The ID of the task run. ### Query Parameters - **limit** (integer) - Optional - The maximum number of log entries to return. - **level** (integer) - Optional - Filter logs by level (e.g., 30 for WARNING and above). ### Response #### Success Response (200) - **task_run_logs** (array) - A list of log entries. - **timestamp** (string) - The timestamp of the log entry. - **level** (integer) - The log level. - **message** (string) - The log message. - **name** (string) - The name associated with the log entry. ### Response Example ```json { "task_run_logs": [ {"timestamp": "2024-01-20T14:05:00Z", "level": 30, "message": "Slow response from API", "name": "prefect.task"} ] } ``` ``` -------------------------------- ### Configure Claude Desktop for MCP Prefect Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Add this configuration to your 'claude_desktop_config.json' to enable MCP Prefect integration. It specifies the command and transport protocol. ```json { "mcpServers": { "prefect": { "command": "mcp-prefect", "args": ["--transport", "stdio"] } } } ``` -------------------------------- ### Get Flow Run Logs Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves logs for a specific flow run with optional level filtering. ```APIDOC ## GET /flow_runs/{flow_run_id}/logs ### Description Retrieves logs for a specific flow run with optional level filtering. ### Method GET ### Endpoint /flow_runs/{flow_run_id}/logs ### Path Parameters - **flow_run_id** (string) - Required - The ID of the flow run. ### Query Parameters - **limit** (integer) - Optional - The maximum number of log entries to return. - **level** (integer) - Optional - Filter logs by level (e.g., 20 for INFO and above). ### Response #### Success Response (200) - **flow_run_logs** (array) - A list of log entries. - **timestamp** (string) - The timestamp of the log entry. - **level** (integer) - The log level. - **message** (string) - The log message. - **name** (string) - The name associated with the log entry. ### Response Example ```json { "flow_run_logs": [ {"timestamp": "2024-01-20T14:00:00Z", "level": 20, "message": "Starting flow...", "name": "prefect.flow"}, {"timestamp": "2024-01-20T14:00:01Z", "level": 20, "message": "Processing batch 1...", "name": "prefect.task"}, {"timestamp": "2024-01-20T14:15:00Z", "level": 20, "message": "Flow completed successfully", "name": "prefect.flow"} ] } ``` ``` -------------------------------- ### Platform Integration - Claude Desktop Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Configuration for integrating MCP Prefect with Claude Desktop for AI-powered workflow management. ```APIDOC ## MCP Configuration for Claude Desktop ### Description Configure MCP Prefect within Claude Desktop. ### Configuration ```json { "mcpServers": { "prefect": { "command": "mcp-prefect", "args": ["--transport", "stdio"], "env": { "PREFECT_API_URL": "http://localhost:4200/api", "PREFECT_API_KEY": "your_api_key_here" } } } } ``` ``` -------------------------------- ### Create Work Queue Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Creates a new work queue with optional configuration such as name, description, concurrency limit, and work pool. Useful for setting up dedicated queues for specific job types. ```python # MCP Tool Call - Create work queue await create_work_queue( name="high-priority", description="Queue for high-priority jobs", concurrency_limit=5, work_pool_name="production-pool" ) # Response: # { # "id": "queue-new-123...", # "name": "high-priority", # "description": "Queue for high-priority jobs", # "concurrency_limit": 5, # "is_paused": false # } ``` -------------------------------- ### Create Automation Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Creates a new automation with specified triggers, actions, and description. Use for setting up event-driven workflow responses. ```python await create_automation( name="Alert on ETL Failure", enabled=True, trigger={ "type": "flow_run_state_change", "match": {"prefect.resource.name": "daily-etl"}, "to_state": {"type": "FAILED"} }, actions=[ {"type": "send_notification", "block_document_id": "slack-block-id"} ], description="Alerts the team when daily ETL fails" ) ``` -------------------------------- ### Manually Run Prefect MCP Server Source: https://github.com/allen-munsch/mcp-prefect/blob/main/README.md Run the Prefect MCP Server manually from the command line. You need to set environment variables for Prefect API URL, API Key, and the MCP port. ```bash PREFECT_API_URL=http://localhost:4200/api \ PREFECT_API_KEY=your_api_key_here \ MCP_PORT=8000 \ python -m mcp_prefect.main --transport http ``` -------------------------------- ### Create Automation Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Creates a new automation with specified triggers and actions. This feature is available for Prefect Cloud only. ```APIDOC ## POST /automations ### Description Creates a new automation with triggers and actions. ### Method POST ### Endpoint /automations ### Request Body - **name** (string) - Required - The name of the automation. - **enabled** (boolean) - Required - Whether the automation is enabled. - **trigger** (object) - Required - The trigger configuration. - **type** (string) - Required - The type of trigger (e.g., "flow_run_state_change"). - **match** (object) - Optional - Criteria to match for the trigger. - **to_state** (object) - Optional - The target state for state change triggers. - **actions** (array) - Required - A list of actions to perform. - **type** (string) - Required - The type of action (e.g., "send_notification"). - **block_document_id** (string) - Required - The ID of the block document to use for the action. - **description** (string) - Optional - A description for the automation. ### Request Example ```json { "name": "Alert on ETL Failure", "enabled": true, "trigger": { "type": "flow_run_state_change", "match": {"prefect.resource.name": "daily-etl"}, "to_state": {"type": "FAILED"} }, "actions": [ {"type": "send_notification", "block_document_id": "slack-block-id"} ], "description": "Alerts the team when daily ETL fails" } ``` ``` -------------------------------- ### Set Deployment Schedule Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Configures a cron or interval-based schedule for a deployment. Use this to define when a deployment should automatically run. ```python # MCP Tool Call - Set cron schedule await set_deployment_schedule( deployment_id="deploy-123-xyz", cron="0 6 * * *", timezone="America/New_York" ) # Response: {"cron": "0 6 * * *", "timezone": "America/New_York"} ``` ```python # Set interval schedule (every 30 minutes) await set_deployment_schedule( deployment_id="deploy-123-xyz", interval_seconds=1800, anchor_date="2024-01-01T00:00:00Z", timezone="UTC" ) ``` -------------------------------- ### List Block Types Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Lists available block types in the Prefect instance. Useful for discovering configurable components. ```python await get_block_types(limit=20) ``` -------------------------------- ### Get Task Runs Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Retrieves task runs, with options to filter by name pattern, state type, and limit the number of results. ```APIDOC ## GET /task_runs ### Description Retrieves task runs, with options to filter by name pattern, state type, and limit the number of results. ### Method GET ### Endpoint /task_runs ### Query Parameters - **task_name** (string) - Optional - Filter task runs by name pattern. - **state_type** (string) - Optional - Filter task runs by state type (e.g., "COMPLETED", "FAILED"). - **limit** (integer) - Optional - The maximum number of task runs to return. ### Response #### Success Response (200) - **task_runs** (array) - A list of task run objects. - **id** (string) - The unique identifier for the task run. - **name** (string) - The name of the task run. - **flow_run_id** (string) - The ID of the flow run this task belongs to. - **state_type** (string) - The state type of the task run (e.g., "FAILED", "COMPLETED"). - **state_name** (string) - The name of the task run state. - **ui_url** (string) - The URL to view the task run in the UI. ### Response Example ```json { "task_runs": [ { "id": "task-123...", "name": "extract_data", "flow_run_id": "run-abc...", "state_type": "FAILED", "state_name": "Failed", "ui_url": "http://localhost:4200/task-runs/task-123..." } ] } ``` ``` -------------------------------- ### Create Log Source: https://context7.com/allen-munsch/mcp-prefect/llms.txt Creates a log entry associated with a flow run or task run. ```APIDOC ## POST /logs ### Description Creates a log entry associated with a flow run or task run. ### Method POST ### Endpoint /logs ### Request Body - **message** (string) - Required - The log message. - **level** (integer) - Required - The log level (e.g., 30 for WARNING). - **flow_run_id** (string) - Optional - The ID of the flow run to associate the log with. - **task_run_id** (string) - Optional - The ID of the task run to associate the log with. - **name** (string) - Optional - A name for the log entry. ### Request Example ```json { "message": "Manual intervention: Skipped validation step", "level": 30, "flow_run_id": "run-123-abc", "name": "prefect.manual" } ``` ### Response #### Success Response (201) - **message** (string) - Confirmation message. ### Response Example ``` "Log created successfully." ``` ```