Nate
04/22/2026, 6:09 PMMarvin
04/22/2026, 6:10 PMMarvin
04/22/2026, 6:10 PMNate
04/22/2026, 6:10 PMMarvin
04/22/2026, 6:10 PMMarvin
04/22/2026, 6:13 PMbash
uvx --from prefect-mcp prefect-mcp-server
That launches the MCP server over stdio, which is what terminal clients usually want.
Using it with a terminal MCP client
For example, with Claude Code:
bash
claude mcp add prefect -- uvx --from prefect-mcp prefect-mcp-server
Or with explicit Cloud credentials:
bash
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 --from prefect-mcp prefect-mcp-server
For Codex CLI:
bash
codex mcp add prefect -- uvx --from prefect-mcp prefect-mcp-server
For Gemini CLI:
bash
gemini mcp add prefect uvx --from prefect-mcp prefect-mcp-server
Cursor uses config instead of a CLI add command. In `.cursor/mcp.json`:
json
{
"mcpServers": {
"prefect": {
"command": "uvx",
"args": ["--from", "prefect-mcp", "prefect-mcp-server"]
}
}
}
If you need explicit auth, add env vars there too:
json
{
"mcpServers": {
"prefect": {
"command": "uvx",
"args": ["--from", "prefect-mcp", "prefect-mcp-server"],
"env": {
"PREFECT_API_URL": "<https://api.prefect.cloud/api/accounts/[ACCOUNT_ID]/workspaces/[WORKSPACE_ID]>",
"PREFECT_API_KEY": "your-cloud-api-key"
}
}
}
}
How auth works
You have a few options:
1. Use your local Prefect profile
- easiest path
- the MCP server reads from ~/.prefect/profiles.toml
2. Set Cloud env vars
bash
export PREFECT_API_URL=<https://api.prefect.cloud/api/accounts/[ACCOUNT_ID]/workspaces/[WORKSPACE_ID]>
export PREFECT_API_KEY=your-cloud-api-key
3. Use self-hosted server auth
bash
export PREFECT_API_URL=<http://your-server:4200/api>
export PREFECT_API_AUTH_STRING=your-auth-string
What it can do
The MCP server is primarily read-only. It can help your assistant:
- inspect deployments
- inspect flow and task runs
- read logs
- check work pools and related infra context
- pull in current Prefect docs context for better guidance
So it’s very good for:
- “why did this deployment fail?”
- “show me recent runs for this flow”
- “inspect logs for the last failed run”
- “what work pool is this deployment using?”
- “what’s the right current Prefect 3 way to do X?”
Important caveat
The MCP server is read-only, but your client assistant may also have shell access. So even if the MCP tools are safe, the assistant could still do write actions through your terminal if you allow it. The security FAQ is worth reading:
- Security FAQ
If you want to keep it tight, use a read-only Prefect API key.
A simple “personal Marvin” setup
If I were doing the minimal terminal setup, I’d do:
1. Make sure Prefect auth already works locally
2. Add the MCP server to your terminal client
3. Ask it questions like:
- show me the last 10 failed flow runs
- inspect logs for the latest failure in deployment X
- which work pool is deployment Y using?
- look up the current Prefect 3 docs for deploying from source
So for Claude Code, the whole thing is basically:
```bashMarvin
04/22/2026, 6:13 PM