trxa-tool 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/.claude/skills/replay-trxa-testplan/SKILL.md +627 -0
  2. package/LICENSE +120 -0
  3. package/MANUAL.md +556 -0
  4. package/README.md +91 -3
  5. package/SETUP.md +401 -0
  6. package/STUDIO.md +427 -0
  7. package/dist/analyze.d.ts +58 -0
  8. package/dist/analyze.js +122 -0
  9. package/dist/bpm.d.ts +40 -0
  10. package/dist/bpm.js +60 -0
  11. package/dist/build-test-script.d.ts +24 -0
  12. package/dist/build-test-script.js +40 -0
  13. package/dist/csv.d.ts +1 -0
  14. package/dist/csv.js +11 -0
  15. package/dist/extract.d.ts +14 -0
  16. package/dist/extract.js +34 -0
  17. package/dist/fixture-schema.d.ts +52 -0
  18. package/dist/fixture-schema.js +112 -0
  19. package/dist/fixture-store.d.ts +37 -0
  20. package/dist/fixture-store.js +75 -0
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.js +850 -0
  23. package/dist/library-archive.d.ts +37 -0
  24. package/dist/library-archive.js +106 -0
  25. package/dist/mapping.d.ts +25 -0
  26. package/dist/mapping.js +393 -0
  27. package/dist/mcp-bridge.d.ts +52 -0
  28. package/dist/mcp-bridge.js +290 -0
  29. package/dist/normalize.d.ts +21 -0
  30. package/dist/normalize.js +43 -0
  31. package/dist/parse.d.ts +3 -0
  32. package/dist/parse.js +233 -0
  33. package/dist/plan-runner.d.ts +27 -0
  34. package/dist/plan-runner.js +36 -0
  35. package/dist/plan-schema.d.ts +27 -0
  36. package/dist/plan-schema.js +45 -0
  37. package/dist/planrun-schema.d.ts +53 -0
  38. package/dist/planrun-schema.js +111 -0
  39. package/dist/planrun.d.ts +20 -0
  40. package/dist/planrun.js +46 -0
  41. package/dist/report-schema.d.ts +92 -0
  42. package/dist/report-schema.js +115 -0
  43. package/dist/report.d.ts +45 -0
  44. package/dist/report.js +77 -0
  45. package/dist/schema.d.ts +96 -0
  46. package/dist/schema.js +10 -0
  47. package/dist/scrub.d.ts +44 -0
  48. package/dist/scrub.js +166 -0
  49. package/dist/suggest-inputs.d.ts +19 -0
  50. package/dist/suggest-inputs.js +92 -0
  51. package/dist/suite-runner.d.ts +59 -0
  52. package/dist/suite-runner.js +204 -0
  53. package/dist/suite-schema.d.ts +59 -0
  54. package/dist/suite-schema.js +95 -0
  55. package/dist/testcase-schema.d.ts +102 -0
  56. package/dist/testcase-schema.js +132 -0
  57. package/dist/token-usage.d.ts +38 -0
  58. package/dist/token-usage.js +95 -0
  59. package/media/studio/fixtures-test-cases.png +0 -0
  60. package/media/studio/plans-editor.png +0 -0
  61. package/media/studio/recordings-create-test-case.png +0 -0
  62. package/media/studio/run-dialog.png +0 -0
  63. package/media/studio/settings-agent-runs.png +0 -0
  64. package/media/studio/settings-working-folder.png +0 -0
  65. package/media/studio/studio-recordings.png +0 -0
  66. package/media/studio/suites-canvas.png +0 -0
  67. package/media/studio/suites-inspector.png +0 -0
  68. package/media/studio/testcases-expectations.png +0 -0
  69. package/media/studio/testcases-outputs.png +0 -0
  70. package/media/studio/testrun-details.png +0 -0
  71. package/media/studio/testruns-list.png +0 -0
  72. package/package.json +62 -6
  73. package/studio/client-dist/assets/CreatePanel-C5bb5OIs.js +6 -0
  74. package/studio/client-dist/assets/FactTile-G1pURLys.js +1 -0
  75. package/studio/client-dist/assets/FieldLabel-DPmIEQ08.js +1 -0
  76. package/studio/client-dist/assets/FixtureNamePicker-137AAgwZ.js +1 -0
  77. package/studio/client-dist/assets/Fixtures-D0t-soph.js +1 -0
  78. package/studio/client-dist/assets/GeneralSection-CWkTeSX2.js +1 -0
  79. package/studio/client-dist/assets/ListPaneHeader-DXKqX36N.js +1 -0
  80. package/studio/client-dist/assets/Plans-C70evkGc.js +1 -0
  81. package/studio/client-dist/assets/Recordings-BT0dyVLs.js +1 -0
  82. package/studio/client-dist/assets/Settings-k-J3u5lH.js +1 -0
  83. package/studio/client-dist/assets/Suites-DLioOiRN.css +1 -0
  84. package/studio/client-dist/assets/Suites-DQhhMxjT.js +7 -0
  85. package/studio/client-dist/assets/TestCases-BdiopVGI.js +1 -0
  86. package/studio/client-dist/assets/TestRuns-CylAe-3t.js +9 -0
  87. package/studio/client-dist/assets/api-DJZ703_F.js +24 -0
  88. package/studio/client-dist/assets/bucket-18-viuwGcaj.js +1 -0
  89. package/studio/client-dist/assets/fixtureName-CTZT_jKu.js +1 -0
  90. package/studio/client-dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  91. package/studio/client-dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  92. package/studio/client-dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  93. package/studio/client-dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  94. package/studio/client-dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  95. package/studio/client-dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  96. package/studio/client-dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  97. package/studio/client-dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  98. package/studio/client-dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  99. package/studio/client-dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  100. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-300-normal-LoaTnByX.woff +0 -0
  101. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-300-normal-RhT0Ayi3.woff2 +0 -0
  102. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-400-italic-Bf1n82Tb.woff +0 -0
  103. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-400-italic-D9J6q4_O.woff2 +0 -0
  104. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
  105. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
  106. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
  107. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
  108. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-300-normal-Bbd5v1xK.woff +0 -0
  109. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-300-normal-DqmgDkIN.woff2 +0 -0
  110. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-400-italic-BELOEI8R.woff2 +0 -0
  111. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-400-italic-CfSXsIbO.woff +0 -0
  112. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
  113. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
  114. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
  115. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
  116. package/studio/client-dist/assets/ibm-plex-sans-greek-300-normal-J-CBqZoJ.woff2 +0 -0
  117. package/studio/client-dist/assets/ibm-plex-sans-greek-300-normal-STc8XiDr.woff +0 -0
  118. package/studio/client-dist/assets/ibm-plex-sans-greek-400-italic-BEZwmy7D.woff2 +0 -0
  119. package/studio/client-dist/assets/ibm-plex-sans-greek-400-italic-CTYLy0lX.woff +0 -0
  120. package/studio/client-dist/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
  121. package/studio/client-dist/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
  122. package/studio/client-dist/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
  123. package/studio/client-dist/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
  124. package/studio/client-dist/assets/ibm-plex-sans-latin-300-normal-C9Of02-5.woff +0 -0
  125. package/studio/client-dist/assets/ibm-plex-sans-latin-300-normal-b4i7YzLG.woff2 +0 -0
  126. package/studio/client-dist/assets/ibm-plex-sans-latin-400-italic-CZTNEAuW.woff2 +0 -0
  127. package/studio/client-dist/assets/ibm-plex-sans-latin-400-italic-CsGl1sm0.woff +0 -0
  128. package/studio/client-dist/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
  129. package/studio/client-dist/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
  130. package/studio/client-dist/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
  131. package/studio/client-dist/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
  132. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-300-normal-B8Zgwjh3.woff +0 -0
  133. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-300-normal-BLFuR0P1.woff2 +0 -0
  134. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-400-italic-Du9zzoL2.woff2 +0 -0
  135. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-400-italic-V_9i1P_m.woff +0 -0
  136. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
  137. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
  138. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
  139. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
  140. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-300-normal-CkYRZD2a.woff +0 -0
  141. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-300-normal-SDfX6ktj.woff2 +0 -0
  142. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-400-italic-78jqtfZH.woff +0 -0
  143. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-400-italic-BbRnwouv.woff2 +0 -0
  144. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
  145. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
  146. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
  147. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
  148. package/studio/client-dist/assets/index-cxBc2iRv.js +10 -0
  149. package/studio/client-dist/assets/index-wjWuVHXN.css +1 -0
  150. package/studio/client-dist/assets/status-DUGxC7G7.js +1 -0
  151. package/studio/client-dist/assets/testCaseTree-Cl1-bc5O.js +1 -0
  152. package/studio/client-dist/axtr-icon.svg +2 -0
  153. package/studio/client-dist/favicon.svg +2 -0
  154. package/studio/client-dist/index.html +15 -0
  155. package/studio/server/dist/index.js +3176 -0
