by allen-munsch
mcp-prefect is a Model Context Protocol (MCP) server implementation for Prefect, enabling AI assistants to interact with Prefect through natural language.
mcp-prefect is an MCP (Model Context Protocol) server designed to bridge the gap between AI assistants and Prefect, a workflow orchestration and ELT/ETL tool. It allows AI assistants to understand and execute commands related to Prefect through natural language, simplifying the management of data pipelines and workflows.
To use mcp-prefect, you need to set up your Prefect API URL and optionally an API key as environment variables (PREFECT_API_URL and PREFECT_API_KEY). The project can then be run using Docker Compose, which will start both the MCP server and Prefect. Once connected, AI assistants can interpret natural language commands to interact with Prefect.
mcp-prefect provides access to various Prefect APIs, offering comprehensive control over your workflows:
mcp-prefect is ideal for scenarios where natural language interaction with Prefect is beneficial. This includes:
Q: What is Prefect? A: Prefect is an open-source workflow management system that helps data engineers and scientists build, run, and monitor data pipelines.
Q: What is an MCP server? A: An MCP (Model Context Protocol) server enables AI models to interact with external services and tools by translating natural language commands into API calls.
Q: Are all Prefect endpoints implemented? A: No, some endpoints are still under development. The project README indicates that several endpoints have yet to be implemented.
Q: How can I add new functions to mcp-prefect?
A: To add a new function, you need to add it to the appropriate module in src/mcp_prefect and include it in the get_all_functions() list within that module. For new API types, you need to update APIType in enums.py, create a new module, and update main.py.
A Model Context Protocol (MCP) server implementation for Prefect, allowing AI assistants to interact with Prefect through natural language.
This MCP server provides access to the following Prefect APIs:
Set the following environment variables:
export PREFECT_API_URL="http://localhost:4200/api" # URL of your Prefect API
export PREFECT_API_KEY="your_api_key" # Your Prefect API key (if using Prefect Cloud)
Run the MCP server, and prefect:
docker compose up
Once connected, an AI assistant can help users interact with Prefect using natural language. Examples:
Several of the endpoints have yet to be implemented
To add a new function to an existing API:
src/mcp_prefectget_all_functions() list in the moduleTo add a new API type:
APIType in enums.pysrc/prefect/main.py to include the new API typeExample usage:
{
"mcpServers": {
"mcp-prefect": {
"command": "mcp-prefect",
"args": [
"--transport", "sse"
],
"env": {
"PYTHONPATH": "/path/to/your/project/directory"
},
"cwd": "/path/to/your/project/directory"
}
}
}
Please log in to share your review and rating for this MCP.