Microsoft Paint MCP Server

Microsoft Paint MCP Server

MCP server that automates Microsoft Paint on Windows, offering tools to draw freehand strokes, polylines, and logarithmic spirals through Win32 API calls.

Category
访问服务器

README

Microsoft Paint MCP Server for Node.js

English · Español

What if Paint were more than Paint?

Microsoft Paint is probably one of the least intimidating pieces of software ever shipped with Windows.

A blank canvas. A pencil. A few shapes. A color palette.

For millions of people, it may have been one of the first places where a computer became something you could experiment with rather than simply operate.

That simplicity made me curious.

Not because Paint needed automation.

But because I wanted to understand a more interesting question:

How far can an ordinary piece of software go when an AI is given a meaningful way to understand and interact with it?

That question became this project.


It started as a small experiment

The obvious way to automate Paint would have been to move a mouse to known screen coordinates and click buttons.

That works.

But it doesn't understand anything.

Change the window position, the display scale, the toolbar layout, or the environment, and coordinate-based automation quickly reveals what it really is: a script replaying gestures.

I wanted to approach the problem differently.

Before teaching an AI to draw with Paint, I wanted to understand Paint itself.

Its windows.

Its controls.

Its canvas.

Its coordinate systems.

Its accessibility tree.

Its behavior.

So the experiment moved downward before it moved upward.

Instead of asking:

How can an AI click Paint?

I started asking:

What does Paint expose about itself that software can actually understand?

That led to Windows UI Automation, inspection of the Paint accessibility tree, canvas discovery, window lifecycle management, coordinate transformations, Win32 input, and eventually a semantic interface between an AI and the application.

Curiosity became investigation.

Investigation became structure.

And structure eventually became an MCP server.


Paint became the renderer, not the idea

Once the interaction layer existed, another question appeared.

If an AI no longer had to think primarily in mouse coordinates, what should it think in?

The answer was not:

move pointer to x=412, y=287
press mouse button
move pointer to x=650, y=410
release

It was something closer to:

{
  "kind": "circle",
  "cx": 300,
  "cy": 220,
  "radius": 120
}

Or:

{
  "solid": "tesseract",
  "size": 110,
  "projection": "perspective"
}

That distinction changed the project.

Paint was no longer the abstraction.

It became the rendering surface beneath an emerging visual language.

The MCP server translates semantic and mathematical descriptions into geometry, geometry into logical canvas coordinates, and those coordinates into real mouse interaction with Microsoft Paint.

Idea
  ↓
Semantic description
  ↓
Geometry
  ↓
Canvas coordinates
  ↓
Windows interaction
  ↓
Microsoft Paint

That is the part of the experiment I find most interesting.


From circles to a tesseract

The drawing layer gradually became a small mathematical DSL.

It can currently express things such as:

  • circles, ellipses and arcs;
  • rectangles and rounded rectangles;
  • regular and star polygons;
  • logarithmic spirals;
  • grids and repeated structures;
  • arbitrary polylines;
  • Platonic solids;
  • toruses and torus knots;
  • surfaces of revolution;
  • custom wireframe meshes;
  • and even a tesseract projected from 4D → 3D → 2D.

The shapes are not created through Paint's native Shape buttons.

They are generated mathematically as points and strokes and then physically drawn onto the canvas.

That constraint is intentional.

It keeps the experiment focused on the boundary between abstract description and real application interaction.


Why do this with Paint?

Because Paint is deliberately ordinary.

If this experiment had started with Blender, AutoCAD, Mathematica or another sophisticated visual environment, much of the capability could be attributed to the application itself.

Paint gives us almost nothing.

And that makes it useful.

It forces the intelligence and abstraction to live somewhere else.

The result is a surprisingly flexible visual sandbox.

An AI can potentially use the same primitive canvas to explain:

Geometry

Construct polygons, transformations, projections and geometric relationships.

Mathematics

Turn equations and mathematical structures into visible objects.

Spatial reasoning

Explore three-dimensional objects through two-dimensional projections.

Diagrams

Express flows, relationships, timelines, maps and simple conceptual models.

Education

Build visual explanations step by step using one of the simplest applications available on Windows.

The interesting question is therefore no longer:

Can an AI draw in Paint?

Clearly, it can.

The more useful question is:

What can an AI explain when drawing becomes part of its language?


An example: a four-dimensional object in Paint

One of the available generators is a tesseract.

A tesseract is the four-dimensional analogue of a cube.

The implementation begins with the sixteen vertices of the hypercube, projects them from four dimensions into three, projects the result again into two dimensions, and finally converts its thirty-two edges into strokes that Paint can physically draw.

From the MCP client's perspective, the request remains semantic:

{
  "mode": "generator",
  "tool": "pencil",
  "fit": "contain",
  "generators": [
    {
      "kind": "solid",
      "solid": "tesseract",
      "size": 110,
      "rotX": 15,
      "rotY": -30,
      "projection": "perspective"
    }
  ]
}

Paint knows nothing about four-dimensional geometry.

It doesn't need to.

It is simply the final surface where an abstract idea becomes visible.

That separation is the architecture.


Not blind automation

AI was used extensively while building this project.

But using AI was never the interesting part.

