v3/examples/mcp/README.md
A playground application that an LLM can test and control through the
Model Context Protocol using the
built-in MCP server (v3/pkg/application, enabled with -tags mcp).
The page contains a counter, a text input wired to a bound Go method, a drag & drop area and a scrollable list — one widget for each MCP tool category. Simulated mouse input is rendered with an animated cursor inside the window, so you can watch the LLM drive the app.
The MCP service is compiled in only with the mcp build tag:
go run -tags mcp .
In a real project the tag is added automatically by setting an environment variable when building:
WAILS_MCP=1 wails3 build # or: wails3 build -tags mcp
WAILS_MCP=1 wails3 dev
Without the tag the service is a no-op stub and the app behaves normally.
The server listens on http://127.0.0.1:9099/mcp (streamable HTTP).
Configure the port with the WAILS_MCP_PORT environment variable.
For Claude Code:
claude mcp add --transport http mcp-demo http://127.0.0.1:9099/mcp
Then ask things like:
app_info, windows_list, window_control, js_eval, dom_html,
dom_query, screenshot_dom, mouse_move, mouse_click, mouse_drag,
mouse_scroll, keyboard_type, keyboard_press, call_bound_method,
emit_event, wait_for_event.