
KeyboardExtAX
io.github.Nikitosina由 GitHub 账号 Nikitosina 发布v0.1.2更新于 Oct 24, 2026
Accessibility snapshots and tap coordinates for active third-party iOS keyboards in Simulator.
概览
只读的 MCP 服务器,为 iOS 模拟器中正在运行的第三方 iOS 键盘扩展返回无障碍快照和点击坐标。
- 可以做什么
- 根据模拟器 ID 和扩展 Bundle 标识,对模拟器中正在运行的第三方键盘扩展做只读无障碍快照,返回按键与控件的扁平 JSON 列表,含位置框、中心点和取整后的点击坐标。可选择返回原始嵌套无障碍树和 XCTest 诊断信息。按模拟器复用常驻 XCTest 运行器,使重复快照保持快速,并给出 client_refocus_required、extension_not_active 等稳定错误码。
- 适用场景
- 适合在模拟器中自动化或测试自定义 iOS 键盘,尤其是普通 UI 自动化只能把键盘看成一个不透明元素的场景。需配合单独的点击工具,在返回的坐标上执行手势。
- 运行要求
- macOS 主机,安装 Xcode 26.5 和目标 iOS 模拟器运行时,Python 3.10 或更高版本;键盘应用及扩展已安装并在模拟器设置中启用,前台客户端应用有聚焦的文本框。以 stdio 本地运行,例如通过 uvx。DEVELOPER_DIR 可选指定 Xcode 安装位置,KEYBOARD_EXT_AX_CACHE_DIR 可选设置缓存目录。
安装
在 SourceWeft 中
- 打开 控制台中的 KeyboardExtAX,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
KeyboardExtAX
[KeyboardExtAX accessibility snapshot illustration]
Fast, read-only accessibility snapshots of active third-party iOS keyboard extensions in Simulator.
Why this project exists
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:
- screenshots can show the keyboard, but extracting reliable tap coordinates from pixels is slow and brittle;
- the client application's accessibility snapshot does not necessarily expose the extension's keys and controls;
- starting a new XCTest session for every query is expensive and can disturb keyboard focus;
- XCTest element handles become stale whenever the keyboard changes layout;
- automation agents should not need to manage test plans, ports, build products, or runner processes.
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.
Quick start: MCP
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.
Quick start: CLI
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.
Scope and limitations
KeyboardExtAX currently supports:
- macOS hosts;
- iOS Simulator;
- third-party keyboard extensions;
- Xcode 26.5;
- read-only accessibility snapshots.
It does not:
- tap, swipe, or type;
- launch or foreground the client app;
- select or enable a keyboard for the user;
- access physical iOS devices;
- guarantee compatibility with widgets, Live Activities, or other extension types;
- guarantee parser compatibility with untested Xcode versions.
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.
Requirements
- macOS
- Xcode 26.5 with the desired iOS Simulator runtime installed
- Python 3.10 or newer
- A keyboard app and extension already installed in the target simulator
- The keyboard enabled in Settings → General → Keyboard → Keyboards
- A foreground client app with a focused text field
If multiple Xcode installations are present, select one with DEVELOPER_DIR or --developer-dir:
Installation
Homebrew (recommended)
PyPI with uv
Install both executables permanently:
Or run the MCP server without a persistent installation:
From source
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.
Output
The default response is a compact, flat array:
Element fields
Coordinates are Simulator logical coordinates, not screenshot pixels. Do not rescale them before passing them to XcodeBuildMCP for the same simulator.
Session management
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
Errors are JSON objects with stable codes.
The CLI exits with:
0for success;2for a normal snapshot-state error such as inactive extension;1for lifecycle, build, or controller failures.
Architecture
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.
License
KeyboardExtAX is available under the MIT License.
来源:README.md,提交 347b854
工具
0版本历史
2- v0.1.2最新Sep 23, 2026
- v0.1.1Sep 18, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分