This provider implements the MCPControl automation interfaces using AutoHotkey v2.
- AutoHotkey v2.0 or later must be installed on the system
AutoHotkey.exemust be available in the system PATH- Windows operating system (AutoHotkey is Windows-only)
AutoHotkey can be downloaded from: https://www.autohotkey.com/
Make sure to install version 2.0 or later.
const provider = createAutomationProvider({ provider: 'autohotkey' });const provider = createAutomationProvider({
providers: {
keyboard: 'autohotkey',
mouse: 'autohotkey',
screen: 'autohotkey',
clipboard: 'autohotkey',
},
});Set the automation provider to AutoHotkey:
export AUTOMATION_PROVIDER=autohotkeyConfigure the AutoHotkey executable path (optional):
export AUTOHOTKEY_PATH="C:\Program Files\AutoHotkey\v2\AutoHotkey.exe"Or use modular configuration:
export AUTOMATION_KEYBOARD_PROVIDER=autohotkey
export AUTOMATION_MOUSE_PROVIDER=autohotkey
export AUTOMATION_SCREEN_PROVIDER=autohotkey
export AUTOMATION_CLIPBOARD_PROVIDER=autohotkey- Type text
- Press individual keys
- Press key combinations
- Hold and release keys
- Move mouse to position
- Click mouse buttons
- Double-click
- Scroll
- Drag operations
- Get cursor position
- Get screen size
- Capture screenshots
- Get pixel colors
- Window management (focus, resize, reposition)
- Get active window information
- Set clipboard content
- Get clipboard content
- Check if clipboard has text
- Clear clipboard
The AutoHotkey provider executes AutoHotkey v2 scripts for each operation. This means:
- Each operation creates a temporary
.ahkscript file - The script is executed via
AutoHotkey.exe - Results are captured through temporary files or script output
- Temporary files are cleaned up after execution
Since each operation requires creating and executing a script, there is some overhead compared to native implementations. For high-frequency operations, consider batching operations or using a different provider.
If AutoHotkey is not installed or not in the PATH, operations will fail with an error message. Make sure AutoHotkey v2 is properly installed and accessible.
- Screenshot functionality is basic and uses Windows built-in tools (Paint, Snipping Tool)
- Some operations may have timing issues due to the script execution model
- Only works on Windows systems
- Requires AutoHotkey v2 syntax (not compatible with v1)
To debug AutoHotkey scripts, you can:
- Check the temporary script files generated in the system temp directory
- Run the scripts manually with AutoHotkey to see any error messages
- Enable AutoHotkey debugging features
When contributing to the AutoHotkey provider:
- Ensure all scripts use AutoHotkey v2 syntax
- Test on Windows with AutoHotkey v2 installed
- Handle errors gracefully
- Clean up temporary files properly
- Follow the existing code structure and patterns