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.0.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.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tkinter_mcp_server-0.9.0.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.0.tar.gz
Algorithm Hash digest
SHA256 3215ceb7e445473d6fcfdb7da29048d890caae0e2f438238443ec3e3f2fc01c0
MD5 6516aab3c742f00cf9ef121e22659e11
BLAKE2b-256 4e5a922a3c4c080d9f2b927a347140644537e81a8447ed308300abf35ed46712

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tkinter_mcp_server-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcfccc37d87b53d459415ed1889f6063183ddef5c881cf538240646388e32860
MD5 9070358cdad91c87971205c7239b6665
BLAKE2b-256 7e5f9be0656155836320ae0534bc19f31fbb45b5501c45a79ea4cf6423637beb

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