Skip to content
FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    Inspect applications with MCP

    Use the MCP integration to let an agent inspect a FerroUI application’s controls, properties, and screenshots. This is separate from reading this documentation: documentation is already available as Markdown and agent indexes, without running an application server.

    Build the optional integration from the matching checkout:

    Terminal window
    cargo build -p control-catalog-desktop --features mcp

    Configure your MCP client’s stdio server with an absolute executable path. For example, in a JSON client configuration that uses mcpServers:

    {
    "mcpServers": {
    "ferroui": {
    "command": "/absolute/path/to/FerroUI/target/debug/control-catalog-desktop",
    "args": ["--mcp-stdio", "--mcp-headless"]
    }
    }
    }

    Replace the path with your checkout’s build output. Headless mode supports inspection and screenshots without showing a desktop window. Omit it to inspect a visible window. The exact configuration file location depends on your client.

    Start with: “Find SearchBox, report its current text and bounds, and capture a screenshot.” The client obtains the current tool schemas from the server; it should use those schemas for arguments and returned node identities.

    To enable interaction, add --mcp-allow-input to the server’s arguments. To enable property changes, add --mcp-allow-writes. Those capabilities are disabled by default. A useful follow-up task is to type a query, inspect the updated results, and report any visible error.

    Terminal window
    cargo run -p control-catalog-desktop --features mcp -- --mcp-http=8765

    Use the startup URL http://127.0.0.1:8765/mcp and the fresh bearer token printed to stderr in your client’s HTTP configuration. The token changes on restart. Port 0 selects a free port. Keep tokens out of committed configuration.

    Embed the endpoint in your own application

    Section titled “Embed the endpoint in your own application”

    Make ferroui-mcp an optional dependency. After application setup, on the UI thread, retain the returned handle while the lifetime runs:

    let mcp = ferroui_mcp::serve(ferroui_mcp::Options {
    permissions: ferroui_mcp::Permissions {
    allow_property_writes: false,
    allow_input: false,
    },
    ..Default::default()
    })?;
    // Keep `mcp` alive until the application shuts down.

    The fragment belongs in a fallible startup function. Linking the crate does not start a server. For stdio, reserve stdout before platform startup with reserve_stdout() and pass that writer in the options so application logs cannot corrupt the protocol stream.

    A destroyed control’s old identity is no longer valid: query the tree again. A denied write or input requires its corresponding explicit permission. An unresponsive dispatcher can prevent inspection from completing; fix blocking UI work before increasing timeouts.