PySide6 MCP

io.github.com55由 GitHub 账号 com55 发布v0.1.0更新于 Oct 24, 2026

Playwright-style MCP to inspect, control, and debug PySide6 desktop GUIs.

已验证STDIO仅桌面浏览器自动化开发者工具

概览

AI 生成的概览

让 AI 助手无需修改应用源码即可检查、截图、点击、输入并调试正在运行的 PySide6 桌面图形界面。

可以做什么
这是一个面向 PySide6 桌面应用的 Playwright 风格 MCP 服务器。它通过本地 HTTP 桥接启动或连接正在运行的应用,并提供工具来截取窗口或控件截图、读取完整控件树和单个控件属性、按类名、对象名或文本查找控件,以及通过单击、双击、输入、按键和滚动进行交互。它还能列出并触发 QAction 菜单项、读取 Python 日志和原始标准输出/错误、报告应用状态与桥接健康状况,并可在应用进程内执行 Python 以进行更深入的检查。
适用场景
适合让助手驱动或调试 PySide6 桌面应用:复现界面缺陷、排查控件为何被禁用、填写并提交表单,或在会话中截取截图和日志。它面向本地桌面开发,而非无头或网页测试。
运行要求
以 stdio 方式运行的本地进程。需要 Python 3.11+、目标应用环境中的 PySide6 6.6+,以及 PATH 中的 uv(用 uvx 运行服务器)。桥接运行在应用内部;launch_app 通过隔离的 PYTHONPATH 注入,也可运行 python -m pyside6_mcp 或调用 install_bridge()。桥接监听 localhost,默认端口 7890,可用 PYSIDE6_MCP_PORT 覆盖。已在 Windows 测试,Linux 和 macOS 预期可用。
安装前请注意
eval_python 工具会在目标应用进程内执行任意 Python,click、type_text、press_key、scroll 和 trigger_action 会改变应用状态,因此请用于测试数据而非生产或真实数据。桥接会在 127.0.0.1 上开放本地 HTTP 端点(默认端口 7890,或 PYSIDE6_MCP_PORT);任何能访问该端口的程序都可控制该应用。launch_app 会启动进程,stop_app 会停止本机进程。

安装

在 SourceWeft 中

  1. 打开 控制台中的 PySide6 MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

pyside6-mcp

Playwright-style MCP server for PySide6 apps — lets AI assistants see, control, and debug your Python desktop GUI without modifying your app's source code.

AI assistant → MCP tools → pyside6-mcp server → HTTP bridge (ephemeral localhost port) → PySide6 app

Features

  • Screenshot any window or widget
  • Inspect the full widget tree (class, name, geometry, text, state)
  • Click, type, scroll, press keys — full interaction
  • Find widgets by class, objectName, or text content
  • Read Python logs captured from the app
  • Run Python inside the app process for advanced inspection
  • Launch and stop the app from the agent

Zero changes to your app's source code required.

Requirements

  • Python 3.11+
  • PySide6 6.6+
  • uv (recommended)
  • Windows (tested), Linux/macOS (should work)

Installation

The MCP server (stdio) and the in-app bridge are separate:

ComponentWhere it runsNeeds PySide6?
MCP server (pyside6-mcp)MCP client's processNo
Bridge (python -m pyside6_mcp …)Inside your PySide6 appYes

No changes to the target project. launch_app(cwd=…) injects only the bridge modules via an isolated PYTHONPATH — nothing is added to pyproject.toml, and the MCP server's dependencies (fastmcp, httpx, …) never enter the app environment.

Requires uv on PATH. MCP Registry name: io.github.com55/pyside6-mcp.

Unlike qt-mcp, you do not add this package to the target app or set a probe env var. launch_app injects the bridge.

Claude Code

Plugin (MCP + skill). install only searches marketplaces you have added — there is no github: install shorthand:

bash
claude plugin marketplace add com55/pyside6-mcpclaude plugin install pyside6-mcp@pyside6-mcp

MCP server only:

bash
claude mcp add -s user pyside6 -- uvx pyside6-mcp

Cursor

Install the Agent Plugin from this repository (or from the Cursor Marketplace once listed). Manual stdio config:

json
{  "mcpServers": {    "pyside6": {      "command": "uvx",      "args": ["pyside6-mcp"]    }  }}

After saving, reload MCP servers in Cursor Settings → MCP. See examples/cursor-mcp-config.json.

Any stdio MCP client

json
{  "mcpServers": {    "pyside6": {      "command": "uvx",      "args": ["pyside6-mcp"]    }  }}

Place it wherever that client expects MCP config (user-level or project-level). See examples/mcp-config.json.

VS Code / GitHub Copilot / other clients

Same stdio block as Any stdio MCP client.

Note: uvx downloads and runs the MCP server in an isolated env — PySide6 is not required there. PySide6 is only needed in the target app's venv (already a project dependency).

