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

Claude Code

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

Claude Desktop

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

{
  "mcpServers": {
    "tkinter": {
      "command": "uvx",
      "args": ["tkinter-mcp-server"]
    }
  }
}

pip

pip install 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.2.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.2-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tkinter_mcp_server-0.9.2.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.2.tar.gz
Algorithm Hash digest
SHA256 eb9c6ea781bcfe9da5209cc5e323eb9b99d29acd439e86c685f161cb45a5b962
MD5 c86655dcdddd92999648e150f889314e
BLAKE2b-256 42402287a3df2b59b8d6cbdf914efbd51bcbacbbb63af16cb2a7c808dae6e678

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tkinter_mcp_server-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ce0e21fe44e05b10eeaeeabc27a4fc64b0f3917d828720575010cc7394b6916b
MD5 eb7578b14310a778d602bfc2df6d325d
BLAKE2b-256 4c080788d68098170cb9f2d986ba5a016d3f6a6599f4dee66c3af66edb696c81

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