Skip to main content

QInspector MCP Server

stdio MCP bridge for Qt apps that embed QInspector. This process listens on TCP; apps connect out as clients (default 127.0.0.1:9876). Up to 8 apps can be connected at once.

Agent  --stdio MCP-->  qinspector-mcp  --TCP-->  Qt app(s) with QInspector

Your Qt app must call QInspector::Connect() and Attach(...). See the main QInspector repository for the C++ library and demos.

Install

Requires uv (recommended) or Python ≥ 3.10.

uvx qinspector-mcp

Other options:

# from Git
uvx --from "git+https://github.com/DebiruC/QInspector.git#subdirectory=mcp" qinspector-mcp

# from a local clone
uvx --from /path/to/QInspector/mcp qinspector-mcp

# pip
pip install qinspector-mcp
qinspector-mcp

Only one process may bind the configured port (default 9876).

MCP host config

Add to Claude Code, Cursor, or any host that supports MCP stdio servers:

{
  "mcpServers": {
    "qinspector": {
      "command": "uvx",
      "args": ["qinspector-mcp"],
      "env": {
        "QINSPECTOR_HOST": "127.0.0.1",
        "QINSPECTOR_PORT": "9876",
        "QINSPECTOR_RPC_TIMEOUT": "10"
      }
    }
  }
}

From Git instead of PyPI:

{
  "mcpServers": {
    "qinspector": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/DebiruC/QInspector.git#subdirectory=mcp",
        "qinspector-mcp"
      ],
      "env": {
        "QINSPECTOR_HOST": "127.0.0.1",
        "QINSPECTOR_PORT": "9876"
      }
    }
  }
}

From a local checkout, point --from at your mcp directory (forward slashes work on Windows):

{
  "mcpServers": {
    "qinspector": {
      "command": "uvx",
      "args": ["--from", "/path/to/QInspector/mcp", "qinspector-mcp"],
      "env": {
        "QINSPECTOR_HOST": "127.0.0.1",
        "QINSPECTOR_PORT": "9876"
      }
    }
  }
}

No cwd or PYTHONPATH is required when using uvx.

Usage

  1. Start the MCP server (host config or uvx qinspector-mcp).
  2. Start your Qt app so it connects and sends session.hello.
  3. Call list_sessions, then tools with the session name (for example main-window or qtquick-main in the demos).

App identity

Each app sends app.hello with appId (default QCoreApplication::applicationName()) and pid. The bridge keys apps by appId; duplicates become editor#2, etc. Apps that never send app.hello get app-N.

Pass the optional tool argument app only when the same session name exists on more than one connected app (the error message lists candidates).

Tools

Tool Purpose
list_sessions Connected apps and their sessions
ping Health check on a session
ui_tree UI tree under the Attach root (compact; qt_* chrome hidden by default)
ui_properties Read properties of the root or a named descendant
ui_set Write one property (requires SetInputInjectionEnabled(true) in the app)
ui_find Search the full tree by class / objectName / text
ui_screenshot Screenshot at original size (MCP image, or save_path to disk)
ui_click / ui_drag / ui_wheel / ui_type Synthetic input (requires injection enabled)
app_logs Captured qDebug / QML logs (requires SetLogCaptureEnabled(true))
wait_for Poll a property until it matches (MCP-side; no extra RPC)
raw_call Raw JSON-RPC (only if QINSPECTOR_MCP_ALLOW_RAW=1)

Environment

Variable Default Meaning
QINSPECTOR_HOST 127.0.0.1 Listen address
QINSPECTOR_PORT 9876 Listen port
QINSPECTOR_RPC_TIMEOUT 10 Seconds to wait for an app response
QINSPECTOR_MCP_ALLOW_RAW off Enable raw_call

License

MIT

Metadata

Release files for qinspector-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qinspector-mcp 0.1.2
File Size Uploaded
qinspector_mcp-0.1.2.tar.gz 70.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qinspector-mcp 0.1.2
File Interpreter ABI Platform
qinspector_mcp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 85.6 kB

Release files / qinspector_mcp-0.1.2.tar.gz

Download URL qinspector_mcp-0.1.2.tar.gz
Size 70.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c3b3da37c5490fb9757287cfc7d5f0f453f2de7bf54a144cbfb24f8a08b9f353
BLAKE2b-256 checksum
How to use checksums
1e5d3d442f8eb082b331ba6a6c0e7b42f19e4b363ddd34c607443e820978ff49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / qinspector_mcp-0.1.2-py3-none-any.whl

Download URL qinspector_mcp-0.1.2-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
357193de5d9ee1809bd7602eeeb8842d59087f0b632ef22318e55bfa6e199f62
BLAKE2b-256 checksum
How to use checksums
90bfe5845d93a20ad6f7f5a070d2a821e3e729ca8eaa7b18f74e1806ada7ab4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page