To run from a git checkout instead of PyPI: uvx --from git+https://github.com/com55/pyside6-mcp pyside6-mcp

Usage

From MCP (recommended — zero project setup)

launch_app(cwd="/path/to/project")                              # main.py at rootlaunch_app(cwd="/path/to/project", script="app.py")             # other name at rootlaunch_app(cwd="/path/to/project", script="backend/gui.py")   # entry in subfolderget_launch_help()                                               # full script decision guidelist_apps()                                                     # pids of apps this server launched

cwd is the project root (pyproject.toml). script is the entry .py relative to cwd.

launch_app returns {pid} (the Qt app process, not the uv wrapper). Other tools omit pid to target the last launched app; pass pid= when several are running. Do not pass port=.

Manual launch (when you start the app yourself)

Prefer launch_app above. Use these only when the app is already running, or you want to start it outside the MCP server.

Without editing app source — run the entry script through the bridge launcher (pulls pyside6-mcp into a temporary env; does not add it to the project):

bash
cd your-pyside6-projectuv run --with pyside6-mcp python -m pyside6_mcp main.py# other entry: … python -m pyside6_mcp app.py# in a subfolder: … python -m pyside6_mcp backend/gui.py

Bridge listens on http://127.0.0.1:7890 by default. Override with PYSIDE6_MCP_PORT. Then from the agent call wait_until_ready() (and pass pid= only if you use several apps).

launch_app is different: it picks an ephemeral port and injects only the bridge modules via an isolated PYTHONPATH — you never set the port yourself.

Embed in the app (always-on; requires adding the package to that project):

bash
uv add pyside6-mcp
python
# In your app's main(), after QApplication is created and before app.exec()from pyside6_mcp import install_bridgeinstall_bridge()  # same default port 7890 / PYSIDE6_MCP_PORT

From your AI assistant

Once the app is running with the bridge active, ask your assistant:

"Screenshot the app and click the Apply button" "Why is the checkbox disabled? Inspect its state." "Fill in the form and submit it" "Show me the last 20 log lines from the app"

Your assistant uses the launch_app, screenshot, get_widget_tree, find_widget, click, type_text, get_logs, and other tools automatically.

launch_app returns only when the UI is ready (a visible top-level window that has been quiet for at least 500 ms), not merely when the bridge HTTP server is up. Default timeout is 45 seconds.

Tools

ToolDescription
launch_app(cwd, script?, app_args?, timeout)Launch app (no target-project install) and wait for UI readiness. Returns {pid}
list_apps()Pids of apps launched by this server
get_launch_help()How to set cwd, script, app_args before launch
wait_until_ready(timeout, quiet_ms, pid?)Wait for UI readiness on an already-running app
wait_for_idle(timeout, quiet_ms, pid?)Wait until UI has been quiet after an action
get_app_status(pid?)Process + bridge health; detects likely modal blocks
stop_app(pid?)Stop a launched app
screenshot(widget_id?, pid?)Capture window or specific widget (modal/active-window aware)
get_widget_tree(pid?)Full widget hierarchy with IDs
get_widget_info(widget_id, pid?)Detailed properties of one widget
get_app_state(pid?)Active window, focus, screen info
find_widget(class_name?, object_name?, text?, visible?, pid?)Search widgets
click(widget_id?, x?, y?, button?, pid?)Mouse click
double_click(widget_id, x?, y?, pid?)Double click
type_text(text, widget_id?, pid?)Keyboard input
press_key(key, pid?)Named key: enter, escape, tab, up/down, f5, …
scroll(dy, widget_id?, dx?, pid?)Scroll wheel
list_actions(pid?)List QAction menu/toolbar items
trigger_action(name?, text?, pid?)Trigger a QAction without clicking menus
get_logs(n?, pid?)Recent Python log records
get_app_output(n?, pid?)Raw stdout/stderr from launched app
eval_python(code, pid?)Execute Python inside the app process

Agent Skill

A companion skill ships at skills/pyside6-mcp/SKILL.md and is installed automatically with the plugin. It tells the agent when and how to use these tools — no need to explain the workflow every time.

Architecture

pyside6_mcp/├── bridge.py      # In-process HTTP server (runs inside the target app)├── launch.py      # Isolated PYTHONPATH inject + launch_app argv/validation├── session.py     # Handshake + in-memory pid → port sessions├── server.py      # FastMCP stdio server (the MCP client talks to this)├── __init__.py    # Exports install_bridge()└── __main__.py    # Launcher: python -m pyside6_mcp <script>

Thread safety: all Qt operations are marshaled to the main thread via QApplication.postEvent with a custom event type — the same mechanism Qt uses internally for cross-thread signals.

Examples

License

MIT

来源:README.md,提交 6d3a4f2

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分