Skip to main content

MCP server for inspecting and automating Tkinter GUI applications

Project description

tkinter-mcp

MCP server for inspecting and automating Tkinter GUI applications.

Python 3.10+ License: MIT MCP

Overview

An MCP server that enables AI agents to launch, inspect, and interact with Tkinter applications. The server auto-injects an inspection agent via monkey-patching. No modifications to target apps required.

Demo

Tools

Tool Description
launch_app Start a Tkinter app with inspection enabled
is_connected Check if an app is currently connected
get_ui_layout Get the widget tree as structured JSON
view_application Capture a high-quality JPEG screenshot
view_application_thumbnail Capture a small thumbnail screenshot
get_window_info Get window position and dimensions
click_widget Click a widget (left/right/middle, single/double)
type_text Type text into Entry or Text widgets
get_widget_by_text Find a widget by its text content
focus_widget Set keyboard focus to a widget
get_focused_widget Get the currently focused widget
get_widget_value Get widget value (Entry, Text, Scale, Checkbox, etc.)
set_widget_value Set widget value based on widget type
get_widget_options Get options for Combobox or Listbox
drag_widget Drag and drop between two widgets
close_app Terminate the application

Installation

Clone the repository and install:

git clone https://github.com/tctibbs/tkinter-mcp-server.git
cd tkinter-mcp-server
pip install -e .

Then add to your MCP client configuration:

{
  "mcpServers": {
    "tkinter": {
      "command": "python",
      "args": ["-m", "tkinter_mcp.main"],
      "cwd": "/path/to/tkinter-mcp-server"
    }
  }
}

How It Works

The server launches Tkinter apps through a custom launcher that patches tkinter.Tk.__init__. This injects an agent that communicates over a local socket, enabling thread-safe inspection and control of the GUI.

flowchart LR
    A[MCP Client] <--> B[MCP Server]
    B <--> C[Socket]
    C <--> D[Agent]
    D <--> E[Tkinter App]

Requirements

  • Python 3.10+
  • macOS, Windows, or Linux

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tkinter_mcp_server-0.9.1.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkinter_mcp_server-0.9.1-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file tkinter_mcp_server-0.9.1.tar.gz.

File metadata

  • Download URL: tkinter_mcp_server-0.9.1.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for tkinter_mcp_server-0.9.1.tar.gz
Algorithm Hash digest
SHA256 33f464783a8397423f8cbdbb0ac295a15f03f96803e97704ad015587de03e4ef
MD5 d3c93e3259eb95211fd2f02a1bd738dd
BLAKE2b-256 af03b97d066d5aaf6d8b717a9e21358cde9ecf39d009e1eb587283e65ac3c94c

See more details on using hashes here.

File details

Details for the file tkinter_mcp_server-0.9.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tkinter_mcp_server-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0b7de9ec7847e481329c65173728d7f6c2f4f744b2f8f7e88ed865fdea8b61d
MD5 46bd7829c2c2bb675dc8e6d5a7edfd60
BLAKE2b-256 71de729d33523ab2058724985a22fc5f0aec9720e1dbc766ffeb16fa3d2f77b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page