Skip to content

Windows MCP and CLI

github-actions[bot] edited this page Oct 18, 2026 · 2 revisions

How the command line tool and the MCP screenshot work on Windows. The rest of Windows support is on Windows Support, and the MCP server itself on How MCP and CLI Work.

The command line tool

A Windows GUI program has no console: nibtree cli would print nothing, and cmd and PowerShell would not wait for it or see its exit code. So the tool is its own crate, src-tauri/cli (nibtree-cli), in a Cargo workspace with the app. The app uses it as a library (mcp::cli), so nothing changes on macOS. Its src/main.rs builds nibtree-cli.exe, a console program: nibtree-cli cli <command> runs the tool, and anything else (a folder, nothing) starts the app next to it, which hands a folder to the copy already running.

The crate holds what the tool and the app share: the config folder (home), the mcp.json format (server_file), the client header and the protocol version (a test in the app checks it). It has no build script, which matters: tauri-build copies a bundled program while the app compiles, so the program must exist before that.

build-windows in release.yml therefore builds nibtree-cli first, copies it to src-tauri/binaries/nibtree-cli-x86_64-pc-windows-msvc.exe and passes --config src-tauri/tauri.windows-release.conf.json, which lists it in bundle.externalBin. The installer puts it next to the app. Install command line tool then writes nibtree.cmd into %LOCALAPPDATA%\Microsoft\WindowsApps, which Windows puts on every user's PATH, and the .cmd runs the console program with all its arguments. It never touches a file that is not ours (SHIM_MARK). Settings names that folder from McpStatus.cliFolder, and its examples call nibtree-cli.exe (cliCommand) with PowerShell's &.

The MCP screenshot

take_screenshot and nibtree cli screenshot use screencapture -l on macOS. On Windows, mcp/host.rs draws the window with PrintWindow and PW_RENDERFULLCONTENT, which includes the WebView2 content and works while other windows cover the app, then crops it to the frame DWM reports, without the invisible resize borders. png_encode.rs writes the PNG with flate2, so no image crate is added. A minimized window cannot be drawn and gets a clear error.

Shells that mangle quotes

Windows PowerShell 5.1 splits an argument that holds both spaces and double quotes, so --args '{"message": "two words"}' reaches the tool broken. name=value arguments are safe, and --args-file <file> (or --args-file - for stdin) reads the JSON object without passing it through the command line at all: '{"limit": 5}' | nibtree cli call git_log --args-file -.

Home

Using Nibtree

Developers

How features work

Clone this wiki locally