Swing MCP logo

Swing MCP

Automates running Java Swing and JavaFX desktop applications through MCP tools for snapshots, input, forms, tables, trees, menus, and dialogs.

Install Swing MCP

Pick your client, then add it in one click or paste the config.

Streamable HTTP (Remote)
Server URL
https://crosstech.solutions/mcp

Remote servers are added in the app, not the config file: Customize → Connectors → Add custom connector, then paste this URL.

Overview

Swing MCP MCP server connects MCP clients to running Java Swing and JavaFX desktop applications through a Java agent loaded into the target JVM. Its stdio server forwards operations over a localhost socket and runs them on the appropriate UI thread. Use it to inspect and operate desktop software that lacks an API or web interface, including mixed Swing and JavaFX applications. JDK 21+ is required, and the server can launch an application or attach to one by process ID.

Use cases

  • Inspect a running Java desktop application's controls
  • Launch or attach to a Swing or JavaFX application
  • Complete forms in legacy desktop software
  • Read and operate tables and trees
  • Drive menus and dialogs during UI workflows

Key features

  • Swing and JavaFX UI automation
  • Application launch and PID-based attachment
  • UI snapshots with toolkit-prefixed component UIDs
  • Clicks, text entry, form filling, tables, trees, menus, and dialogs
  • Stdio MCP transport with a localhost agent socket
  • Optional Java evaluation disabled by default

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

6/6 checks healthy over the last 41d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars4Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.

How Swing MCP works

What Swing MCP MCP server does

Swing MCP MCP server lets an MCP client inspect and control Java desktop user interfaces built with Swing or JavaFX. It can work with applications using either toolkit, including applications that combine both. The available workflows cover discovering the UI, clicking controls, entering text, completing forms, and interacting with tables, trees, menus, and dialogs.

The server is intended for software that is otherwise difficult for an AI assistant to reach, such as internal business tools, ERP clients, point-of-sale systems, laboratory software, and logistics applications. It operates through the existing interface rather than requiring changes to the target application.

How it works

The MCP-facing component uses stdio transport. When a client calls launch_app, the server starts a JVM with the agent already loaded. attach_to_app instead loads the agent into an existing JVM using its process ID. The agent opens a loopback-only JSON line protocol socket and reports the selected connection details through a response file.

Commands from the server are sent to the agent and executed on the owning toolkit's UI thread: Swing operations run on the Event Dispatch Thread, while JavaFX operations run on the JavaFX Application Thread. Component identifiers include a toolkit prefix, such as comp- for Swing and fx- for JavaFX, so controls remain distinguishable in mixed-toolkit applications.

Tool metadata includes MCP annotations for titles, read-only behavior, destructive behavior, idempotence, and open-world operations. Clients that use these annotations can treat read-only actions differently from operations such as stop_app, close_window, and evaluate_java.

Setup and configuration

Swing MCP MCP server requires JDK 21 or newer. The project can be built with Maven using mvn verify; GUI tests need a display environment, while CI runs them with Xvfb. Users who do not want to build can install the released swing-mcp.mcpb bundle through a supported client such as Claude Desktop.

For a manual stdio registration, run the server JAR with Java and set SWING_MCP_AGENT_JAR to the path of the agent JAR. After registration, launch either a target application or the included Swing and JavaFX demo applications. A practical first sequence is to launch or attach, call take_snapshot to obtain component UIDs, then use interaction tools with those identifiers.

The agent port range is controlled by the swing.mcp.agent-port-min..max configuration properties. The agent binds only to the loopback interface. Arbitrary Java execution is off by default and requires swing.mcp.evaluate.enabled=true to enable evaluate_java.

Tools and capabilities

The documented examples identify these capabilities:

  • Start an application or connect to an existing JVM with launch_app and attach_to_app.
  • Inspect the current interface with take_snapshot.
  • Click controls and enter values with click and fill.
  • Choose values and work with common structured UI elements such as tables and trees.
  • Operate menus and dialogs, including controlled application and window actions.
  • Run Java evaluation only when the explicit configuration setting allows it.

Swing MCP MCP server exposes one tool set across Swing and JavaFX; the client does not need to select the toolkit before issuing commands.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Swing MCP

Swing MCP is an MCP server that connects AI assistants to running Java Swing and JavaFX desktop applications through a Java agent. Its tools launch or attach to apps, snapshot interfaces, click, type, fill forms, and read or operate tables, trees, menus, and dialogs.

Install the released `swing-mcp.mcpb` bundle in Claude Desktop, or register the server JAR as a stdio MCP server with `SWING_MCP_AGENT_JAR` pointing to the agent JAR. JDK 21 or newer must be available on `PATH`.

Yes, it can attach to a running application by process ID with `attach_to_app`. It can also start a JVM with the agent preloaded by using `launch_app`.

Yes, Swing MCP supports JavaFX as well as Swing, including applications that mix both toolkits. JavaFX commands run on the JavaFX Application Thread, and JavaFX component UIDs use the `fx-` prefix.

No, `evaluate_java` is disabled by default. Enable it with `swing.mcp.evaluate.enabled=true`; the operation is treated as potentially destructive by clients that honor MCP annotations.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSwing MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/swing-mcp-2?style=directory)](https://allmcps.com/mcp/swing-mcp-2)
HTML Embed
<a href="https://allmcps.com/mcp/swing-mcp-2"><img src="https://allmcps.com/api/badge/swing-mcp-2?style=directory" alt="Swing MCP on AllMCPs" /></a>