Metadata-Version: 2.4
Name: iflow-mcp_mcp-prefect
Version: 3.6.1
Summary: MCP Server for Prefect
Author-email: James Munsch <james.a.munsch@gmail.com>
License: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: aiosqlite>=0.21.0
Requires-Dist: alembic>=1.16.5
Requires-Dist: annotated-types>=0.7.0
Requires-Dist: anyio>=4.10.0
Requires-Dist: apprise>=1.9.4
Requires-Dist: asgi-lifespan>=2.1.0
Requires-Dist: asyncpg>=0.30.0
Requires-Dist: attrs>=25.3.0
Requires-Dist: authlib>=1.6.4
Requires-Dist: cachetools>=6.2.0
Requires-Dist: certifi>=2025.8.3
Requires-Dist: cffi>=2.0.0
Requires-Dist: charset-normalizer>=3.4.3
Requires-Dist: click>=8.3.0
Requires-Dist: cloudpickle>=3.1.1
Requires-Dist: colorama>=0.4.6
Requires-Dist: coolname>=2.2.0
Requires-Dist: cryptography>=46.0.1
Requires-Dist: dateparser>=1.2.2
Requires-Dist: deprecated>=1.2.18
Requires-Dist: docker>=7.1.0
Requires-Dist: exceptiongroup>=1.3.0
Requires-Dist: fastapi>=0.117.1
Requires-Dist: fastmcp>=2.12.3
Requires-Dist: fsspec>=2025.9.0
Requires-Dist: graphviz>=0.21
Requires-Dist: greenlet>=3.2.4
Requires-Dist: griffe>=1.14.0
Requires-Dist: h11>=0.16.0
Requires-Dist: h2>=4.3.0
Requires-Dist: hpack>=4.1.0
Requires-Dist: httpcore>=1.0.9
Requires-Dist: httpx-sse>=0.4.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: humanize>=4.13.0
Requires-Dist: hyperframe>=6.1.0
Requires-Dist: idna>=3.10
Requires-Dist: importlib-metadata>=8.7.0
Requires-Dist: jinja2-humanize-extension>=0.4.0
Requires-Dist: jinja2>=3.1.6
Requires-Dist: jsonpatch>=1.33
Requires-Dist: jsonpointer>=3.0.0
Requires-Dist: jsonschema-specifications>=2025.9.1
Requires-Dist: jsonschema>=4.25.1
Requires-Dist: mako>=1.3.10
Requires-Dist: markdown-it-py>=4.0.0
Requires-Dist: markdown>=3.9
Requires-Dist: markupsafe>=3.0.2
Requires-Dist: mcp>=1.14.1
Requires-Dist: mdurl>=0.1.2
Requires-Dist: oauthlib>=3.3.1
Requires-Dist: openapi-pydantic>=0.5.1
Requires-Dist: opentelemetry-api>=1.37.0
Requires-Dist: orjson>=3.11.3
Requires-Dist: packaging>=25.0
Requires-Dist: pathspec>=0.12.1
Requires-Dist: pendulum>=3.1.0
Requires-Dist: pip>=24.2
Requires-Dist: prefect>=3.6.1
Requires-Dist: prometheus-client>=0.23.1
Requires-Dist: pycparser>=2.23
Requires-Dist: pydantic-core>=2.33.2
Requires-Dist: pydantic-extra-types>=2.10.5
Requires-Dist: pydantic-settings>=2.10.1
Requires-Dist: pydantic>=2.11.9
Requires-Dist: pygments>=2.19.2
Requires-Dist: pyproject-freeze>=0.1.1
Requires-Dist: python-dateutil>=2.9.0.post0
Requires-Dist: python-dotenv>=1.1.1
Requires-Dist: python-multipart>=0.0.20
Requires-Dist: python-slugify>=8.0.4
Requires-Dist: python-socks>=2.7.2
Requires-Dist: pytz>=2025.2
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: readchar>=4.2.1
Requires-Dist: referencing>=0.36.2
Requires-Dist: regex>=2025.9.18
Requires-Dist: requests-oauthlib>=2.0.0
Requires-Dist: requests>=2.32.5
Requires-Dist: rfc3339-validator>=0.1.4
Requires-Dist: rich>=14.1.0
Requires-Dist: rpds-py>=0.27.1
Requires-Dist: ruamel-yaml-clib>=0.2.12
Requires-Dist: ruamel-yaml>=0.18.15
Requires-Dist: shellingham>=1.5.4
Requires-Dist: six>=1.17.0
Requires-Dist: sniffio>=1.3.1
Requires-Dist: sqlalchemy>=2.0.43
Requires-Dist: sse-starlette>=3.0.2
Requires-Dist: starlette>=0.48.0
Requires-Dist: text-unidecode>=1.3
Requires-Dist: time-machine>=2.19.0
Requires-Dist: toml>=0.10.2
Requires-Dist: tomlkit>=0.13.2
Requires-Dist: typer>=0.17.4
Requires-Dist: typing-extensions>=4.15.0
Requires-Dist: typing-inspection>=0.4.1
Requires-Dist: tzdata>=2025.2
Requires-Dist: tzlocal>=5.3.1
Requires-Dist: ujson>=5.11.0
Requires-Dist: urllib3>=2.5.0
Requires-Dist: uv>=0.8.19
Requires-Dist: uvicorn>=0.36.0
Requires-Dist: websockets>=15.0.1
Requires-Dist: wrapt>=1.17.3
Requires-Dist: zipp>=3.23.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: isort>=5.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.1; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# Deprecated 27-Nov-2025

