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.

PyPI 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

uvx (Quick Start)

claude mcp add tkinter-mcp-server -- uvx tkinter-mcp-server

Note: Apps using PIL/ImageTk may have compatibility issues with uvx. Use pip install instead.

pip (Recommended for PIL apps)

pip install tkinter-mcp-server
claude mcp add tkinter-mcp-server -- tkinter-mcp-server

Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "tkinter": {
      "command": "tkinter-mcp-server"
    }
  }
}

For uvx: use "command": "uvx" with "args": ["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.3.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.3-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tkinter_mcp_server-0.9.3.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tkinter_mcp_server-0.9.3.tar.gz
Algorithm Hash digest
SHA256 3217ae705486ef8f993a78cb4b40b9ce47ea012bed3087d1746c63dbdaaa993b
MD5 d72e3db7f773517145b42cb37a2091b0
BLAKE2b-256 e89ef175b8da929b71fac66efd8d91d23f0d645037a82a5589cc333761e34ac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tkinter_mcp_server-0.9.3.tar.gz:

Publisher: publish.yml on tctibbs/tkinter-mcp-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for tkinter_mcp_server-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cddf2757affb0b2c4690b24055159d923bbfe7356ccefaffe028300f1ee3b40f
MD5 af58746fcd8513315d8f5fcdfeed974d
BLAKE2b-256 6e6ed6ce9d8016983d3eb5a62959828f51d2e49348bc70e5a5d754ee2cb46c5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tkinter_mcp_server-0.9.3-py3-none-any.whl:

Publisher: publish.yml on tctibbs/tkinter-mcp-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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