computer-control-mcp 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/PKG-INFO +5 -3
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/README.md +2 -2
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/core.py +10 -10
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/test.py +8 -5
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/pyproject.toml +3 -1
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/.gitignore +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/LICENSE +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/FZYTK.TTF +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/__init__.py +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/__main__.py +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/cli.py +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/gui.py +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/resized_img.png +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/server.py +0 -0
- {computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/test_image.png +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: computer-control-mcp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Computer control capabilities using PyAutoGUI through a Model Context Protocol (MCP) server
|
|
5
5
|
Project-URL: Homepage, https://github.com/AB498/computer-control-mcp
|
|
6
6
|
Project-URL: Issues, https://github.com/AB498/computer-control-mcp/issues
|
|
@@ -18,16 +18,18 @@ Classifier: Topic :: Utilities
|
|
|
18
18
|
Requires-Python: >=3.12
|
|
19
19
|
Requires-Dist: fuzzywuzzy
|
|
20
20
|
Requires-Dist: mcp[cli]
|
|
21
|
+
Requires-Dist: onnxruntime
|
|
21
22
|
Requires-Dist: opencv-python
|
|
22
23
|
Requires-Dist: pillow
|
|
23
24
|
Requires-Dist: pyautogui
|
|
24
25
|
Requires-Dist: pygetwindow
|
|
26
|
+
Requires-Dist: rapidocr
|
|
25
27
|
Requires-Dist: rapidocr-onnxruntime
|
|
26
28
|
Description-Content-Type: text/markdown
|
|
27
29
|
|
|
28
30
|
# Computer Control MCP
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
MCP server that provides computer control capabilities, like mouse, keyboard, OCR, etc. using PyAutoGUI, RapidOCR, ONNXRuntime. With Zero External Dependencies.
|
|
31
33
|
|
|
32
34
|
## Quick Usage (MCP Setup Using `uvx`)
|
|
33
35
|
|
|
@@ -36,7 +38,7 @@ A Python package that provides computer control capabilities, like mouse, keyboa
|
|
|
36
38
|
"mcpServers": {
|
|
37
39
|
"computer-control-mcp": {
|
|
38
40
|
"command": "uvx",
|
|
39
|
-
"args": ["computer-control-mcp"]
|
|
41
|
+
"args": ["computer-control-mcp@latest"]
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Computer Control MCP
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP server that provides computer control capabilities, like mouse, keyboard, OCR, etc. using PyAutoGUI, RapidOCR, ONNXRuntime. With Zero External Dependencies.
|
|
4
4
|
|
|
5
5
|
## Quick Usage (MCP Setup Using `uvx`)
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ A Python package that provides computer control capabilities, like mouse, keyboa
|
|
|
9
9
|
"mcpServers": {
|
|
10
10
|
"computer-control-mcp": {
|
|
11
11
|
"command": "uvx",
|
|
12
|
-
"args": ["computer-control-mcp"]
|
|
12
|
+
"args": ["computer-control-mcp@latest"]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -149,7 +149,7 @@ def _find_matching_window(
|
|
|
149
149
|
@mcp.tool()
|
|
150
150
|
def tool_version() -> str:
|
|
151
151
|
"""Get the version of the tool."""
|
|
152
|
-
return "0.2.
|
|
152
|
+
return "0.2.2"
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
@mcp.tool()
|
|
@@ -268,24 +268,24 @@ def take_screenshot(
|
|
|
268
268
|
|
|
269
269
|
|
|
270
270
|
@mcp.tool()
|
|
271
|
-
def
|
|
271
|
+
def get_ocr_from_screenshot(
|
|
272
272
|
title_pattern: str = None,
|
|
273
273
|
use_regex: bool = False,
|
|
274
274
|
threshold: int = 60,
|
|
275
275
|
scale_percent: int = 100,
|
|
276
|
-
) ->
|
|
276
|
+
) -> List[Tuple[List[List[int]], str, float]]:
|
|
277
277
|
"""
|
|
278
|
-
Get OCR text from the
|
|
279
|
-
If no title pattern is provided, get all
|
|
278
|
+
Get OCR text with absolute coordinates (returned after adding the window offset from true (0, 0) of screen to the OCR coordinates, so clicking is on-point. Recommended to click in the middle of OCR Box) and confidence from window with the specified title pattern.
|
|
279
|
+
If no title pattern is provided, get all text on the screen.
|
|
280
280
|
|
|
281
281
|
Args:
|
|
282
282
|
title_pattern: Pattern to match window title, if None, get all UI elements on the screen
|
|
283
283
|
use_regex: If True, treat the pattern as a regex, otherwise best match with fuzzy matching
|
|
284
|
-
save_to_downloads: If True, save the screenshot to the downloads directory and return the absolute path
|
|
285
284
|
threshold: Minimum score (0-100) required for a fuzzy match
|
|
285
|
+
scale_percent: Percentage to scale the image down before processing, you wont need this most of the time unless your pc is extremely old or slow
|
|
286
286
|
|
|
287
287
|
Returns:
|
|
288
|
-
List of UI elements as
|
|
288
|
+
List of UI elements as [[4 corners of box], text, confidence]
|
|
289
289
|
"""
|
|
290
290
|
try:
|
|
291
291
|
|
|
@@ -357,10 +357,10 @@ def get_screenshot_with_ocr(
|
|
|
357
357
|
|
|
358
358
|
result, elapse_list = engine(resized_img)
|
|
359
359
|
boxes, txts, scores = list(zip(*result))
|
|
360
|
-
|
|
360
|
+
boxes = [[[x + window.left, y + window.top] for x, y in box] for box in boxes]
|
|
361
361
|
zipped_results = list(zip(boxes, txts, scores))
|
|
362
|
-
|
|
363
|
-
return
|
|
362
|
+
|
|
363
|
+
return zipped_results
|
|
364
364
|
|
|
365
365
|
except Exception as e:
|
|
366
366
|
log(f"Error getting UI elements: {str(e)}")
|
|
@@ -208,7 +208,7 @@ def take_screenshot(
|
|
|
208
208
|
return f"Error taking screenshot: {str(e)}"
|
|
209
209
|
|
|
210
210
|
|
|
211
|
-
def
|
|
211
|
+
def get_ocr_from_screenshot(
|
|
212
212
|
title_pattern: str = None,
|
|
213
213
|
use_regex: bool = False,
|
|
214
214
|
threshold: int = 60,
|
|
@@ -297,10 +297,10 @@ def get_screenshot_with_ocr(
|
|
|
297
297
|
|
|
298
298
|
result, elapse_list = engine(resized_img)
|
|
299
299
|
boxes, txts, scores = list(zip(*result))
|
|
300
|
-
|
|
300
|
+
boxes = [[[x + window.left, y + window.top] for x, y in box] for box in boxes]
|
|
301
301
|
zipped_results = list(zip(boxes, txts, scores))
|
|
302
|
-
|
|
303
|
-
return
|
|
302
|
+
|
|
303
|
+
return zipped_results
|
|
304
304
|
|
|
305
305
|
except Exception as e:
|
|
306
306
|
log(f"Error getting UI elements: {str(e)}")
|
|
@@ -310,4 +310,7 @@ def get_screenshot_with_ocr(
|
|
|
310
310
|
log(f"Stack trace:\n{stack_trace}")
|
|
311
311
|
return f"Error getting UI elements: {str(e)}\nStack trace:\n{stack_trace}"
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
|
|
314
|
+
import json
|
|
315
|
+
|
|
316
|
+
print(json.dumps(get_ocr_from_screenshot("chrome")))
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "computer-control-mcp"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "Computer control capabilities using PyAutoGUI through a Model Context Protocol (MCP) server"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -27,6 +27,8 @@ dependencies = [
|
|
|
27
27
|
"pillow",
|
|
28
28
|
"pygetwindow",
|
|
29
29
|
"fuzzywuzzy",
|
|
30
|
+
"rapidocr",
|
|
31
|
+
"onnxruntime",
|
|
30
32
|
"rapidocr_onnxruntime",
|
|
31
33
|
"opencv-python"
|
|
32
34
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/resized_img.png
RENAMED
|
File without changes
|
|
File without changes
|
{computer_control_mcp-0.2.0 → computer_control_mcp-0.2.2}/computer_control_mcp/test_image.png
RENAMED
|
File without changes
|