> I've personally moved my efforts to a more generic OpenAPI spec based MCP: https://github.com/allen-munsch/yas-mcp
> 
> Additionally, there is actually an official beta release by prefect over here: https://pypi.org/project/prefect-mcp/


# Prefect MCP Server

A Model Context Protocol (MCP) server implementation for [Prefect](https://www.prefect.io/), enabling AI assistants to interact with Prefect through natural language.

> **Note**: The official Prefect MCP server is available [here](https://pypi.org/project/prefect-mcp/). This is a community implementation.

## 🚀 Quick Start

```bash
docker compose up
```

## 📦 Installation

### pip Installation
```bash
pip install mcp-prefect
```

### From Source
```bash
git clone https://github.com/allen-munsch/mcp-prefect
cd mcp-prefect
pip install -e .
```

### Manual Run
```bash
PREFECT_API_URL=http://localhost:4200/api \
PREFECT_API_KEY=your_api_key_here \
MCP_PORT=8000 \
python -m mcp_prefect.main --transport http
```

## 🛠️ Features

```

╭────────────────────────────────────────────────────────────────────────────╮
│                                                                            │
│        _ __ ___  _____           __  __  _____________    ____    ____     │
│       _ __ ___ .'____/___ ______/ /_/  |/  / ____/ __ \  |___ \  / __ \    │
│      _ __ ___ / /_  / __ `/ ___/ __/ /|_/ / /   / /_/ /  ___/ / / / / /    │
│     _ __ ___ / __/ / /_/ (__  ) /_/ /  / / /___/ ____/  /  __/_/ /_/ /     │
│    _ __ ___ /_/    \____/____/\__/_/  /_/\____/_/      /_____(*)____/      │
│                                                                            │
│                                                                            │
│                                FastMCP  2.0                                │
│                                                                            │
│                                                                            │
│                 🖥️  Server name:     MCP Prefect 3.6.1                      │
│                 📦 Transport:       STDIO                                  │
│                                                                            │
│                 🏎️  FastMCP version: 2.12.3                                 │
│                 🤝 MCP SDK version: 1.14.1                                 │
│                                                                            │
│                 📚 Docs:            https://gofastmcp.com                  │
│                 🚀 Deploy:          https://fastmcp.cloud                  │
│                                                                            │
╰────────────────────────────────────────────────────────────────────────────╯


[11/11/25 02:08:06] INFO     Starting MCP server 'MCP Prefect 3.6.1' with transport 'stdio'                                                                                     server.py:1495
✅ Initialized successfully
Server: MCP Prefect 3.6.1 1.14.1

🔄 Listing tools...

🎯 FOUND 64 TOOLS:
================================================================================

📂 ARTIFACT (6 tools)
  🔧 create_artifact
  🔧 delete_artifact
  🔧 get_artifact
  🔧 get_artifacts
  🔧 get_latest_artifacts
  🔧 update_artifact

📂 AUTOMATION (7 tools)
  🔧 create_automation
  🔧 delete_automation
  🔧 get_automation
  🔧 get_automations
  🔧 pause_automation
  🔧 resume_automation
  🔧 update_automation

📂 BLOCK (5 tools)
  🔧 delete_block_document
  🔧 get_block_document
  🔧 get_block_documents
  🔧 get_block_type
  🔧 get_block_types

📂 DEPLOYMENT (8 tools)
  🔧 delete_deployment
  🔧 get_deployment
  🔧 get_deployment_schedule
  🔧 get_deployments
  🔧 pause_deployment_schedule
  🔧 resume_deployment_schedule
  🔧 set_deployment_schedule
  🔧 update_deployment

📂 FLOW (13 tools)
  🔧 cancel_flow_run
  🔧 create_flow_run_from_deployment
  🔧 delete_flow
  🔧 delete_flow_run
  🔧 get_flow
  🔧 get_flow_run
  🔧 get_flow_run_logs
  🔧 get_flow_runs
  🔧 get_flow_runs_by_flow
  🔧 get_flows
  🔧 get_task_runs_by_flow_run
  🔧 restart_flow_run
  🔧 set_flow_run_state

📂 LOG (2 tools)
  🔧 create_log
  🔧 get_logs

📂 OTHER (1 tools)
  🔧 get_health

📂 TASK (4 tools)
  🔧 get_task_run
  🔧 get_task_run_logs
  🔧 get_task_runs
  🔧 set_task_run_state

📂 VARIABLE (5 tools)
  🔧 create_variable
  🔧 delete_variable
  🔧 get_variable
  🔧 get_variables
  🔧 update_variable

📂 WORK (13 tools)
  🔧 create_work_queue
  🔧 delete_work_queue
  🔧 get_current_workspace
  🔧 get_work_queue
  🔧 get_work_queue_by_name
  🔧 get_work_queue_runs
  🔧 get_work_queues
  🔧 get_workspace
  🔧 get_workspace_by_handle
  🔧 get_workspaces
  🔧 pause_work_queue
  🔧 resume_work_queue
  🔧 update_work_queue

📊 TOTAL: 64 tools across 10 categories
```

## 💬 Example Interactions

AI assistants can help you with:

**Flow Management**
- "Show me all my flows and their last run status"
- "Create a new flow run for the 'data-processing' deployment"
- "What's the current status of flow run 'abc-123'?"

**Deployment Control**
- "Pause the schedule for the 'daily-reporting' deployment"
- "Update the 'etl-pipeline' deployment with new parameters"

**Infrastructure Management**
- "List all work pools and their current status"
- "Create a new work queue for high-priority jobs"

**Variable & Configuration**
- "Create a variable called 'api_timeout' with value 300"
- "Show me all variables containing 'config' in their name"

**Monitoring & Debugging**
- "Get the logs for the last failed flow run"
- "Show me all running task runs right now"

## 🤖 Platform Integration

### Claude Desktop
Add to `claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "prefect": {
      "command": "mcp-prefect",
      "args": ["--transport", "stdio"]
    }
  }
}
```

### Cursor MCP
```json
{
  "mcpServers": {
    "prefect": {
      "command": "mcp-prefect",
      "args": ["--transport", "stdio"]
    }
  }
}
```

### Gemini CLI
```bash
gemini config set mcp-servers.prefect "mcp-prefect --transport stdio"
```

### Windsurf / Claude Code
```json
{
  "mcpServers": {
    "prefect": {
      "command": "mcp-prefect",
      "args": ["--transport", "stdio"],
      "env": {
        "PREFECT_API_URL": "http://localhost:4200/api",
        "PREFECT_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

### Generic MCP Client
```json
{
  "mcpServers": {
    "prefect": {
      "command": "mcp-prefect",
      "args": ["--transport", "stdio"],
      "env": {
        "PREFECT_API_URL": "http://localhost:4200/api",
        "PREFECT_API_KEY": "your_api_key_here"
      }
    }
  }
}
```

## 🧪 Development

### Running Tests
```bash
pytest tests/ -v
```

### Building from Source
```bash
git clone https://github.com/allen-munsch/mcp-prefect
cd mcp-prefect
pip install -e .
python -m mcp_prefect
```
