MCP clients
The agent serves its tools over MCP's streamable HTTP transport at http://127.0.0.1:8765/mcp. Any MCP client that supports this transport can use them, with no adapter in between.
Before you connect
Section titled “Before you connect”-
Start your app with the agent (see Installation).
-
Check that it answers:
Terminal window java -jar swing-ui-agent-0.1.0-SNAPSHOT-agent.jar sessionExit code
0and a JSON answer mean the agent is up. Withport=set, pass the same--port, and use that port in the URL below.
Connect a client
Section titled “Connect a client”In Claude Code, add the server once per project:
claude mcp add --transport http swing-ui http://127.0.0.1:8765/mcpOther clients take the same URL in their settings. Where a client asks for a JSON entry, it usually looks like this (the exact keys depend on the client):
{ "mcpServers": { "swing-ui": { "type": "http", "url": "http://127.0.0.1:8765/mcp" } }}The client then lists the tools (snapshot, click, expect, recording, export_recorded_test, run_recorded_test, export_test and the rest) and receives short server instructions on how to read and act on the app.
Recording and recorded tests over MCP
Section titled “Recording and recorded tests over MCP”- Record: call
recordingwith{"op":"start","reset":true}, act with the usual tools, then{"op":"stop"}andexport_recorded_test. The person at the app sees the steps in the palette and can change them. See Record together with your agent. - Run:
run_recorded_testwith aname, apath, or the file's JSON astest. The answer carriespassed,ran,totaland every step or check. A client has no exit code, so readpassed. - Images: a failing step's picture is written to a file under
evidence; the answer names it.
What the endpoint does and does not do
Section titled “What the endpoint does and does not do”- Stateless. Each POST carries one JSON-RPC message and gets its answer in the response. There is no MCP session to keep alive, and no server-sent stream (a GET answers 405).
- Tools only. The server offers tools. No prompts or resources.
- Local only. It listens on loopback and refuses requests from web pages (see Security). A client must run on the same machine as the app.
- The CLI next to it. Even with an MCP client set up, the agent jar's command line still works; the skills use it. See CLI or MCP?.
When it does not connect
Section titled “When it does not connect”- Nothing listens. The app is not running with the agent, or it uses another port.
java -jar <agent jar> --port <port> sessionexits with3in that case. - HTTP 403. The request carried an
Originheader for a host other than localhost, as a web page would. MCP clients normally send none. - The client wants SSE. This server speaks streamable HTTP only, not the older HTTP+SSE transport. Pick the "http" or "streamable HTTP" transport in the client.
What's next
Section titled “What's next”Apache-2.0 · A Kormcrete project · For coding agents:llms.txt, llms-full.txt