package/SETUP.md ADDED
@@ -0,0 +1,401 @@
1
+ # Set up TRXA Studio for agent runs
2
+
3
+ This article explains how to install and configure everything TRXA Studio needs to replay tests
4
+ against Dynamics 365 Finance and Supply Chain Management with an AI
5
+ agent. When you finish, **Settings** > **Agent runs** in Studio shows every item as ready, and the
6
+ **Run** button on test cases, suites and plans is available.
7
+
8
+ You can use Studio without completing every step. To build test cases, fixtures, suites and plans
9
+ from Task Recorder recordings, you only need [Step 1](#step-1-install-trxa-tool). Steps 2 through 7
10
+ are needed only to run tests with an AI agent.
11
+
12
+ ## How the pieces fit together
13
+
14
+ An agent run involves four components on your computer and one in Dynamics 365:
15
+
16
+ | Component | What it does | Where you set it up |
17
+ |---|---|---|
18
+ | **TRXA-TOOL** | Studio, plus the `trxa` command that the agent uses to track and record each run. | [Step 1](#step-1-install-trxa-tool) |
19
+ | **An AI agent** | GitHub Copilot CLI or Claude Code. The agent reads each test step and performs it in Dynamics 365. | [Step 2](#step-2-install-an-agent) and [Step 3](#step-3-sign-in-to-the-agent) |
20
+ | **The Dynamics 365 ERP MCP server** | A Microsoft service, built into finance and operations apps, that lets an agent open forms, set values and read data. | [Step 4](#step-4-prepare-the-dynamics-365-environment) |
21
+ | **The MCP connection** | A setting in your agent that tells it how to reach your environment's MCP server. TRXA-TOOL provides a connector for this, `trxa mcp-bridge`. | [Step 5](#step-5-connect-the-agent-to-dynamics-365) |
22
+ | **The replay skill** | Instructions that teach the agent how to replay a TRXA test step by step. | [Step 6](#step-6-install-the-replay-skill) |
23
+
24
+ ## Prerequisites
25
+
26
+ Before you begin, make sure that you have:
27
+
28
+ - A computer that runs Windows 10 or Windows 11. The npm package also runs on macOS and Linux, but
29
+ this article shows Windows commands.
30
+ - A finance and operations apps environment that is **Tier 2 or higher**, or a **Unified Developer
31
+ Environment**. The MCP server isn't supported on cloud-hosted environments (CHE).
32
+ - An environment version of **10.0.47** or later, **10.0.46 PQU-2**, or **10.0.45 PQU-7**.
33
+ - An account for one of the supported agents:
34
+ - **GitHub Copilot CLI**: a GitHub account with a Copilot subscription.
35
+ - **Claude Code**: a Claude subscription or an Anthropic API key.
36
+ - Help from a **Microsoft Entra ID administrator** and a **finance and operations system
37
+ administrator** for [Step 4](#step-4-prepare-the-dynamics-365-environment), if you aren't one.
38
+
39
+ > [!WARNING]
40
+ > Use a test or sandbox environment. A full run can save and post real records. Never connect an
41
+ > agent to a production environment for testing.
42
+
43
+ ## Step 1: Install TRXA-TOOL
44
+
45
+ TRXA-TOOL is available in two forms. Both include Studio and both can run tests with an agent.
46
+
47
+ | | Windows app | npm package |
48
+ |---|---|---|
49
+ | **Best for** | Consultants and testers who work in Studio | Developers and technical users who also want the command line |
50
+ | **Studio opens** | In its own window | In your browser |
51
+ | **`trxa` command in a terminal** | Through its full path (see the note after this table) | Yes |
52
+ | **Needs Node.js** | No | Yes, version 18.19 or later |
53
+
54
+ > [!NOTE]
55
+ > The Windows app includes its own copy of the `trxa` command, in the `resources\cli` folder of the
56
+ > app. Studio uses it automatically during agent runs, so you don't need to install anything else.
57
+ > To use it from a terminal, run it by its full path, for example
58
+ > `"%LOCALAPPDATA%\Programs\TRXA Studio\resources\cli\trxa.cmd" --version`.
59
+
60
+ ### Install the Windows app
61
+
62
+ 1. Go to the [Releases](https://github.com/elcanelo/trxa-tool/releases) page and download one of
63
+ these files from the latest release:
64
+ - **Portable**: `TRXA-Studio-<version>-win-x64-portable.zip`. Nothing is installed. To update,
65
+ replace the folder.
66
+ - **Installer**: `TRXA-Studio-Setup-<version>.exe`. Installs for your user only, with a
67
+ **Start** menu shortcut and an uninstaller. Administrator rights aren't needed. The default
68
+ folder is `%LOCALAPPDATA%\Programs\TRXA Studio`.
69
+ 1. If you downloaded the portable zip, right-click the file, select **Properties**, select
70
+ **Unblock**, and then select **OK**. Extract the zip to a folder of your choice.
71
+ 1. Start the app. For the portable version, run `TRXA Studio.exe` from the extracted folder.
72
+
73
+ The app isn't code-signed yet. If Windows SmartScreen shows **Windows protected your PC**, select
74
+ **More info**, and then select **Run anyway**. Unblocking the zip before you extract it usually
75
+ prevents this message.
76
+
77
+ > [!NOTE]
78
+ > On a company-managed computer, an IT policy might block unsigned apps. If Windows says **Access
79
+ > is denied**, or Microsoft Defender reports a blocked app, ask your IT team to allow TRXA Studio,
80
+ > or use the npm package instead.
81
+
82
+ ### Install the npm package
83
+
84
+ 1. Install [Node.js](https://nodejs.org) version 18.19 or later, if you don't have it.
85
+ 1. Open a terminal and run:
86
+
87
+ ```powershell
88
+ npm install -g trxa-tool
89
+ ```
90
+
91
+ 1. Check the installation:
92
+
93
+ ```powershell
94
+ trxa --version
95
+ ```
96
+
97
+ The command prints `trxa-tool` followed by the version number.
98
+
99
+ 1. Start Studio:
100
+
101
+ ```powershell
102
+ trxa studio
103
+ ```
104
+
105
+ Studio opens in your browser. To stop it, run `trxa studio stop`.
106
+
107
+ To update later, run `npm update -g trxa-tool`.
108
+
109
+ ## Step 2: Install an agent
110
+
111
+ Studio can run tests with **GitHub Copilot CLI** or **Claude Code**. You need at least one of them.
112
+ GitHub Copilot CLI is the default agent in the **Run** dialog.
113
+
114
+ ### Install GitHub Copilot CLI
115
+
116
+ GitHub Copilot CLI on Windows needs PowerShell 6 or later. Windows includes Windows PowerShell 5.1,
117
+ which isn't enough.
118
+
119
+ 1. If you don't have PowerShell 7, install it:
120
+
121
+ ```powershell
122
+ winget install Microsoft.PowerShell
123
+ ```
124
+
125
+ 1. Open **PowerShell 7** (`pwsh`) and install GitHub Copilot CLI:
126
+
127
+ ```powershell
128
+ winget install GitHub.Copilot
129
+ ```
130
+
131
+ 1. Close and reopen the terminal, and then check the installation:
132
+
133
+ ```powershell
134
+ copilot --version
135
+ ```
136
+
137
+ For other installation methods, see
138
+ [Installing GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli).
139
+
140
+ ### Install Claude Code
141
+
142
+ 1. Open PowerShell and run the Claude Code installer:
143
+
144
+ ```powershell
145
+ irm https://claude.ai/install.ps1 | iex
146
+ ```
147
+
148
+ 1. Close and reopen the terminal, and then check the installation:
149
+
150
+ ```powershell
151
+ claude --version
152
+ ```
153
+
154
+ For other installation methods, see
155
+ [Set up Claude Code](https://code.claude.com/docs/en/setup).
156
+
157
+ ## Step 3: Sign in to the agent
158
+
159
+ An agent run starts the agent in the background, where it can't ask you to sign in. Sign in once
160
+ from a terminal before you start a run.
161
+
162
+ ### Sign in to GitHub Copilot CLI
163
+
164
+ 1. In a terminal, run:
165
+
166
+ ```powershell
167
+ copilot login
168
+ ```
169
+
170
+ 1. Copy the code that's shown, open the web page it names, paste the code, and approve the
171
+ sign-in with your GitHub account.
172
+
173
+ ### Sign in to Claude Code
174
+
175
+ 1. In a terminal, run:
176
+
177
+ ```powershell
178
+ claude
179
+ ```
180
+
181
+ 1. Follow the prompts to sign in with your Claude account or an Anthropic API key.
182
+ 1. When the sign-in is complete, type `/exit` to close Claude Code.
183
+
184
+ ## Step 4: Prepare the Dynamics 365 environment
185
+
186
+ The agent works in Dynamics 365 through Microsoft's Dynamics 365 ERP MCP server. Your agent
187
+ connects with its own identity, a Microsoft Entra ID app registration, and Dynamics 365 runs every
188
+ request as the finance and operations user that you link to that identity.
189
+
190
+ > [!NOTE]
191
+ > These steps need administrator rights in Microsoft Entra ID and in finance and operations apps.
192
+ > If you aren't an administrator, send this section to the people who are.
193
+
194
+ ### Confirm that the MCP server is turned on
195
+
196
+ 1. In finance and operations apps, go to **System administration** > **Workspaces** > **Feature
197
+ management**.
198
+ 1. Find **Dynamics 365 ERP Model Context Protocol server** and confirm that it's enabled. It's
199
+ enabled by default.
200
+
201
+ ### Register an app in Microsoft Entra ID
202
+
203
+ 1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com).
204
+ 1. Go to **Entra ID** > **App registrations**, and then select **New registration**.
205
+ 1. Enter a name, for example `TRXA agent runs`. Leave the other settings at their defaults, and
206
+ then select **Register**.
207
+ 1. On the app's **Overview** page, copy these two values. You need them in Step 5:
208
+ - **Application (client) ID**
209
+ - **Directory (tenant) ID**
210
+ 1. Go to **Certificates & secrets** > **Client secrets**, and then select **New client secret**.
211
+ 1. Enter a description, choose an expiry, and then select **Add**.
212
+ 1. Copy the secret's **Value** right away. Entra ID shows it only once.
213
+
214
+ For more information, see
215
+ [Register an application in Microsoft Entra ID](https://learn.microsoft.com/entra/identity-platform/quickstart-register-app).
216
+
217
+ ### Link the app to a finance and operations user
218
+
219
+ 1. In finance and operations apps, go to **System administration** > **Setup** > **Microsoft
220
+ Entra ID applications**.
221
+ 1. Select **New**.
222
+ 1. In **Client ID**, enter the **Application (client) ID** from the app registration.
223
+ 1. In **Name**, enter a name for the record.
224
+ 1. In **User ID**, select the user that the agent acts as.
225
+
226
+ Choose the user carefully. The agent can do only what this user can do, and every record the agent
227
+ creates or changes is attributed to this user. Use a dedicated test user with the security roles
228
+ that your tests need. To exempt the agent's identity from a finance and operations user license,
229
+ also assign the **System agent** role to that user. The role grants no permissions by itself.
230
+
231
+ ### Allow the app to use the MCP server
232
+
233
+ 1. In finance and operations apps, go to **System administration** > **Setup** > **Allowed MCP
234
+ clients**.
235
+ 1. Select **New**, and then enter these values:
236
+
237
+ | Field | Value |
238
+ |---|---|
239
+ | **Name** | A name for the connection, for example `TRXA agent runs` |
240
+ | **ClientId** | The **Application (client) ID** from the app registration |
241
+ | **Allowed** | Yes |
242
+
243
+ 1. Save the record. The change can take up to one minute to take effect.
244
+
245
+ > [!NOTE]
246
+ > Microsoft bills MCP tool calls from agents other than Microsoft Copilot Studio at 0.1 Copilot
247
+ > Credits per tool call. Users with Dynamics 365 Finance Premium or Supply Chain Management Premium
248
+ > licenses are exempt. A single test run can make many tool calls. For details, see
249
+ > [Licensing](https://learn.microsoft.com/dynamics365/fin-ops-core/dev-itpro/copilot/copilot-mcp#licensing).
250
+
251
+ For more information about the MCP server, see
252
+ [Use Model Context Protocol for finance and operations apps](https://learn.microsoft.com/dynamics365/fin-ops-core/dev-itpro/copilot/copilot-mcp)
253
+ and [Security for Dynamics 365 ERP MCP](https://learn.microsoft.com/dynamics365/fin-ops-core/dev-itpro/copilot/mcp/mcp-security).
254
+
255
+ ## Step 5: Connect the agent to Dynamics 365
256
+
257
+ Your agent reaches the MCP server through `trxa mcp-bridge`, a connector included in TRXA-TOOL. The
258
+ agent starts the connector when it needs Dynamics 365. The connector signs in with the app
259
+ registration from Step 4, and it recovers on its own from dropped sessions and short outages.
260
+
261
+ The connector reads four settings:
262
+
263
+ | Setting | Value |
264
+ |---|---|
265
+ | `D365_URL` | Your environment's address, for example `https://contoso.operations.dynamics.com` |
266
+ | `D365_TENANT_ID` | The **Directory (tenant) ID** from the app registration |
267
+ | `D365_CLIENT_ID` | The **Application (client) ID** from the app registration |
268
+ | `D365_CLIENT_SECRET` | The client secret **Value** from the app registration |
269
+
270
+ > [!WARNING]
271
+ > Name the server `d365-erp-mcp`, exactly as shown in the following examples. The replay skill and
272
+ > the Studio readiness check look for that name.
273
+
274
+ If you use the Windows app without the npm package, replace `trxa` in the following examples with
275
+ the full path to the app's `trxa.cmd`, for example
276
+ `C:\Users\<you>\AppData\Local\Programs\TRXA Studio\resources\cli\trxa.cmd`.
277
+
278
+ ### Connect GitHub Copilot CLI
279
+
280
+ 1. Open `%USERPROFILE%\.copilot\mcp-config.json` in a text editor. If the file doesn't exist,
281
+ create it.
282
+ 1. Add a `d365-erp-mcp` entry under `mcpServers`, with your own values in `env`:
283
+
284
+ ```json
285
+ {
286
+ "mcpServers": {
287
+ "d365-erp-mcp": {
288
+ "type": "local",
289
+ "command": "cmd",
290
+ "args": ["/c", "trxa", "mcp-bridge"],
291
+ "env": {
292
+ "D365_URL": "https://contoso.operations.dynamics.com",
293
+ "D365_TENANT_ID": "<directory-tenant-id>",
294
+ "D365_CLIENT_ID": "<application-client-id>",
295
+ "D365_CLIENT_SECRET": "<client-secret-value>"
296
+ },
297
+ "tools": ["*"]
298
+ }
299
+ }
300
+ }
301
+ ```
302
+
303
+ If the file already lists other servers, add only the `d365-erp-mcp` entry next to them.
304
+ For the Windows app's full path, use `"args": ["/c", "C:\\Users\\<you>\\AppData\\Local\\Programs\\TRXA Studio\\resources\\cli\\trxa.cmd", "mcp-bridge"]`.
305
+ In JSON, every backslash is written twice.
306
+
307
+ 1. Save the file.
308
+
309
+ ### Connect Claude Code
310
+
311
+ In a terminal, run the following command with your own values. Keep the options in this order: the
312
+ `-s user` option must come after the `-e` options.
313
+
314
+ ```powershell
315
+ claude mcp add d365-erp-mcp -e D365_URL=https://contoso.operations.dynamics.com -e D365_TENANT_ID=<directory-tenant-id> -e D365_CLIENT_ID=<application-client-id> -e D365_CLIENT_SECRET=<client-secret-value> -s user -- cmd /c trxa mcp-bridge
316
+ ```
317
+
318
+ Claude Code confirms with `Added stdio MCP server d365-erp-mcp`. The `-s user` option makes the
319
+ server available in every folder, including the working folder that Studio runs the agent in.
320
+
321
+ > [!WARNING]
322
+ > These settings store the client secret as plain text in your user profile
323
+ > (`.copilot\mcp-config.json` or `.claude.json`). Don't share these files or commit them to source
324
+ > control. When the secret expires, create a new one in Entra ID and update the setting.
325
+
326
+ ### Check the connection
327
+
328
+ Before you start a run from Studio, confirm that the agent can reach Dynamics 365:
329
+
330
+ 1. Start the agent in a terminal (`copilot` or `claude`).
331
+ 1. Ask: *"Use the d365-erp-mcp server to tell me which user and company I'm connected as."*
332
+ 1. Confirm that the answer names the user from Step 4 and the environment you expect.
333
+
334
+ If the agent reports an error, see [Troubleshoot](#troubleshoot).
335
+
336
+ ## Step 6: Install the replay skill
337
+
338
+ The replay skill, `replay-trxa-testplan`, teaches the agent how to replay a TRXA test: how to
339
+ perform each step, check expectations and record results. Install it in Studio's working folder.
340
+
341
+ To install it from Studio:
342
+
343
+ 1. Select **Settings** (the gear icon in the upper-right corner).
344
+ 1. In **Agent runs**, find the **Replay skill** row, and then select **Install skill**.
345
+
346
+ To install it from a terminal instead, go to your working folder and run:
347
+
348
+ ```powershell
349
+ trxa init-skill
350
+ ```
351
+
352
+ Both methods copy the skill into the working folder's `.claude\skills` folder, where GitHub Copilot
353
+ CLI and Claude Code find it, and into `.agents\skills` for other agents such as Codex.
354
+
355
+ ## Step 7: Check that Studio is ready
356
+
357
+ 1. In Studio, select **Settings**, and then go to **Agent runs**.
358
+ 1. Select **Check again** to refresh the list.
359
+ 1. Confirm that each item shows a green check mark. Under the list, Studio says which agent is
360
+ ready, for example **Ready to run with GitHub Copilot.**
361
+
362
+ ![The Agent runs section of Studio Settings, with every check passed for GitHub Copilot.](media/studio/settings-agent-runs.png)
363
+
364
+ A yellow warning on **Claude Code CLI** is fine if you use GitHub Copilot, because Claude Code is
365
+ optional. Each item that isn't ready shows what to do next and a **Setup guide** link to the
366
+ matching step in this article.
367
+
368
+ You're ready to run a test. To learn how, see
369
+ [Run a test with an AI agent](STUDIO.md#run-a-test-with-an-ai-agent).
370
+
371
+ ## Troubleshoot
372
+
373
+ Each row in **Settings** > **Agent runs** matches one part of this setup.
374
+
375
+ | Row | If it isn't ready |
376
+ |---|---|
377
+ | **TRXA CLI** | Studio can't find the `trxa` command. If you use the npm package, run `npm install -g trxa-tool`, and then restart Studio. The Windows app includes its own copy, so this row is ready there. See [Step 1](#step-1-install-trxa-tool). |
378
+ | **GitHub Copilot CLI** | Install it from PowerShell 7 with `winget install GitHub.Copilot`, and then restart Studio so that it finds the new command. See [Step 2](#step-2-install-an-agent). |
379
+ | **Copilot sign-in** | Run `copilot login` in a terminal. See [Step 3](#step-3-sign-in-to-the-agent). |
380
+ | **D365 ERP MCP server** | No server named `d365-erp-mcp` is configured for either agent. Check the name and the file location in [Step 5](#step-5-connect-the-agent-to-dynamics-365). The row also says which agents have it. An agent can run only if it has its own `d365-erp-mcp` entry. |
381
+ | **Replay skill** | Select **Install skill**, or run `trxa init-skill` in the working folder. If you changed the working folder, install the skill in the new folder too. See [Step 6](#step-6-install-the-replay-skill). |
382
+ | **Claude Code CLI** | Optional. To use Claude Code, install it and sign in. See [Step 2](#step-2-install-an-agent) and [Step 3](#step-3-sign-in-to-the-agent). |
383
+
384
+ ### The agent can't connect to Dynamics 365
385
+
386
+ The connector writes its messages to the agent's MCP log. The most common causes are:
387
+
388
+ | Message or symptom | Cause and fix |
389
+ |---|---|
390
+ | `trxa mcp-bridge: set D365_URL, ... in the MCP server's "env" settings` | One or more settings are missing from the `env` section. Add all four. |
391
+ | `trxa mcp-bridge: D365_URL must start with https://` | Use the environment's full `https://` address. |
392
+ | Sign-in errors that mention `AADSTS` | The tenant ID, client ID or secret is wrong, or the secret expired. Check the values in Entra ID. |
393
+ | HTTP 401 or 403 from the environment | The app isn't linked to a user in **Microsoft Entra ID applications**, or its client ID isn't in **Allowed MCP clients** with **Allowed** set to **Yes**. Changes to **Allowed MCP clients** can take a minute. |
394
+ | The agent connects but can't open a form | The linked user lacks the security role for that form. Some administration forms are never available through the MCP server, such as **Feature management** and **Users**. |
395
+ | `'trxa' is not recognized` | The agent can't find the `trxa` command. Use the full path to `trxa.cmd`, as described in [Step 5](#step-5-connect-the-agent-to-dynamics-365). |
396
+
397
+ ## Next steps
398
+
399
+ - [Use TRXA Studio](STUDIO.md): create test cases from recordings, build suites and plans, run them
400
+ and review the results.
401
+ - [TRXA-TOOL manual](MANUAL.md): the full command-line reference.