Show HN: Open-source SDK to generate UI-based CUA tools or RPA scripts on macOS
2 hours ago
2
A powerful automation SDK for macOS that enables seamless workflow recording, skill execution, and intelligent task automation through desktop accessibility APIs and browser integration. Now includes MCP (Model Context Protocol) server support to create custom UI-based tools for computer use agents.
For detailed installation instructions and troubleshooting, see INSTALL.md.
importasynciofromsisypho.utilsimportRecorderContext, await_task_completion, Workflowasyncdefmain():
task_prompt="Open Chrome and navigate to GitHub"# Record a workflowwithRecorderContext() asrecorder:
await_task_completion()
recording=recorder.get_recording()
workflow=Workflow(recording, task_prompt)
awaitworkflow.generate_code()
result=workflow.run_workflow()
workflow.save()
# Run the async functionasyncio.run(main())
Sisypho provides a comprehensive command-line interface for workflow creation and execution:
# Create a workflow from natural language description
python -m sisypho create --task "open chrome and type hello"# Create with recording enabled
python -m sisypho create --task "open chrome and type hello" --record
# Specify output file
python -m sisypho create --task "download file from website" --output workflow.json
# Run a saved workflow
python -m sisypho run --workflow workflow.json
# Run in interactive mode
python -m sisypho run --interactive
# Launch MCP server with workflows from current directory
python -m sisypho mcp
# Launch MCP server with workflows from specific directory
python -m sisypho mcp --workflow-directory ./my-workflows
Desktop automation leverages macOS accessibility APIs through natural language workflows:
importasynciofromsisypho.utilsimportRecorderContext, await_task_completion, Workflowasyncdefdesktop_automation_example():
task_prompt="Open TextEdit, create a new document, and type 'Hello, World!'"# Record the desktop actionswithRecorderContext() asrecorder:
await_task_completion()
recording=recorder.get_recording()
workflow=Workflow(recording, task_prompt)
awaitworkflow.generate_code()
result=workflow.run_workflow()
workflow.save("desktop_automation.json")
asyncio.run(desktop_automation_example())
Browser automation uses Playwright with your existing Chrome installation through workflow recording:
importasynciofromsisypho.utilsimportRecorderContext, await_task_completion, Workflowasyncdefbrowser_automation_example():
task_prompt="Open Chrome, navigate to GitHub, and search for 'sisypho'"# Record the browser actionswithRecorderContext() asrecorder:
await_task_completion()
recording=recorder.get_recording()
workflow=Workflow(recording, task_prompt)
awaitworkflow.generate_code()
result=workflow.run_workflow()
workflow.save("browser_automation.json")
asyncio.run(browser_automation_example())
Record user actions for later playback and analysis:
importasynciofromsisypho.utilsimportRecorderContext, await_task_completion, Workflowasyncdefrecording_example():
task_prompt="Record actions for email automation"withRecorderContext() asrecorder:
# Perform manual actions - they will be recordedawait_task_completion()
# Save the recordingrecording=recorder.get_recording()
workflow=Workflow(recording, task_prompt)
workflow.save("my_workflow.json")
asyncio.run(recording_example())
Integrate with MCP servers for enhanced AI capabilities:
importasynciofromsisypho.utilsimportRecorderContext, await_task_completion, Workflowasyncdefmcp_integration_example():
# Use natural language to describe complex workflowstask_prompt="""Open Excel from Downloads, calculate total sales column, and paste the result into a new Apple Notes entry."""withRecorderContext() asrecorder:
await_task_completion()
recording=recorder.get_recording()
workflow=Workflow(recording, task_prompt)
# Generate optimized code using MCP serversawaitworkflow.generate_code()
result=workflow.run_workflow()
workflow.save("mcp_workflow.json")
asyncio.run(mcp_integration_example())
MCP Server Setup and Usage
Launch Sisypho as an MCP server to expose your workflows as tools for computer use agents:
# Start the MCP server
python -m sisypho mcp --workflow-directory ./workflows
Connect from your computer use agent or MCP client:
# Example MCP client configurationfrommcp.clientimportClientasyncdefuse_sisypho_tools():
# Connect to Sisypho MCP serverclient=Client()
awaitclient.connect("stdio", command=["python", "-m", "sisypho", "mcp"])
# List available workflow toolstools=awaitclient.list_tools()
print(f"Available automation tools: {[tool.namefortoolintools]}")
# Execute a workflow toolresult=awaitclient.call_tool("run_workflow_0", {})
print(f"Workflow result: {result}")
Each workflow in your directory becomes an executable tool that computer use agents can call to perform UI automation tasks.
Custom UI Tools for Computer Use Agents
Sisypho SDK enables you to create reusable UI automation tools that computer use agents can leverage through the MCP protocol. Here's how workflows become powerful automation tools:
Workflow-to-Tool Conversion
When you launch the MCP server, Sisypho automatically:
Scans your workflow directory for .json workflow files
Registers each workflow as an MCP tool with its task description
Exposes the tools via the MCP protocol for agent consumption
Automatic workflow generation from browser interactions
Example 1: Automated Web Form Filling
importasynciofromsisypho.utilsimportRecorderContext, await_task_completion, Workflowasyncdefweb_form_automation():
task_prompt="""Navigate to example.com contact form, fill in name as 'John Doe', email as '[email protected]', message as 'Hello from Sisypho!', and submit the form."""withRecorderContext() asrecorder:
await_task_completion()
recording=recorder.get_recording()
workflow=Workflow(recording, task_prompt)
awaitworkflow.generate_code()
result=workflow.run_workflow()
workflow.save("web_form_automation.json")
asyncio.run(web_form_automation())
Example 2: Desktop Application Automation
importasynciofromsisypho.utilsimportRecorderContext, await_task_completion, Workflowasyncdefdesktop_app_automation():
task_prompt="""Open TextEdit, create a new document, type 'Automated document creation with Sisypho!', save the document as 'automated_document.txt'."""withRecorderContext() asrecorder:
await_task_completion()
recording=recorder.get_recording()
workflow=Workflow(recording, task_prompt)
awaitworkflow.generate_code()
result=workflow.run_workflow()
workflow.save("desktop_automation.json")
asyncio.run(desktop_app_automation())
Example 3: Complex Multi-App Workflow
importasynciofromsisypho.utilsimportRecorderContext, await_task_completion, Workflowasyncdefmulti_app_workflow():
task_prompt="""Open Excel from Downloads, calculate the total sales column, and paste the result into a new Apple Notes entry."""withRecorderContext() asrecorder:
await_task_completion()
recording=recorder.get_recording()
workflow=Workflow(recording, task_prompt)
awaitworkflow.generate_code()
result=workflow.run_workflow()
workflow.save("multi_app_workflow.json")
print("Multi-app workflow executed successfully!")
asyncio.run(multi_app_workflow())