制作自动化工具包
专业的Python SDK和参考指南,用于部署、管理和安排Make.com自动化,包括REST API、MCP服务器和AI代理。
   
______________________________________________________________________
演示
https://github.com/cognizonline/make-automation-toolkit/assets/make_skills.mp4
______________________________________________________________________
这是什么
Make.com是一个无代码自动化平台。该工具包充分展现了其强大功能 作为 代码 --让工程师:
- 从版本控制的JSON蓝图部署生产场景
- 通过类型化的Python客户端管理数据存储、Webhook和连接
- 使用LLM提供者和工具批准策略配置AI代理
- 将场景作为可调用工具公开给任何兼容MCP的AI助手
______________________________________________________________________
特性
| 能力 | 描述 |
|---|---|
| 场景SDK | 以编程方式创建、更新、激活、运行和监视场景 |
| 蓝图系统 | 可重复部署的版本控制JSON蓝图 |
| 数据存储 | 用于带架构验证的类型化键值存储的完整CRUD API |
| 网络钩子 | 创建和管理入站webhook触发器(在Make UI中配置HMAC密钥) |
| AI智能体 | 部署LLM代理,将您的场景称为工具 |
| MCP集成 | 向Claude、Cursor和任何MCP客户端公开按需场景 |
| 重试逻辑 | 指数级回退,内置速率限制意识 |
| CI管道 | GitHub Actions在每次推送时验证蓝图和lints |
______________________________________________________________________
存储库结构
make-automation-toolkit/
├── src/
│ ├── make_client.py # MakeClient + MakeDeployer SDK
│ ├── validate_blueprint.py # blueprint schema validator
│ ├── blueprints/
│ │ ├── schema.json # JSON Schema for blueprint validation
│ │ ├── ai_local_agent.json # scenario-embedded agent template
│ │ ├── basic_webhook.json
│ │ ├── ecommerce_order_processing.json
│ │ └── customer_tracking.json
│ └── examples/
│ ├── 01_deploy_scenario.py
│ ├── 02_manage_data_store.py
│ ├── 03_configure_agent.py
│ ├── 04_setup_mcp.py
│ ├── 05_full_deployment.py
│ ├── 06_deploy_scenario_agent.py # scenario-embedded AI agent
│ ├── 07_builtin_ai_tools.py # agent using Make built-in AI modules
│ └── 08_mcp_toolbox_workflow.py # MCP Toolbox governed tool pattern
├── skill/
│ ├── README.md
│ └── make-automation-skill.md # single-file AI context reference
├── prompts/
│ ├── README.md
│ ├── lead_generation.md
│ ├── customer_support.md
│ ├── document_processing.md
│ ├── research_summarisation.md
│ ├── data_enrichment.md
│ ├── document_and_media_processing.md # make-ai-extractors patterns
│ └── _template.md
├── docs/
│ ├── quickstart.md
│ ├── authentication.md
│ ├── mcp-integration.md
│ ├── mcp-toolboxes.md # governed MCP access for production
│ ├── ai-agents.md
│ └── best-practices.md
├── tests/
│ └── test_make_client.py
├── assets/
│ └── make_skills.mp4
├── .github/workflows/ci.yml
├── pyproject.toml
├── requirements.txt
└── README.md______________________________________________________________________
快速开始
# 1. Clone
git clone https://github.com/cognizonline/make-automation-toolkit.git
cd make-automation-toolkit
pip install -r requirements.txt
# 2. Set credentials
export MAKE_API_TOKEN="your-token"
export MAKE_ZONE="eu1.make.com"
export MAKE_TEAM_ID="123"
# 3. Run any example
python src/examples/01_deploy_scenario.py看 docs/quickstart.md 进行完整设置。
______________________________________________________________________
SDK使用
客户
from src.make_client import MakeClient
client = MakeClient(
api_token="your-token",
zone="eu1.make.com",
team_id=123,
)
# Scenarios
scenarios = client.list_scenarios()
scenario_id = client.create_scenario(blueprint, scheduling={"type": "on-demand"})
client.activate_scenario(scenario_id)
result = client.run_scenario(scenario_id, data={"key": "value"})
# Data stores
structure_id = client.create_data_structure("Orders", spec)
store_id = client.create_data_store("Order Store", structure_id)
client.add_record(store_id, {"order_id": "ORD-001", "status": "pending"})
records = client.list_records(store_id)
# Webhooks
hook = client.create_hook("Inbound Events")
print(hook["url"]) # send events here
# AI Agents
agent_id = client.create_agent(config)
reply = client.run_agent(agent_id, messages=[{"role": "user", "content": "..."}])高级部署人员
from src.make_client import MakeClient, MakeDeployer
deployer = MakeDeployer(client)
# Deploy a scenario as an MCP tool in one call
scenario_id = deployer.deploy_mcp_tool(blueprint, inputs, outputs, activate=True)
# Deploy a scenario + data store together
result = deployer.deploy_with_datastore(blueprint, "My Store", structure_spec)______________________________________________________________________
蓝图
蓝图是下面的纯JSON文件 src/blueprints/每个蓝图 描述了完整的场景流,包括模块、映射器、过滤器和 错误处理程序。
{
"name": "Basic Webhook Trigger",
"flow": [
{ "id": 1, "module": "gateway:CustomWebhook", ... },
{ "id": 2, "module": "http:ActionSendData", ... }
],
"metadata": {
"version": 1,
"scenario": {
"roundtrips": 1,
"maxErrors": 3,
"autoCommit": true,
...
}
}
}每次推送时,蓝图都会在CI中得到验证。
______________________________________________________________________
MCP集成
将任何Make场景作为可由Claude、Cursor或任何MCP调用的工具公开 客户。三个要求:按需调度、主动、类型化I/O。
scenario_id = deployer.deploy_mcp_tool(blueprint, inputs, outputs)然后添加到您的Claude配置中:
{
"mcpServers": {
"make": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://eu1.make.com/mcp/u/YOUR_MCP_TOKEN/sse"]
}
}
}看 docs/mcp-integration.md 完整的指南。
______________________________________________________________________
文档
| 文档 | 目录 |
|---|---|
| 快速开始 | 安装、环境变量、首次运行 |
| 认证 | 令牌类型、范围、区域 |
| MCP集成 | 通过原始端点将场景作为AI工具公开 |
| MCP工具箱 | 为生产AI客户管理、审计的场景风险 |
| AI智能体 | LLM代理、内置AI模块、审批模式、输出模式 |
| 最佳实践 | 安全、性能、监控 |
______________________________________________________________________
错误处理和重试
所有SDK方法都包括内置的指数回退 429 Too Many Requests 和瞬态 5xx 错误:
# Configurable per-call
result = client._request("GET", "/scenarios", max_retries=5)常见状态代码及其含义: docs/best-practices.md.
______________________________________________________________________
许可证
麻省理工学院——见 许可证.
______________________________________________________________________
致谢
建在 Make.com REST API v2 和那个 制作MCP服务器.
