Claude Code Setup
Claude Code is the fastest public path when you want a terminal-first agent workflow with prompts and resources surfaced directly in the client.
1. Install Claude Code
Follow the official Claude Code installation instructions at https://docs.claude.com/en/docs/claude-code/overview.
If you choose to use Anthropic's PowerShell installer, download the script and review it before executing so you can audit what is being run:
$installer = Join-Path $env:TEMP 'claude-install.ps1'
Invoke-WebRequest -Uri 'https://claude.ai/install.ps1' -OutFile $installer -UseBasicParsing
Get-Content $installer | Select-Object -First 60 # review before running
& $installer
Security note: The
irm <url> | iexone-liner is convenient but executes remote code without review; prefer the download-and-audit flow above, especially on untrusted networks.
2. Install WPF DevTools
Published-release command after GitHub Release assets exist:
irm https://installer.wpf-mcptools.evanlau1798.com | iex
The HTTPS alias resolves scripts/online-installer.ps1; promote it only after the selected version has GitHub Release assets and sidecars: release_<version>_win-<arch>.zip, SHA256SUMS.txt, release-assets.json, release-sbom.spdx.json, and release-evidence.json.
Preferred local package path:
- Review
scripts/online-installer.ps1as the canonical source entrypoint. - Run the reviewed installer against a verified local package archive.
Example:
powershell -ExecutionPolicy Bypass -File .\scripts\online-installer.ps1 -PackageArchivePath .\release\release_<version>_win-<arch>.zip -TrustedReleaseMetadataDirectory .\release -Client claude-code -NonInteractive -Force -OutputJson
Package-local fallback:
- Use a locally generated package, or after GitHub Release assets exist, download the matching
release_<version>_win-<arch>.zipfrom Releases together withSHA256SUMS.txt,release-assets.json,release-sbom.spdx.json, andrelease-evidence.json. - Verify the archive with
SHA256SUMS.txt,release-assets.json, andrelease-sbom.spdx.jsonbefore extraction. - Extract the package.
- Run
run.bat.
Before trusting the extracted package, keep the verified release sidecars beside the archive: SHA256SUMS.txt for the checksum, release-assets.json for the canonical release metadata, and release-sbom.spdx.json for the release asset SBOM. The SBOM sidecar is an asset-level release archive inventory, not a full package/dependency SBOM. Production payload signature verification still requires an independent WPFDEVTOOLS_RELEASE_SIGNER_THUMBPRINT; adjacent sidecars prove archive provenance but do not replace signer trust. WPFDEVTOOLS_RELEASE_SIGNER_SUBJECT is only an additional constraint after the thumbprint is pinned.
run.bat requests elevation when the current shell is not already elevated and then launches the packaged bin/install.ps1. Set WPFDEVTOOLS_SKIP_ELEVATION=1 when you need to keep the install in the current unelevated shell.
For claude-code and codex, elevated CLI registration intentionally blocks PATH-based CLI discovery and environment-provided command paths. Prefer WPFDEVTOOLS_SKIP_ELEVATION=1 for the registration step, or register manually after install.
If the installer cannot reuse a previous live install root and you do not pass -InstallRoot, the fallback executable path is:
%APPDATA%\WpfDevToolsMcp\<arch>\current\bin\wpf-devtools-<arch>.exe
3. Register the MCP server
Use the generated registration command from client-registration\claude-code.txt, or run the same command shape with the actual absolute executable path produced by your install:
claude mcp add --transport stdio wpf-devtools -- "C:\Users\<you>\AppData\Roaming\WpfDevToolsMcp\<arch>\current\bin\wpf-devtools-<arch>.exe"
Project-scoped alternative:
claude mcp add --scope project --transport stdio wpf-devtools -- "C:\Users\<you>\AppData\Roaming\WpfDevToolsMcp\<arch>\current\bin\wpf-devtools-<arch>.exe"
The installer also writes client-registration\claude-code.txt. Treat that file as the reviewed command source because it already reflects the real install root and architecture, and add --scope project manually when you want project-scoped setup across contributors or CI worktrees.
4. Verify the registration
claude mcp list
Before using this prompt, confirm WPFDEVTOOLS_MCP_ALLOWED_TARGETS contains the running WPF app's exact local absolute executable path; unset or malformed values fail closed before connect attaches.
5. First useful prompt
After WPFDEVTOOLS_MCP_ALLOWED_TARGETS includes the running WPF app's exact local absolute executable path, connect to it, auto-discover the target if there is only one visible candidate, then summarize the root UI state with get_ui_summary(depthMode: "semantic").
6. Discovery entry points inside Claude Code
- Prompts may appear as slash commands such as
/mcp__wpf-devtools__connect_and_list_windows, but the portable contract is the prompt name itself. - Resources may appear as
@wpf-devtools:capabilitiesand@wpf-devtools:limitations/elevated-targets, but the portable contract is the resource URI. - Use those discovery entry points when Claude Code knows the server exists but needs help selecting the right workflow.
Notes
- Keep the server on Windows.
- Do not wrap
wpf-devtools-x64.exewith extra stdout logging. - Start with
connect()in the common case afterWPFDEVTOOLS_MCP_ALLOWED_TARGETSincludes the reviewed target's exact local absolute executable path. Useget_processes(windowFilter)only when auto-discovery reports multiple candidates or when you need explicit target metadata first. - Prefer
get_ui_summaryorget_form_summarybefore tree-heavy inspection; useget_element_snapshot(elementId)only after a concrete elementId is known. - After each diagnostic, interaction, or mutation, follow
navigation.recommendedfirst and treatnextStepsas the compatibility field. - If you already know the next tool and want a leaner payload, capable clients may pass
navigation=falseonget_binding_errors. Schema-driven clients can rely on that opt-out there because the parameter is advertised in theget_binding_errorstool schema today, but should not assume other tools expose it yet. - If
connectfails, check server bitness, bootstrapper bitness, and target bitness together. - If the target app is elevated, start Claude Code as administrator so the STDIO-launched MCP server can attach at the same integrity level.