The interesting part was deciding what had to be understood before something should be automated.

Throughout the experiment the workflow repeatedly looked like this:

observe
  ↓
question
  ↓
inspect
  ↓
model
  ↓
experiment
  ↓
specify
  ↓
implement
  ↓
verify

For example, the server does not assume that the Paint canvas lives at one permanent screen coordinate.

It discovers and resolves the application context, maintains the Paint session, maps logical drawing coordinates to the actual drawable canvas and uses Windows APIs to execute the interaction.

Drawing results can also be verified after execution rather than assuming that the absence of an exception means that ink actually appeared.

The goal is not to hide AI from the engineering process.

Nor is it to celebrate AI for producing code.

The experiment is about something else:

using AI to explore a system more deeply while keeping understanding, architecture and verification explicit.


How it works

At a high level:

LLM / MCP Client
        │
        ▼
     MCP Server
        │
        ▼
 PaintController
        │
        ├── Paint session management
        ├── UI Automation discovery
        ├── Semantic canvas resolution
        ├── Mathematical generators
        └── Coordinate transformation
        │
        ▼
 Win32 / SendInput adapter
        │
        ▼
 Microsoft Paint

The codebase follows a layered / hexagonal structure that keeps the mathematical domain independent from Windows-specific automation.

The pure geometry layer knows nothing about Paint.

The Paint orchestration layer knows nothing about MCP clients.

The Windows infrastructure implements the mechanics required to make the final interaction real.

For the deeper technical architecture, see the documentation below.


MCP capabilities

The server currently exposes seven MCP tools.

Tool Purpose
paint_draw 2D freehand and mathematical drawing DSL
paint_draw_3d Project and draw 3D/4D wireframe geometry
paint_napkin Simple visual-thinking primitives
paint_edit Erase, fill, text and crop operations
paint_canvas Resize and manage the canvas
paint_debug_ui Inspect the Paint UI Automation tree
paint_debug_canvas Inspect resolved canvas geometry

The productive drawing APIs operate in logical drawing space rather than requiring the caller to know where Paint happens to be on the screen.


The semantic drawing layer

The 2D DSL currently includes generators such as:

ellipse
circle
disk
arc
rectangle
roundedRectangle
polyline
logarithmicSpiral
regularPolygon
starPolygon
grid
dotsAlongPath

The 3D layer includes:

tetrahedron
cube
octahedron
dodecahedron
icosahedron
greatIcosahedron
starOctangula
tesseract
torus
torusKnot
revolution
wireframe

These descriptions are validated before reaching the drawing layer and transformed into pure geometry before any Windows interaction occurs.

The complete DSL reference lives in:

docs/dsl-paint-draw.md


Under the hood: understanding Paint

The project uses Windows UI Automation to discover application controls instead of relying entirely on fixed toolbar coordinates.

That investigation became useful enough to document independently.

If you are interested in understanding how a modern Windows application can be inspected and automated through its accessibility model, see:

docs/windows-automation-uia.md

There is also a practical PowerShell walkthrough:

docs/tutorial-paint-powershell.md

These documents preserve the engineering investigation behind the MCP implementation rather than hiding it behind the final API.


Quick start

Requirements

  • Windows
  • Microsoft Paint
  • Node.js
  • PowerShell
  • an MCP-compatible client

Clone the repository:

git clone https://github.com/miguelcespedes/mcp-server-microsoft-paint-nodejs.git
cd mcp-server-microsoft-paint-nodejs

Install dependencies:

npm install

Build:

npm run build

Run the MCP server:

npm start

See .mcp.json for an example MCP configuration.


A small experiment worth preserving

This repository is intentionally not an attempt to turn Microsoft Paint into professional graphics software.

There are already vastly better tools for that.

Paint is useful here precisely because of its limitations.

It provides a familiar, constrained environment in which several questions become easier to see:

How should an AI describe a visual idea?

Where should semantics end and application-specific automation begin?

How much application understanding is necessary before automation becomes reliable?

Can a simple canvas become a useful interface for mathematical or educational reasoning?

And what happens when we stop treating old software only according to the purpose for which it was originally designed?

I don't know where all of those questions lead.

That is part of why this repository exists.


Documentation

Document Purpose
docs/dsl-paint-draw.md Mathematical drawing DSL and generator reference
docs/windows-automation-uia.md Investigation of Paint through Windows UI Automation
docs/tutorial-paint-powershell.md Practical Paint automation tutorial using PowerShell

Additional architecture, examples, testing notes and implementation details may gradually move here as the experiment evolves.


Status

This is an experimental project.

Some capabilities are intentionally exploratory and some parts of Microsoft Paint's UI remain less deterministic than others.

That is not hidden.

The limitations are part of the investigation.

If you find an edge case, a better semantic abstraction, an interesting mathematical generator, or simply another unexpected use for the canvas, contributions and experiments are welcome.


One last thought

Curiosity is good at opening doors.

Discipline is what keeps what we find from disappearing.

And once a discovery is preserved, someone else can use it to begin another exploration.

Perhaps that is how curiosity becomes cumulative.


License

This project is released under the MIT License, Copyright (c) 2026 Miguel Cespedes.

You are free to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, as long as the copyright and permission notice is preserved.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选