The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the KeyboardExtAX listing page.

Fast, read-only accessibility snapshots of active third-party iOS keyboard extensions in Simulator.
A custom iOS keyboard runs in a separate app-extension process. When a client app presents that keyboard, ordinary UI automation usually sees the client application's accessibility tree but not the keyboard's useful descendants. The entire keyboard may appear as one opaque element.
That creates a practical automation gap:
KeyboardExtAX fills that gap. It attaches XCTest directly to the already-running keyboard extension by bundle identifier, parses its accessibility hierarchy, and returns plain JSON with absolute logical coordinates. A persistent runner keeps warm snapshots fast, while a small controller owns building, caching, ports, and per-simulator lifecycle.
KeyboardExtAX observes only. Use a separate automation tool, such as XcodeBuildMCP, to launch apps, focus text fields, and perform gestures with the returned coordinates.
Configure keyboard-ext-ax-mcp as a stdio MCP server. Most MCP clients use a configuration shaped like this:
If the MCP client does not inherit your shell PATH, replace the command with the absolute path printed by command -v keyboard-ext-ax-mcp.
The server exposes one tool:
Example input:
The result is returned as structured MCP content. The MCP layer delegates directly to the same controller used by the CLI, so build caching, sessions, errors, and output are identical.
With the client text field focused and the requested keyboard visible:
Add --output /tmp/keyboard.json to write the result to a file. Add --raw for the nested tree and XCTest diagnostics.
KeyboardExtAX currently supports:
It does not:
The parser reads XCUIApplication.debugDescription. Its text format is not a documented compatibility contract, so each Xcode version must be validated before support is claimed.
If multiple Xcode installations are present, select one with DEVELOPER_DIR or --developer-dir:
Install both executables permanently:
Or run the MCP server without a persistent installation:
Every installation provides keyboard-ext-ax and keyboard-ext-ax-mcp. The MCP server can be started with either keyboard-ext-ax-mcp or keyboard-ext-ax mcp.
The bundled Xcode project is ready to use. XcodeGen is needed only when modifying keyboard_ext_ax/harness/project.yml.
The default response is a compact, flat array:
| Field | Meaning |
|---|---|
ref | Stable path within this snapshot only. Refresh it after layout changes. |
type | XCTest accessibility element type. |
identifier | Accessibility identifier, when provided by the extension. |
label | Accessibility label, when provided by the extension. |
frame | Absolute logical frame in Simulator coordinates. |
center | Exact floating-point frame center. |
tap_x, tap_y | Rounded integer center, ready for a gesture tool. |
Coordinates are Simulator logical coordinates, not screenshot pixels. Do not rescale them before passing them to XcodeBuildMCP for the same simulator.
One runner is maintained per simulator. Multiple simulators can be queried concurrently. If a reused runner loses the extension process, KeyboardExtAX recycles it once and returns client_refocus_required.
Errors are JSON objects with stable codes.
| Code | Meaning | Recovery |
|---|---|---|
client_refocus_required | A new or restarted runner is ready. | Refocus the client text field and repeat the request. |
extension_not_active | XCTest could not attach after three attempts. | Confirm that the requested extension—not the system keyboard—is visible, then retry. |
runner_start_failed | The persistent XCTest runner did not become ready. | Inspect the returned log and log_tail. |
build_failed | The XCTest harness failed to build. | Inspect the returned build log and verify the selected Xcode. |
xcode_unavailable | Xcode could not be located or queried. | Set DEVELOPER_DIR or pass --developer-dir. |
extension_bundle_id_missing | The runner received no extension identifier. | Supply extension_bundle_id. |
snapshot_failed | XCTest raised an unexpected snapshot error. | Retry with raw: true and inspect diagnostics. |
The CLI exits with:
0 for success;2 for a normal snapshot-state error such as inactive extension;1 for lifecycle, build, or controller failures.The host app included in this repository is XCTest scaffolding. Snapshot mode does not launch it and does not replace the consumer's foreground client app.
KeyboardExtAX is available under the MIT License.