Merge pull request #493 from YeIIcw/docs/mcp-server-locally

Add Local Desktop Mode for MCP Server with updated docs
This commit is contained in:
Adam
2025-11-17 14:56:10 +00:00
committed by GitHub
11 changed files with 914 additions and 15 deletions

View File

@@ -1287,7 +1287,15 @@ class MacOSAutomationHandler(BaseAutomationHandler):
if not isinstance(screenshot, Image.Image):
return {"success": False, "error": "Failed to capture screenshot"}
# Resize image to reduce size (max width 1920, maintain aspect ratio)
max_width = 1920
if screenshot.width > max_width:
ratio = max_width / screenshot.width
new_height = int(screenshot.height * ratio)
screenshot = screenshot.resize((max_width, new_height), Image.Resampling.LANCZOS)
buffered = BytesIO()
# Use PNG format with optimization to reduce file size
screenshot.save(buffered, format="PNG", optimize=True)
buffered.seek(0)
image_data = base64.b64encode(buffered.getvalue()).decode()