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
- Fork this repository on GitHub (
gh repo fork prefecthq/prefect-mcp-server) - Go to fastmcp.cloud and sign in
- Create a new server pointing to your fork:
- server path:
src/prefect_mcp_server/server.py - requirements:
pyproject.toml(or leave blank) - environment variables:
PREFECT_API_URL:https://api.prefect.cloud/api/accounts/[ACCOUNT_ID]/workspaces/[WORKSPACE_ID]PREFECT_API_KEY: your Prefect Cloud API key (orPREFECT_API_AUTH_STRINGfor OSS with basic auth)
- server path:
- get your server URL (e.g.,
https://your-server-name.fastmcp.app/mcp) - Add to your favorite MCP client (e.g., Claude Code):
# add to claude code with http transport
claude mcp add prefect --transport http https://your-server-name.fastmcp.app/mcp
[!NOTE] When deploying to FastMCP Cloud, environment variables are configured on the FastMCP Cloud server itself, not in your client configuration. FastMCP's authentication secures access to your MCP server, while the MCP server uses your Prefect API key to access your Prefect instance.
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_STRINGinstead ofPREFECT_API_KEY
[!TIP] Prefect Cloud users on Team, Pro, and Enterprise plans can use service accounts for API authentication. Pro and Enterprise users can restrict service accounts to read-only access (only
see_*permissions) since this MCP server requires no write permissions.
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
Enable CLI usage
- Allows AI assistants to effectively use the
prefectCLI to manage Prefect resources - Create automations, trigger deployment runs, and more while maintaining proper attribution
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
- FastMCP - the easiest way to build an mcp server
- FastMCP Cloud - deploy your MCP server to the cloud
- Prefect - the easiest way to build workflows
- Claude Code - one of the best MCP clients
mcp-name: io.github.prefecthq/prefect-mcp-server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prefect_mcp-0.0.1b3.tar.gz.
File metadata
- Download URL: prefect_mcp-0.0.1b3.tar.gz
- Upload date:
- Size: 361.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a39af0bd1498b30fb2ddcaa2dd8785841335641ddf97dd6fcaede52dfba9a3b3
|
|
| MD5 |
b4c56655f896ed6cac564b0cef194e16
|
|
| BLAKE2b-256 |
4ef64ac1e19d418eed5761b29cdc8127ab4c47d2a6547791a1ddd9752227cecb
|
File details
Details for the file prefect_mcp-0.0.1b3-py3-none-any.whl.
File metadata
- Download URL: prefect_mcp-0.0.1b3-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bbe3eb525fe83fda5593bb3d4244a22c05cb5447cba9795592ee96c490f9a6e
|
|
| MD5 |
0667987274497fe1126957be00370813
|
|
| BLAKE2b-256 |
53b2d8c336a9378cdf6eaa5b09756b96565bb4bc848b3fc6c83b7d5e5e301c49
|