Skip to main content

MCP server for interacting with Prefect

Project description

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.

quick start

deploy on FastMCP Cloud

  1. fork this repository on github (gh repo fork prefecthq/prefect-mcp-server)
  2. go to fastmcp.cloud and sign in
  3. create a new server pointing to your fork:
    • server path: src/prefect_mcp_server/server.py
    • requirements: pyproject.toml (or leave blank)
  4. get your server URL (e.g., https://your-server-name.fastmcp.app/mcp)
  5. add to your favorite MCP client (e.g., claude code):
# add to claude code with http transport
# environment variables are required when using FastMCP Cloud
claude mcp add prefect \
  -e PREFECT_API_URL=https://api.prefect.cloud/api/accounts/[ACCOUNT_ID]/workspaces/[WORKSPACE_ID] \
  -e PREFECT_API_KEY=your-cloud-api-key \
  --transport http https://your-server-name.fastmcp.app/mcp

[!NOTE] when deploying to FastMCP Cloud, the server has no access to your local Prefect configuration. you must provide PREFECT_API_URL and PREFECT_API_KEY (for Prefect Cloud) or PREFECT_API_AUTH_STRING (for OSS with basic auth) as environment variables in the claude mcp add command above.

run locally

when running the MCP server locally (via stdio transport), it will automatically use your local Prefect configuration from ~/.prefect/profiles.toml if available.

# minimal setup - inherits from local prefect profile
claude mcp add prefect \
  -- uvx prefect-mcp-server@git+https://github.com/prefecthq/prefect-mcp-server.git

# or explicitly set credentials
claude mcp add prefect \
  -e PREFECT_API_URL=https://api.prefect.cloud/api/accounts/[ACCOUNT_ID]/workspaces/[WORKSPACE_ID] \
  -e PREFECT_API_KEY=your-cloud-api-key \
  -- uvx prefect-mcp-server@git+https://github.com/prefecthq/prefect-mcp-server.git

[!NOTE] for open-source servers with basic auth, use PREFECT_API_AUTH_STRING instead of PREFECT_API_KEY

capabilities

this server enables MCP clients like Claude Code to interact with your Prefect instance:

monitoring & inspection

  • view dashboard overviews with flow run statistics and work pool status
  • query deployments, flow runs, task runs, and work pools with advanced filtering
  • retrieve detailed execution logs from flow runs
  • track events across your workflow ecosystem

orchestration & actions

  • trigger deployment runs with custom parameters and tags
  • pass dynamic configurations to workflows at runtime

intelligent debugging

  • get contextual guidance for troubleshooting failed flow runs
  • diagnose deployment issues including concurrency problems
  • identify root causes of workflow failures

development

setup & testing
# clone the repo
gh repo clone prefecthq/prefect-mcp-server && cd prefect-mcp-server

# install dev deps and pre-commit hooks
just setup

# run tests (uses ephemeral prefect database via prefect_test_harness)
just test

links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prefect_mcp-0.0.1a2.tar.gz (271.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prefect_mcp-0.0.1a2-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file prefect_mcp-0.0.1a2.tar.gz.

File metadata

  • Download URL: prefect_mcp-0.0.1a2.tar.gz
  • Upload date:
  • Size: 271.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.24

File hashes

Hashes for prefect_mcp-0.0.1a2.tar.gz
Algorithm Hash digest
SHA256 60d0624ae219aacd98a71ced9aee826062408a82d451b302e9a401d46d2601e8
MD5 9075660b22f492e2d755847f8d085a88
BLAKE2b-256 c0fd45df6e8af8ffa35f9792e6ffac5719fc020115a1374f88858c668286acc6

See more details on using hashes here.

File details

Details for the file prefect_mcp-0.0.1a2-py3-none-any.whl.

File metadata

File hashes

Hashes for prefect_mcp-0.0.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 5cc0bb161167a529d4c6f74797c4076892e766b666170b89b0712e13ffaa5fef
MD5 dede562115d1b3a668bcf38351bec9ec
BLAKE2b-256 8b8ab8295d68c9ef502fed04982d9d809f97dbfea3f58aa2aa17b9262bba381d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page