fxray
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@fxray list canvas apps in the default environment"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
fxray
An X-ray for Power Fx: an MCP server that wraps the Power Platform CLI (pac) so Claude, GitHub Copilot (VS Code
agent mode) or any MCP client can inspect and work with Power Apps solutions, canvas app source and Dataverse:
list and export solutions, read canvas apps as text (screens, controls, Power Fx formulas, data sources), read
table / column / relationship metadata, run read-only FetchXML, diff two solution versions, run the solution
checker, and (gated, dry-run by default) pack, import and publish.
Area | Tools |
Setup & environments |
|
Solutions (live) |
|
Solutions (offline) |
|
Canvas app source (offline) |
|
Dataverse metadata |
|
Data, read-only |
|
Writes, dry-run by default |
|
Safety model
Environment allowlist. Live tools only reach environments listed in
allowed_environments. Every call passes--environmentexplicitly, so pac's currently selected org is never used implicitly, andwhoamiand every write re-check that the org pac actually connected to is allowlisted. An empty allowlist (or no config file) disables every live tool; offline tools still work.Read-only by default.
pack_solution,import_solutionandpublish_customizationsdefault todry_run=trueand return a plan plus the exact pac command. Executing needsallow_writes = truein the config anddry_run=falseon the call. Have the assistant show you the plan first.Imports default to
mode="update"(never deletes).upgrade(managed only) is explicit and flagged as deleting components missing from the zip. Blockers (managed/unmanaged mismatch, managed downgrade, emptyDatabaseReferences) stop execution. Before importing over an unmanaged solution the current one is exported toout/backups/<env>/and the result carries an undo recipe; managed targets cannot be exported, which the plan says.Local output (exports, unpacks, packs, checker results) goes under
output_dir;protected_pathsare never written to.FetchXML is read-only by nature; it is parsed and validated (well-formed, no DOCTYPE, one entity) before it reaches pac.
No secrets in the config: pac keeps its own auth profiles. pac's signed checker-results URL is not returned.
Related MCP server: MCP X++ Server
Install
pip install fxray # or run it without installing: uvx fxrayNeeds Python 3.11+ and the Power Platform CLI:
dotnet tool install --global Microsoft.PowerApps.CLI.Tool # needs the .NET SDK
pac auth create --environment https://yourorg.crm.dynamics.com/ # a person, in a terminal (browser sign-in)fxray finds pac on PATH, then at ~\.dotnet\tools\pac.exe (the dotnet global-tool folder); the Windows MSI
install's pac.cmd shim is resolved to the pac.exe it wraps. MCP clients often start servers with a shorter
PATH than your terminal, so if pac works in a terminal but not in fxray, set pac_path to the full path.
Tested on Windows with pac 2.9.3. pac is a .NET tool and runs on macOS/Linux too; fxray should, but that is untested.
Interactive sign-in is impossible from an MCP server: when pac's token expires the tools say so and stop, and a
person runs pac auth create (or pac auth select) again in a terminal.
Configure
Copy fxray.example.toml to fxray.toml
and list the environments fxray may reach. Lookup order (first file found wins):
$FXRAY_CONFIG(an explicit path; an error if it does not exist)$FXRAY_WORKSPACE\fxray.toml.\fxray.toml(the folder the MCP client starts the server in)%LOCALAPPDATA%\fxray\fxray.toml(Windows;~/.config/fxray/fxray.tomlelsewhere; override the folder with$FXRAY_HOME)
The per-user file is the simplest choice: then FXRAY_CONFIG is not needed at all. The file is re-read on every
call (no restart needed).
Setting | Default | Meaning |
| auto | full path to pac; unset = |
|
| URLs or environment ids. The only environments any tool reaches. Empty = live tools refuse |
| first allowlisted | used when a tool gets no |
|
| write tools only plan unless this is true and the call passes |
|
| exports, unpacked folders, packs, checker output, import backups |
|
| folders no tool may write into (e.g. a schema-as-code repo whose files are generated) |
| 200 |
|
| 120 / 1800 | pac timeouts (quick calls / export, import, check) |
allowed_environments = ["https://contoso-dev.crm.dynamics.com/"]
allow_writes = false
output_dir = "out"Register
Claude Code:
claude mcp add --scope user fxray -- uvx fxray
# or, with the config somewhere other than the per-user folder:
claude mcp add --scope user fxray -e FXRAY_CONFIG=C:\path\to\fxray.toml -- uvx fxrayVS Code / Copilot. Add the server to the user-level %APPDATA%\Code\User\mcp.json so it works from every
window (a workspace .vscode/mcp.json only loads once you trust that workspace's MCP servers):
{
"servers": {
"fxray": {
"type": "stdio",
"command": "uvx",
"args": ["fxray"],
"env": { "FXRAY_CONFIG": "C:\\path\\to\\fxray.toml" }
}
}
}Drop the env block if the config is in the per-user folder. Then ask the assistant to run pac_status: it shows
which config file was used, which pac was found and its version, and pac's auth profiles (each flagged as
allowlisted or not).
Tools
source = a solution .zip, an unpacked solution folder (pac solution unpack / export_solution), a canvas
.msapp, or a pac canvas unpack --layout SourceCode folder (Src/*.pa.yaml + .msapr). Offline tools need no pac.
Tool | Kind | What it does |
| read | config, pac version, auth profiles (flags whether each profile's env is allowlisted) |
| live read |
|
| live read | environments the account sees, marked allowed / not allowed |
| live read | name, version, managed, publisher (managed system solutions hidden by default) |
| live / offline | live: every component row with resolved names (tables, apps, flows, env vars, connection refs); offline: manifest, publisher prefix, root components, missing dependencies |
| live / offline |
|
| local output | export (read-side on the env) to a timestamped folder under |
| local output |
|
| local output |
|
| offline | two versions: manifest, tables/columns/choices, relationships, canvas screens/controls/formula diffs/data sources, flows/env vars, changed files |
| offline | screens (Studio order), control counts and types, data sources, app checker counts |
| offline | control tree, filter by screen / control type |
| offline | one control's type, parent, children and Power Fx formulas |
| offline | substring or regex over every formula; |
| offline | each data source + the formulas using it; unreferenced ones, meta.xml |
| offline | Studio's saved App Checker results (SARIF inside the msapp) |
| offline / live | tables in a solution or a canvas app's cached schema; live = names only |
| offline | columns (type, required, length, lookup targets, choice values), primary id/name, relationships |
| offline | 1:N (with lookup column, cascade delete) and N:N |
| live read | read-only FetchXML with a row cap |
| write (local) |
|
| write | plan: verified target org, installed vs package version/managed, install/update/upgrade, blockers, warnings, backup, exact command |
| write |
|
Typical flow: list_solutions → export_solution (zip + unpacked folder) → read offline with source= that
folder: solution_components, describe_table, canvas_overview, search_formulas, canvas_data_sources →
change the source → pack_solution → import_solution (dry run, then for real) → publish_customizations.
Traps it checks for
Canvas apps kept as source (a generator or hand-maintained .pa.yaml, packed with pac solution pack and
imported) fail in ways Studio does not show:
Studio prunes unreferenced data sources on the next save/publish:
canvas_data_sourcesflags data sources no formula uses (a Power Fx lexer skips strings and comments, so"Saved to Orders"is not a reference).Empty
DatabaseReferencesin meta.xml breaks every write after import (reads work,Patchfails): critical incanvas_data_sources, a blocker inimport_solution.The msapp caches table schemas. New columns are invisible to the published player until the cache is refreshed; Studio validates against live metadata so it looks fine. On a solution source,
canvas_data_sourceslists solution columns missing from the app's cachedTableDefinitionand the formulas that use them. It also lists tables used in formulas that have no cache entry.Dataverse keeps the newer canvas app on import (AppVersion):
import_solutionwarns when the environment copy was modified on or after the package's AppVersion day, because the import would silently keep it.Import as update, not upgrade: upgrade deletes components missing from the zip.
.pa.yamlformulas containing": "must be|-block scalars: a YAML parse error names this cause.Generated
.pa.yamlin a schema-as-code repo should never be hand-edited (change the generator): fxray has no tool that writes canvas source, andprotected_pathskeeps its output out of such a folder.
pac quirks handled (2.9.3)
--jsonworks only forenv who,env list,solution list;auth listandcanvas listprint tables with multi-word headers (Created by,Environment Url), parsed by known column names.env fetch --xml "<fetch ...>"crashes pac (XmlException) when the query has quotes: queries go through--xmlFile.env fetchrejectstop, ignorescount/page/orderand pages through every record: fxray stops reading at the row cap (kills pac) and sorts client-side when the result is complete.env fetchpads each column to its widest value, so header names and values can run together (ismanagedsolutionid); the header is split using the attribute names from the query.env fetchomits null attributes and shifts the rest of the row left. Every row is verified (the last column must be the primary key GUID); if any row is shifted the query is re-run one attribute at a time and joined on the key.Values are pac's formatted strings (choice labels, lookup names, local dates,
10,840).The
solutioncomponenttype label is blank for newer component types (connection references); they are resolved by id.Setting the environment variable
PP_TOOLS_AUTOMATION_AGENTmakes pac crash at startup (DI error); fxray passes the environment through untouched, so do not set it.stdin is closed, so a pac waiting for an interactive sign-in times out with an explanation instead of hanging.
Known limits
No live column metadata: pac has no metadata command and the
attributetable is too thin through FetchXML.describe_tablereads a solution export or a canvas app's cached schema;list_tableswithout a source gives live table names only.fetch_queryreturns formatted strings, not typed values; link-entity columns cannot use the null fallback.The AppVersion check compares days (pac reports the environment app's modified date only).
Canvas source must be the current
.pa.yamlformat (the retired.fx.yamllayout is refused with instructions).solution_checkuploads the zip to Microsoft's checker service and takes about a minute.
Layout
src/fxray/ — pure fx (Power Fx lexer) / fetchxml / pacparse (pac output parsers) / metadata / canvas /
solution / diff → pac (subprocess runner behind a small interface, faked in tests) → live + writes
(plans, gates, backups) → server.py (the tools).
Development
git clone https://github.com/S-CurveLabs/fxray; cd fxray
python -m venv .venv
.venv\Scripts\pip install -e .[dev]
.venv\Scripts\pytestEverything runs against synthetic solutions and a scripted fake pac. To exercise the real pac read path, sign pac
in, point FXRAY_CONFIG at a config that allowlists a development environment, and run
set FXRAY_LIVE=1 then pytest -m live (reads only).
License
MIT
Available Tools
23 toolsapp_checker_resultsCRead-only
The App Checker results Power Apps Studio saved inside the app (AppCheckerResult.sarif): counts by level and issues grouped by rule with locations (screen.control.property). level= filters (Critical/High/Medium/Low).
Inputs: source (required), app, level, limit.
canvas_data_sourcesARead-only
The app's data sources (Dataverse tables, connectors, static data) with the formulas that reference each one. Flags UNREFERENCED data sources, which Power Apps Studio silently drops on the next save/publish. On a solution source it also checks meta.xml DatabaseReferences (empty = every write breaks after import) and reports columns the solution defines but the app's cached table schema lacks (invisible to the published player).
Inputs: source (required), app.
canvas_overviewARead-only
Summary of a canvas app's source: screens (in Studio order) with control counts, components, control types, data sources and app checker counts. source = .msapp, SourceCode folder (Src/*.pa.yaml), or a solution zip / unpacked folder (then app= logical or display name when it holds several apps).
Inputs: source (required), app.
describe_tableARead-only
Columns of one table: logical name, type, display name, required level, max length, lookup targets, choice
values; plus primary id/name columns and relationships. table = logical, display or entity-set name.
System columns (createdby, versionnumber, ...) are hidden unless include_system_columns=true. full=true adds
descriptions, formats and numeric ranges. source: solution zip/folder, or a canvas app (its cached schema).
Inputs: table (required), source (required), app, full, +1 more.
diff_solutionsARead-only
What changed between two versions of a solution (each a zip or unpacked folder, e.g. two export_solution outputs): version/publisher/root components, tables and columns (type, required level, length, choices), relationships, canvas apps (screens, controls, formula changes as small diffs, data sources), flows/env vars/ connection references, and changed files for anything else (views, forms).
Inputs: new (required), old (required), max_formula_changes.
export_solutionA
Export a solution from an allowlisted environment (read-side: nothing changes in the environment) into a new timestamped folder under the output dir, and by default unpack it there (pac solution unpack) so its tables, relationships and canvas apps can be read offline. managed=true exports the managed package (only possible from the environment where the solution is unmanaged). Takes ~1 minute. Returns the zip and folder paths.
Inputs: solution (required), unpack, managed, environment.
fetch_queryARead-only
Run a read-only FetchXML query against an allowlisted environment (pac env fetch) and return rows as dicts. FetchXML cannot modify data. Rows are capped at max_rows (default from config, ceiling 5000): pac itself ignores top/count/page and would page through every record, so the server stops reading at the cap. pac also ignores ; the server sorts client-side when the result is complete. Values are pac's formatted strings. Prefer filters and explicit lists; the primary key column is always appended.
Inputs: fetchxml (required), max_rows, environment.
get_controlBRead-only
One control (or screen, or 'App') with its type, variant, parent, children and property formulas (Power Fx). properties= limits to named properties (e.g. ['OnSelect', 'Items']).
Inputs: source (required), control (required), app, properties.
import_solutionADestructive
Import a solution zip into an ALLOWLISTED environment. dry_run=true (default) returns the plan: target org (verified with pac env who), package name/version/managed, what is installed now, whether this is a new install, an update or an upgrade, blockers and warnings (managed/unmanaged mismatch, downgrade, canvas AppVersion trap, empty DatabaseReferences), backup and the exact pac command. mode: 'update' (default; never deletes), 'upgrade' (managed only; DELETES components missing from the zip), 'holding'. Executing (dry_run=false, allow_writes=true) first exports the installed unmanaged solution as a backup and returns an undo recipe.
Inputs: zip_path (required), mode, dry_run, environment, +3 more.
list_canvas_appsARead-only
Canvas apps: live in an environment (pac canvas list: name, created by, modified on), or offline in a
solution zip / unpacked folder (logical name, display name, AppVersion stamp).
Inputs: source, environment.
list_controlsARead-only
The control tree (name, type, variant, parent, depth, number of properties), optionally for one screen and/or one control type (substring, e.g. 'Gallery', 'Button'). Use get_control for formulas.
Inputs: source (required), app, limit, screen, +1 more.
list_environmentsARead-only
All Dataverse environments the signed-in account can see (global discovery), each marked allowed / not allowed. Only allowed ones can be used by the other tools.
Inputs: no named parameters.
list_relationshipsARead-only
Table relationships from a solution (or a canvas app's cached schema): one-to-many (referenced/one side, referencing/many side and its lookup column, cascade delete) and many-to-many (intersect table). table= limits to relationships touching that table.
Inputs: source (required), app, table.
list_solutionsARead-only
Solutions in an allowlisted environment: unique name, display name, version, managed flag, publisher. Managed (mostly Microsoft system) solutions are hidden unless include_managed=true. name_filter is a case-insensitive substring on unique or display name.
Inputs: environment, name_filter, include_managed.
list_tablesARead-only
Dataverse tables. With source= (solution zip/folder, or canvas .msapp/SourceCode folder for the tables the app caches): name, display name, entity set, column counts. Without source: live table NAMES from the environment (the entity catalog via FetchXML; pac has no live column metadata, so describe_table needs a source). pattern = substring on logical or display name.
Inputs: app, limit, source, pattern, +2 more.
pack_solutionAIdempotent
Pack an unpacked solution folder into a solution zip (pac solution pack). Local only: nothing is sent to an environment. dry_run=true (default) returns the plan and command plus warnings (canvas data sources Studio would prune, empty DatabaseReferences). Default zip goes under /packs/. Executing needs allow_writes=true.
Inputs: folder (required), dry_run, zip_path, overwrite, +1 more.
pac_statusARead-only
Check the setup: config (allowlisted environments, writes enabled, output folder), the pac CLI version, and pac's auth profiles. Run this first when anything fails. Does not contact an environment.
Inputs: no named parameters.
publish_customizationsAIdempotent
Publish all customizations in an allowlisted environment (pac solution publish). dry_run=true (default) returns the verified target and command. Executing needs allow_writes=true and dry_run=false.
Inputs: dry_run, environment.
search_formulasARead-only
Search every Power Fx formula in a canvas app for a substring (or regex=true). code_only=true ignores matches inside string literals and comments. property= restricts to one property name (e.g. 'OnSelect'); control= to controls whose name contains it. Returns control, property, and the matching lines.
Inputs: source (required), pattern (required), app, limit, +5 more.
solution_checkA
Run the Power Apps solution checker on a solution zip (pac solution check): uploads the zip to Microsoft's checker service (a cloud call, nothing changes in the environment), waits, and summarizes the SARIF results by rule and severity. Takes several minutes. Output is kept under /checks/.
Inputs: zip_path (required), geo, environment.
solution_componentsARead-only
What a solution contains. Offline (source= a solution zip or unpacked folder): manifest (name, version, managed, publisher/prefix), root components by name, canvas apps, flows, connection references, environment variables, missing dependencies. Live (solution= unique name): every component row from the environment with type and, for tables, canvas apps, flows, environment variables and connection references, the resolved name (others show the object id).
Inputs: source, solution, environment.
unpack_solutionA
Unpack a solution zip (pac solution unpack, local only) into a new folder under the output dir (or /unpacked/<folder_name>). Returns the folder, which works as source= for the offline tools.
Inputs: zip_path (required), folder_name.
whoamiARead-only
Who pac is signed in as and which org it reaches for an allowlisted environment (pac env who).
Fails with instructions if the sign-in expired. environment = URL or id from the allowlist (default: first).
Inputs: environment.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Each tool targets a distinct resource and action granularity: environment status, solution lifecycle, canvas app analysis, and Dataverse metadata are cleanly separated. Even similarly named tools like list_controls/get_control and list_tables/describe_table occupy clearly different levels of detail.
The majority of tools follow a verb_noun pattern such as list_solutions, export_solution, and describe_table, but several use noun-first names like canvas_overview, app_checker_results, and solution_components, with outliers like pac_status and whoami. The mix is readable but not a consistent convention.
At 23 tools this falls in the 16-25 range that feels heavy for a single server, even though the broad Power Platform domain justifies much of the surface. It could plausibly be split into separate environment/solution and canvas-app analysis servers.
The tool set covers a complete workflow from environment discovery, solution export/unpack/diff, canvas app deep inspection, Dataverse metadata queries, to pack/import/publish with dry-run safeguards. Export outputs feed directly into the offline analysis tools, so there are no obvious dead ends.
Related MCP Connectors
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Capability-routed CLI/MCP: signed provenance exports, WCAG-validated themes, sovereign deploy modes.
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables CRUD operations and schema exploration on Microsoft Dataverse databases using service principal authentication. It allows users to query records with OData filters, manage table entries, and retrieve metadata through a standardized MCP interface.-
- AlicenseNot gradedqualityDmaintenanceEnables D365 F\&O development including object creation, modification, deletion, and analysis through the MCP standard.42MIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to manage and troubleshoot Power Automate cloud flows, including listing environments, flows, and runs, with optional write capabilities for triggering, enabling, disabling, and deleting flows.2MIT
- AlicenseAqualityDmaintenanceMCP server that lets AI assistants scaffold, build, register, query, and diagnose Microsoft Dataverse plug-ins directly from conversation, orchestrating Power Platform CLI and Azure CLI.24MIT