> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended**:
> ```bash
> npx @scalekit-inc/cli setup
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the Prefect MCP server

The Prefect MCP connector routes your AI agent's tool calls to Prefect's own MCP server through Scalekit. Each user signs in to Prefect once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 15 tools.

**Authentication:** OAuth2.1/DCR
**Categories:** Automation, Developer Tools, Monitoring, Project Management
**Tools:** 15: 15 read, 0 write, 0 destructive
**Users sign in with:** OAuth
**OAuth app:** Your own Prefect MCP server app
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=PREFECTMCP)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Prefect MCP connection

   In **AgentKit > Connections**, create a Prefect MCP connection and copy its redirect URI. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Register an OAuth app

   Prefect MCP server connections use your own OAuth app. Register one with Prefect MCP server and add the redirect URI you copied.

   Then enter the app's Client ID and Client Secret on the Prefect MCP connection.

5. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'prefectmcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Prefect MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'prefectmcp_docs_get_release_notes',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "prefectmcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Prefect MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="prefectmcp_docs_get_release_notes",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'prefectmcp_docs_get_release_notes',
  toolInput: {},
  connector: 'prefectmcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="prefectmcp_docs_get_release_notes",
    tool_input={},
    connection_name="prefectmcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `prefectmcp_docs_get_release_notes`

Get Prefect Release Notes · Read-only

Get authoritative, structured release notes for a Prefect OSS release.

Accepts "latest" or an exact version and returns the release title, date,
Markdown notes, and source URL.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `version` (`string`, optional): 'latest' for the latest stable Prefect OSS release, or an exact version such as '3.7.8'. Default: `latest`.

Example input: `{}`

### `prefectmcp_docs_search_prefect`

Search Prefect Documentation · Read-only

Search Prefect documentation for concepts, examples, and best practices.

Returns ranked excerpts from Prefect's knowledge base for a natural-language
query.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): a search query to find relevant document excerpts from Prefect's knowledgebase
- `top_k` (`integer`, optional): How many document excerpts to return.

Example input: `{"query":"<query>"}`

### `prefectmcp_get_automations`

Get Automations · Read-only

Get automations with optional filters.

Returns compact summaries by default (trigger_type, action_count).
Filter by specific ID(s) for full detail including trigger config,
actions, actions_on_trigger, and actions_on_resolve.

Filter operators:
- id.any_: Match specific automation IDs
- name.any_: Match automation names
- enabled.eq_: Filter by enabled state

Examples:
    - List all automations: get_automations()
    - Full detail: get_automations(filter={"id": {"any_": ["<automation-id>"]}})
    - Get by name: get_automations(filter={"name": {"any_": ["my-automation"]}})
    - Only enabled: get_automations(filter={"enabled": {"eq_": True}})

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).
- `filter` (`object`, optional): JSON filter object for advanced querying. Supports all Prefect AutomationFilter fields.
- `limit` (`integer`, optional): Maximum number of automations to return. Default: `100`.

Example input: `{"workspace_id":"<workspace_id>"}`

### `prefectmcp_get_dashboard`

Get Dashboard · Read-only

Get a high-level dashboard overview of the Prefect instance.

Returns current flow run statistics, work pool status, and all active
concurrency limits (global/tag-based, deployment, work pool, and work queue).
Essential for diagnosing flow run delays and bottlenecks.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).

Example input: `{"workspace_id":"<workspace_id>"}`

### `prefectmcp_get_deployments`

Get Deployments · Read-only

Get deployments with optional filters.

Returns compact summaries by default. Filter by specific ID(s) for full
detail including parameters, parameter_openapi_schema, job_variables,
work_pool details, and recent_runs.

The response includes truncated=true when more matching records exist.

Filter operators:
- any_: Match any value in list
- all_: Match all values
- like_: SQL LIKE pattern matching
- not_any_: Exclude values
- is_null_: Check for null/not null
- eq_/ne_: Equality comparisons

Examples:
    - List all deployments: get_deployments()
    - Full detail: get_deployments(filter={"id": {"any_": ["<deployment-id>"]}})
    - Active deployments: get_deployments(filter={"paused": {"eq_": False}})
    - Production deployments: get_deployments(filter={"tags": {"all_": ["production"]}})

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).
- `filter` (`object`, optional): JSON filter object for advanced querying. Supports all Prefect DeploymentFilter fields.
- `limit` (`integer`, optional): Maximum number of deployments to return. Default: `50`.

Example input: `{"workspace_id":"<workspace_id>"}`

### `prefectmcp_get_flow_run_logs`

Get Flow Run Logs · Read-only

Get execution logs for a flow run.

Retrieves log entries from the flow run execution,
including timestamps, log levels, and messages.

Examples:
    - Get logs: get_flow_run_logs(flow_run_id="...")
    - Get more logs: get_flow_run_logs(flow_run_id="...", limit=500)

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `flow_run_id` (`string`, required): UUID of the flow run to get logs for
- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).
- `limit` (`integer`, optional): Maximum number of log entries to return. Default: `100`.

Example input: `{"flow_run_id":"<flow_run_id>","workspace_id":"<workspace_id>"}`

### `prefectmcp_get_flow_runs`

Get Flow Runs · Read-only

Get flow runs with optional filters.

Returns compact summaries by default. Filter by specific ID(s) for full
detail including parameters, inlined deployment info, and work pool info.

The response includes truncated=true when more matching records exist.

Filter operators:
- any_: Match any value in list
- all_: Match all values
- like_: SQL LIKE pattern matching
- not_any_: Exclude values
- is_null_: Check for null/not null
- after_/before_: Time comparisons
- gt_/gte_/lt_/lte_: Numeric comparisons

Examples:
    - List recent runs: get_flow_runs()
    - Get specific run: get_flow_runs(filter={"id": {"any_": ["<flow-run-id>"]}})
    - Failed runs: get_flow_runs(filter={"state": {"type": {"any_": ["FAILED"]}}})
    - Production runs: get_flow_runs(filter={"tags": {"all_": ["production"]}})

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).
- `filter` (`object`, optional): JSON filter object for advanced querying. Supports all Prefect FlowRunFilter fields.
- `limit` (`integer`, optional): Maximum number of flow runs to return. Default: `50`.

Example input: `{"workspace_id":"<workspace_id>"}`

### `prefectmcp_get_flows`

Get Flows · Read-only

Get flows with optional filters.

Returns a list of flows registered in the workspace.

The response includes truncated=true when more matching records exist.

Filter operators:
- any_: Match any value in list
- like_: SQL LIKE pattern matching
- all_: Match all values

Examples:
    - List all flows: get_flows()
    - Get specific flow: get_flows(filter={"id": {"any_": ["<flow-id>"]}})
    - Flows by name pattern: get_flows(filter={"name": {"like_": "etl-%"}})
    - Flows by tags: get_flows(filter={"tags": {"all_": ["production"]}})

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).
- `filter` (`object`, optional): JSON filter object for advanced querying. Supports all Prefect FlowFilter fields.
- `limit` (`integer`, optional): Maximum number of flows to return. Default: `50`.

Example input: `{"workspace_id":"<workspace_id>"}`

### `prefectmcp_get_identity`

Get Identity · Read-only

Get identity and connection information for the current Prefect instance.

Returns API URL, type (cloud/oss), and user information if available.
Essential for understanding which Prefect instance you're connected to.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, optional): Prefect Cloud workspace ID. Required when using Prefect Cloud OAuth mode.

Example input: `{}`

### `prefectmcp_get_object_schema`

Get Object Schema · Read-only

Get a schema for an object type.

An action_type narrows all three action lists and includes only referenced
definitions. Trigger variants and automation guidance remain available.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `object_type` (`string`, required): Name of the object type to get a schema for. One of: `automation`.
- `action_type` (`string`, optional): Return a schema for only this automation action type; omit for all action types

Example input: `{"object_type":"automation"}`

### `prefectmcp_get_task_runs`

Get Task Runs · Read-only

Get task runs with optional filters.

Returns a list of task runs and their details matching the filters.
Note that 'task_inputs' contains dependency tracking
information (upstream task relationships), not the actual parameter values
passed to the task.

The response includes truncated=true when more matching records exist.

Filter operators:
- any_: Match any value in list
- like_: SQL LIKE pattern matching
- not_any_: Exclude values
- is_null_: Check for null/not null

Examples:
    - List recent tasks: get_task_runs()
    - Get specific task: get_task_runs(filter={"id": {"any_": ["<task-run-id>"]}})
    - Failed tasks: get_task_runs(filter={"state": {"type": {"any_": ["FAILED"]}}})
    - Tasks by pattern: get_task_runs(filter={"name": {"like_": "%process%"}})

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).
- `filter` (`object`, optional): JSON filter object for advanced querying. Supports all Prefect TaskRunFilter fields.
- `limit` (`integer`, optional): Maximum number of task runs to return. Default: `50`.

Example input: `{"workspace_id":"<workspace_id>"}`

### `prefectmcp_get_work_pools`

Get Work Pools · Read-only

Get work pools with optional filters.

Returns compact summaries by default (name, type, status, concurrency_limit).
Filter by specific ID(s) for full detail including work queues, active worker
counts, and descriptions. Essential for debugging deployment issues related to
flow runs being stuck or not starting.

Filter operators:
- any_: Match any value in list
- like_: SQL LIKE pattern matching

Examples:
    - List all pools: get_work_pools()
    - Full detail: get_work_pools(filter={"id": {"any_": ["<work-pool-id>"]}})
    - Kubernetes pools: get_work_pools(filter={"type": {"any_": ["kubernetes"]}})

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).
- `filter` (`object`, optional): JSON filter object for advanced querying. Supports all Prefect WorkPoolFilter fields.
- `limit` (`integer`, optional): Maximum number of work pools to return. Default: `50`.

Example input: `{"workspace_id":"<workspace_id>"}`

### `prefectmcp_list_authorized_workspaces`

List Authorized Workspaces · Read-only

List Prefect Cloud workspaces selected during OAuth consent.

Returns account handles, workspace handles, workspace IDs, and grant metadata
for the workspaces available to this connection. Only available in Prefect
Cloud OAuth mode.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `prefectmcp_orientation`

Orientation · Read-only

Return an overview of Prefect MCP capabilities and access boundaries.

Summarizes supported inspection, documentation, schema, and optional authoring
capabilities. It does not access or modify Prefect data.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `prefectmcp_read_events`

Read Events · Read-only

Read and filter events from the Prefect instance.

Provides a structured view of events with filtering capabilities.

Note: When no time range is specified, events from the last 1 hour are returned by default.
Use occurred_after/occurred_before parameters to query a different time range.

Common event type prefixes:
- prefect.flow-run: Flow run lifecycle events
- prefect.deployment: Deployment-related events
- prefect.work-queue: Work queue events
- prefect.agent: Agent events

Examples:
    - Recent flow run events: read_events(event_type_prefix="prefect.flow-run")
    - Last 24 hours: read_events(occurred_after="<ISO8601-timestamp-24-hours-ago>")
    - Specific time range: read_events(occurred_after="2024-01-01T00:00:00Z", occurred_before="2024-01-02T00:00:00Z")

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Prefect Cloud workspace ID. Required on every call to this tool for this connection (Prefect Cloud OAuth mode).
- `event_type_prefix` (`string`, optional): Filter events by type prefix
- `limit` (`integer`, optional): Maximum number of events to return. Default: `50`.
- `occurred_after` (`string`, optional): ISO 8601 timestamp to filter events after
- `occurred_before` (`string`, optional): ISO 8601 timestamp to filter events before

Example input: `{"workspace_id":"<workspace_id>"}`

## Related

Other Automation connectors ([all 58](/agentkit/connectors/?category=automation)):

- [Mailchimp](/agentkit/connectors/mailchimp/): Scalekit connector, OAuth, 73 tools
- [Twilio](/agentkit/connectors/twilio/): Scalekit connector, Username and password, 61 tools
- [Stripe](/agentkit/connectors/stripe/): Scalekit connector, Access token, 178 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
