微软绘图
STDIO通过微软命令行协议控制画图的服务器
通过微软命令行协议控制画图的服务器
A JSON-RPC 2.0 compatible server for controlling Microsoft Paint through the Microsoft Commandline Protocol (MCP).
To build the server:
cargo build --release
To run the server:
cargo run --release
The server accepts JSON-RPC 2.0 requests via stdin and responds via stdout.
initializeFinds or launches Microsoft Paint.
Request:
{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {} }
connectConnects to an already running Paint window.
Request:
{ "jsonrpc": "2.0", "id": 2, "method": "connect", "params": { "client_id": "your-client-id", "client_name": "Your Client Name" } }
draw_lineDraws a line from one point to another.
Request:
{ "jsonrpc": "2.0", "id": 3, "method": "draw_line", "params": { "start_x": 100, "start_y": 100, "end_x": 300, "end_y": 100, "color": "#FF0000", "thickness": 3 } }
activate_window - Brings the Paint window to the foregroundget_canvas_dimensions - Returns the current canvas sizedraw_pixel - Draws a single pixeldraw_shape - Draws a shape (rectangle, ellipse, etc.)select_tool - Selects a drawing toolset_color - Sets the current colorA simple test client is provided in final_test.py to demonstrate how to use the server:
python final_test.py
If you encounter issues with the server connecting to Paint:
This project is available under the MIT License.