🚀 AYX-MCP-Wrapper
AYX-MCP-Wrapper 是一個模型上下文協議(MCP)服務器,它為 Alteryx 服務器提供了全面的接口。藉助這個包裝器,AI 助手和其他 MCP 客戶端能夠與 Alteryx 服務器進行交互,實現對工作流、集合、用戶、調度、憑證等的管理。
🚀 快速開始
本項目是一個個人發起的項目,與任何公司均無關聯,也未得到任何公司的認可或支持。即便維護者是相關公司的員工,該項目也是獨立開發的,沒有任何官方支持。請在使用前知悉。
✨ 主要特性
- 高級搜索:通過靈活的搜索選項查找用戶、工作流和資產。
- 工作流操作:全面控制工作流的執行、轉移和管理。
- 工作流資產:下載工作流包並提取 XML 進行分析。
- 作業監控:實時跟蹤和管理工作流執行作業。
- 集合管理:創建、更新、刪除和組織集合。
- 用戶管理:高效管理用戶、其資產和權限。
- 調度管理:創建和管理工作流調度與自動化。
- 憑證管理:處理服務器憑證並確保安全連接。
📦 安裝指南
前提條件
- Python 3.10+ - 支持類型提示的現代 Python 版本。
- Alteryx Server - 已啟用 API 訪問。
- OAuth2 憑證 - 用於身份驗證的客戶端 ID 和密鑰。
使用 uv 快速開始(推薦)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install mcp-server-alteryx
使用 pip 安裝
pip install mcp-server-alteryx
從源代碼安裝
git clone https://github.com/jupiterbak/AYX-MCP-Wrapper.git
cd AYX-MCP-Wrapper
uv sync
uv run pip install -e .
🔧 配置
環境變量
使用環境變量設置服務器憑證:
export ALTERYX_API_HOST="https://your-server.com/webapi/"
export ALTERYX_CLIENT_ID="your-client-id"
export ALTERYX_CLIENT_SECRET="your-client-secret"
export ALTERYX_VERIFY_SSL="1"
export ALTERYX_TEMP_DIRECTORY="your-temp-directory"
export LOG_LEVEL="INFO"
配置文件
也可以在項目根目錄下創建一個 .env
文件:
ALTERYX_API_HOST=https://your-server.com/webapi/
ALTERYX_CLIENT_ID=your-client-id
ALTERYX_CLIENT_SECRET=your-client-secret
ALTERYX_VERIFY_SSL=1
ALTERYX_TEMP_DIRECTORY=your-temp-directory
LOG_LEVEL=INFO
💻 使用示例
Claude Desktop 集成
要在 Claude Desktop 中使用此 MCP 服務器,請在 Claude Desktop 設置中添加以下配置:
{
"mcpServers": {
"alteryx": {
"command": "uvx",
"args": ["mcp-server-alteryx", "--transport", "stdio"],
"env": {
"ALTERYX_API_HOST": "https://your-server.com/webapi/",
"ALTERYX_CLIENT_ID": "your-client-id",
"ALTERYX_CLIENT_SECRET": "your-client-secret",
"ALTERYX_VERIFY_SSL": "1",
"ALTERYX_TEMP_DIRECTORY": "your-temp-directory"
}
}
}
}
不過,我們建議結合“Sequential Thinking”工具一起使用:
{
"mcpServers": {
"sequential-thinking": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sequential-thinking"
]
},
"alteryx": {
"command": "uvx",
"args": ["mcp-server-alteryx", "--transport", "stdio"],
"env": {
"ALTERYX_API_HOST": "http://localhost/webapi/",
"ALTERYX_CLIENT_ID": "your-client-id",
"ALTERYX_CLIENT_SECRET": "your-client-secret",
"ALTERYX_VERIFY_SSL": "1",
"ALTERYX_TEMP_DIRECTORY": "your-temp-directory"
}
}
}
}
配置選項:
command
:要使用的 uvx 可執行文件。
args
:MCP 服務器的命令行參數。
env
:用於服務器身份驗證的環境變量。
傳輸選項:
stdio
:標準輸入/輸出(推薦用於 Claude Desktop)。
sse
:服務器發送事件。
streamable-http
:HTTP 流。
Cursor 集成
要在 Cursor IDE 中集成,請在 Cursor 設置中添加以下內容:
{
"mcpServers": {
"alteryx": {
"command": "uvx",
"args": ["mcp-server-alteryx", "--transport", "stdio"],
"env": {
"ALTERYX_API_HOST": "https://your-alteryx-server.com/webapi/",
"ALTERYX_CLIENT_ID": "your-client-id",
"ALTERYX_CLIENT_SECRET": "your-client-secret",
"ALTERYX_TEMP_DIRECTORY": "your-temp-directory"
}
}
}
}
命令行界面
MCP 服務器可以使用不同的傳輸選項運行:
uvx run src.main --transport stdio
uvx run src.main --transport sse
uvx run src.main --transport streamable-http
uvx run src.main --log-level DEBUG
uvx run src.main --transport stdio --log-level INFO
📚 詳細文檔
可用工具
MCP 服務器提供了按功能組織的全面工具:
集合管理
功能 |
描述 |
參數 |
get_all_collections() |
獲取所有可訪問的集合 |
無 |
get_collection_by_id(collection_id) |
獲取特定集合的詳細信息 |
collection_id: str |
create_collection(name) |
創建新集合 |
name: str |
update_collection_name_or_owner(collection_id, name, owner_id) |
更新集合屬性 |
collection_id: str, name: str, owner_id: str |
add_workflow_to_collection(collection_id, workflow_id) |
將工作流添加到集合中 |
collection_id: str, workflow_id: str |
remove_workflow_from_collection(collection_id, workflow_id) |
從集合中移除工作流 |
collection_id: str, workflow_id: str |
add_schedule_to_collection(collection_id, schedule_id) |
將調度添加到集合中 |
collection_id: str, schedule_id: str |
remove_schedule_from_collection(collection_id, schedule_id) |
從集合中移除調度 |
collection_id: str, schedule_id: str |
delete_collection(collection_id) |
刪除集合 |
collection_id: str |
工作流操作
功能 |
描述 |
參數 |
get_all_workflows() |
獲取所有可訪問的工作流 |
無 |
get_workflow_by_id(workflow_id) |
獲取特定工作流的詳細信息 |
workflow_id: str |
update_workflow_name_or_comment(workflow_id, name, comment) |
更新工作流屬性 |
workflow_id: str, name: str, comment: str |
transfer_workflow(workflow_id, new_owner_id) |
轉移工作流所有權 |
workflow_id: str, new_owner_id: str |
get_workflow_jobs(workflow_id) |
獲取工作流的作業 |
workflow_id: str |
start_workflow_execution(workflow_id, input_data) |
啟動工作流執行並返回作業 ID |
workflow_id: str, input_data: List[InputData] |
execute_workflow_with_monitoring(workflow_id, input_data) |
執行工作流並監控完成情況 |
workflow_id: str, input_data: List[InputData] |
download_workflow_package_file(workflow_id, output_directory) |
下載工作流包 |
workflow_id: str, output_directory: str |
get_workflow_xml(workflow_id) |
提取工作流 XML |
workflow_id: str |
用戶管理
功能 |
描述 |
參數 |
get_all_users() |
獲取所有可訪問的用戶 |
無 |
get_user_by_id(user_id) |
獲取特定用戶的詳細信息 |
user_id: str |
get_user_by_email(email) |
通過電子郵件查找用戶 |
email: str |
get_user_by_name(name) |
通過姓名查找用戶 |
name: str |
get_user_by_first_name(first_name) |
通過名字查找用戶 |
first_name: str |
get_all_user_assets(user_id) |
獲取用戶擁有的所有資產 |
user_id: str |
get_user_assets_by_type(user_id, asset_type) |
獲取特定類型的資產 |
user_id: str, asset_type: str |
update_user_details(user_id, first_name, last_name, email) |
更新用戶信息 |
user_id: str, first_name: str, last_name: str, email: str |
transfer_all_assets(user_id, new_owner_id, transfer_workflows, transfer_schedules, transfer_collections) |
轉移用戶資產 |
user_id: str, new_owner_id: str, transfer_workflows: bool, transfer_schedules: bool, transfer_collections: bool |
deactivate_user(user_id) |
停用用戶 |
user_id: str |
reset_user_password(user_id) |
重置用戶密碼 |
user_id: str |
調度管理
功能 |
描述 |
參數 |
get_all_schedules() |
獲取所有可訪問的調度 |
無 |
get_schedule_by_id(schedule_id) |
獲取特定調度的詳細信息 |
schedule_id: str |
deactivate_schedule(schedule_id) |
停用調度 |
schedule_id: str |
activate_schedule(schedule_id) |
啟用調度 |
schedule_id: str |
update_schedule_name_or_comment(schedule_id, name, comment) |
更新調度屬性 |
schedule_id: str, name: str, comment: str |
change_schedule_owner(schedule_id, new_owner_id) |
更改調度所有權 |
schedule_id: str, new_owner_id: str |
作業監控
功能 |
描述 |
參數 |
get_all_job_messages(job_id) |
獲取特定作業的消息 |
job_id: str |
get_job_by_id(job_id) |
獲取作業詳細信息 |
job_id: str |
get_job_output_data(job_id) |
從已完成的作業中獲取輸出數據文件 |
job_id: str |
憑證與連接
功能 |
描述 |
參數 |
get_all_credentials() |
獲取所有可訪問的憑證 |
無 |
get_credential_by_id(credential_id) |
獲取特定憑證的詳細信息 |
credential_id: str |
lookup_connection(connection_id) |
查找 DCM 連接 |
connection_id: str |
get_connection_by_id(connection_id) |
獲取連接詳細信息 |
connection_id: str |
開發
設置開發環境
git clone https://github.com/jupiterbak/AYX-MCP-Wrapper.git
cd AYX-MCP-Wrapper
uv sync
uv run pip install -e .
貢獻代碼
我們歡迎貢獻!請遵循以下步驟:
- Fork 倉庫。
- 創建 一個功能分支 (
git checkout -b feature/amazing-feature
)。
- 提交 你的更改 (
git commit -m 'Add amazing feature'
)。
- 推送 到分支 (
git push origin feature/amazing-feature
)。
- 打開 一個拉取請求。
📄 許可證
本項目採用 MIT 許可證 - 詳情請參閱 LICENSE 文件。
相關項目
為社區用心打造 ❤️