Sponsored by Deepsite.site

Paint Drawing Agent

Created By
shivman8 months ago
This project demonstrates an Agentic AI system that uses a Gemini-powered MCP server to interpret natural language instructions and automate Microsoft Paint using GUI simulation tools on Windows.
Content

Paint Drawing Agent

A Python-based automation tool that uses Google's Gemini AI to control Microsoft Paint through natural language commands. This project enables users to draw shapes, write text, and manipulate colors in MS Paint using simple English instructions.

Features

  • Natural language control of MS Paint
  • Automated drawing of shapes (circles, rectangles, lines)
  • Text insertion with position control
  • Color selection and management
  • Window management and canvas positioning
  • Detailed logging and error handling
  • Position calibration system

Prerequisites

  • Windows 10 or later
  • Python 3.8+
  • Microsoft Paint (mspaint.exe)
  • Google Cloud API key for Gemini AI

Installation

  1. Clone the repository:
git clone [repository-url]
cd paint-drawing-agent
  1. Install required dependencies:
pip install -r requirements.txt
  1. Create a .env file in the project root and add your Google API key:
GOOGLE_API_KEY=your_api_key_here

Project Structure

paint-drawing-agent/
├── talk2mcp.py           # Main application file
├── tools/                # Core automation tools
│   ├── __init__.py
│   └── paint_commands.py # Paint automation commands
├── calibration_profiles/ # Stored calibration data
├── LLM_LOGS/            # AI interaction logs
├── logs/                # Application logs
└── requirements.txt     # Project dependencies

Usage

  1. Start the Paint Drawing Agent:
python talk2mcp.py
  1. Enter natural language commands, for example:
  • "Draw a red circle in the center"
  • "Write 'Hello World' in black at the top"
  • "Draw a blue rectangle on the right side"
  1. To exit the program, type 'quit'

Command Examples

> Draw a red circle in the center
> Write 'Hello World' in black at the top
> Draw a blue rectangle at coordinates 400,300
> Draw a green line from top to bottom

Calibration

The system uses a calibration system to accurately locate Paint interface elements. To recalibrate:

  1. Run the calibration script:
python enhanced_calibrate.py
  1. Follow the on-screen instructions to calibrate tool positions

Logging

The system maintains several types of logs:

  • Application logs: /logs/paint_agent_[timestamp].log
  • LLM interaction logs: /LLM_LOGS/session_log.json
  • Calibration logs: /calibration_profiles/

Error Handling

The system includes comprehensive error handling for:

  • Window management issues
  • Drawing operation failures
  • AI communication errors
  • Position calibration problems

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Troubleshooting

Common issues and solutions:

  1. Paint Window Not Found

    • Ensure MS Paint is installed
    • Try running Paint manually first
  2. Drawing Position Issues

    • Run calibration again
    • Check screen resolution matches calibration
  3. AI Communication Errors

    • Verify API key in .env file
    • Check internet connection

License

[Your License Here]

Acknowledgments

  • Google Gemini AI for natural language processing
  • PyAutoGUI for GUI automation
  • Win32GUI for Windows interaction
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
WindsurfThe new purpose-built IDE to harness magic
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Playwright McpPlaywright MCP server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
CursorThe AI Code Editor