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.1a1.tar.gz (271.7 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.1a1-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prefect_mcp-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 77be2941a8b6d14731b26bae72ad29559e79d36e73cff8bd4728eeeb6e1dacd4
MD5 6631d3912a9bda591d908104173e4eff
BLAKE2b-256 77a49501dcf033b43dea904300925c9293400b3508d86d07901b17617769443a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prefect_mcp-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 13adb2170c2fdbb1ab7bd6e2ece61acf91cde9e574be760ea36a0b6f080b060d
MD5 ce120a7e73b9ff815371523cdb757632
BLAKE2b-256 dd7ba39ea0aebd7faad51ac7b9e67ceeb7fedb990c1926b77043676de077930a

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