Skip to content

Commit 1ded191

Browse files
mrdailey99claude
andcommitted
docs: fix MCP setup instructions with correct Claude Code commands
- Add Quick start sections to both README and docs/mcp.md with numbered steps and a provardx.ping verify step - Fix Claude Code section: replace non-existent /mcp add slash command and .claude/mcp.json path with correct `claude mcp add -s user|project|local` commands and real config file locations (.mcp.json, settings.local.json) - Move license requirement before client configuration in docs/mcp.md since it is a startup blocker - Add Windows note: use sf.cmd in Claude Desktop when sf is not found Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent eb7178c commit 1ded191

2 files changed

Lines changed: 112 additions & 45 deletions

File tree

README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,45 @@ $ sf plugins uninstall @provartesting/provardx-cli
3535

3636
The Provar DX CLI includes a built-in **Model Context Protocol (MCP) server** that connects AI assistants (Claude Desktop, Claude Code, Cursor) directly to your Provar project. Once connected, an AI agent can inspect your project structure, generate Page Objects and test cases, validate every level of the test hierarchy with quality scores, and work with NitroX (Hybrid Model) component page objects for LWC, Screen Flow, Industry Components, Experience Cloud, and HTML5.
3737

38-
Validation runs in two modes: **local only** (structural rules, no key required) or **Quality Hub API** (170+ rules, quality scoring — requires a `pv_k_` API key). Run `sf provar auth login` to authenticate and unlock full validation. Don't have an account? **[Request access](https://aqqlrlhga7.execute-api.us-east-1.amazonaws.com/dev/auth/request-access)**.
38+
Validation runs in two modes: **local only** (structural rules, no key required) or **Quality Hub API** (170+ rules, quality scoring — requires a `pv_k_` API key). Don't have an account? **[Request access](https://aqqlrlhga7.execute-api.us-east-1.amazonaws.com/dev/auth/request-access)**.
39+
40+
## Quick setup
41+
42+
**Requires:** Provar Automation IDE installed with an activated license.
3943

4044
```sh
41-
sf provar mcp start --allowed-paths /path/to/your/provar/project
45+
# 1. Install the plugin (if not already installed)
46+
sf plugins install @provartesting/provardx-cli@beta
47+
48+
# 2. (Optional) Authenticate for full 170+ rule validation
49+
sf provar auth login
4250
```
4351

44-
📖 **See [docs/mcp.md](https://github.com/ProvarTesting/provardx-cli/blob/main/docs/mcp.md) for full setup and tool documentation.**
52+
**Claude Code** — run once to register the server:
4553

46-
## License Validation
54+
```sh
55+
claude mcp add provar -s user -- sf provar mcp start --allowed-paths /path/to/your/provar/project
56+
```
4757

48-
The MCP server verifies your Provar license before accepting any connections. Validation is automatic — no extra flags are required for standard usage.
58+
**Claude Desktop** — add to your config file and restart the app:
4959

50-
**How it works:**
60+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
61+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
5162

52-
1. **Auto-detection** — the server reads `~/Provar/.licenses/*.properties` (the same files written by Provar's IDE plugins). If a valid, activated license is found the server starts immediately.
53-
2. **Cache** — successful validations are cached at `~/Provar/.licenses/.mcp-license-cache.json` (2 h TTL). Subsequent starts within the TTL window skip the disk scan.
54-
3. **Grace fallback** — if the IDE license files cannot be found or read and the cache is stale (but ≤ 48 h old), the server starts with a warning on stderr using the cached result so CI pipelines are not broken by transient local file-access issues.
55-
4. **Fail closed** — if no valid license is detected the command exits with a non-zero exit code and a clear error message.
63+
```json
64+
{
65+
"mcpServers": {
66+
"provar": {
67+
"command": "sf",
68+
"args": ["provar", "mcp", "start", "--allowed-paths", "/path/to/your/provar/project"]
69+
}
70+
}
71+
}
72+
```
5673

57-
**`NODE_ENV=test` fast-path:**
74+
> **Windows (Claude Desktop):** Use `sf.cmd` instead of `sf` if the server fails to start.
5875
59-
When `NODE_ENV=test` the validation step is skipped entirely. This is intended only for the plugin's own unit-test suite.
76+
📖 **[docs/mcp.md](https://github.com/ProvarTesting/provardx-cli/blob/main/docs/mcp.md) — full setup, all 35+ tools, troubleshooting.**
6077

6178
---
6279

docs/mcp.md

Lines changed: 83 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,55 @@ The Provar DX CLI ships with a built-in **Model Context Protocol (MCP) server**
6161

6262
- **Node.js 18–24** (LTS 22 recommended). Node 25+ is not supported — a transitive dependency (`buffer-equal-constant-time`) crashes on startup. Check with `node --version`.
6363
- **Salesforce CLI** (`sf`) ≥ 2.x
64+
- **Provar Automation IDE** installed with an activated license (see [License requirement](#license-requirement) below)
65+
66+
## Quick start
67+
68+
```sh
69+
# 1. Install the plugin
70+
sf plugins install @provartesting/provardx-cli@beta
71+
72+
# 2. (Optional) Authenticate for full 170+ rule validation
73+
sf provar auth login
74+
75+
# 3. Connect your AI assistant — pick one client below
76+
```
77+
78+
**Claude Code** (one-time, works across all your projects):
79+
80+
```sh
81+
claude mcp add provar -s user -- sf provar mcp start --allowed-paths /path/to/your/provar/project
82+
```
83+
84+
**Claude Desktop** — edit your config file, then restart the app:
85+
86+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
87+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
88+
89+
```json
90+
{
91+
"mcpServers": {
92+
"provar": {
93+
"command": "sf",
94+
"args": ["provar", "mcp", "start", "--allowed-paths", "/path/to/your/provar/project"]
95+
}
96+
}
97+
}
98+
```
99+
100+
> **Windows (Claude Desktop):** If `sf` is not found, use `sf.cmd` as the command instead.
101+
102+
**Verify it's working** — ask your AI assistant: _"Call provardx.ping with message hello"_. You should get `{ "message": "hello" }` back.
103+
104+
---
105+
106+
## License requirement
107+
108+
The MCP server requires **Provar Automation IDE** to be installed on the same machine with an activated license. At startup the server reads `~/Provar/.licenses/*.properties` and verifies that at least one license is in the `Activated` state and was last verified online within the past 48 hours.
109+
110+
If the license check fails, the server exits with a clear error message explaining the reason (not found, stale, or expired). Open Provar Automation IDE to refresh the license online, then retry.
111+
112+
---
64113

65114
## Starting the server
66115

@@ -90,12 +139,22 @@ sf provar mcp start -a /workspace/project-a -a /workspace/project-b
90139

91140
## Client configuration
92141

93-
### Claude Desktop
142+
### Claude Code
94143

95-
Add a `provar` entry to your Claude Desktop MCP configuration file.
144+
The simplest approach is the `claude mcp add` CLI command:
145+
146+
```sh
147+
# User-scoped — works across all your projects
148+
claude mcp add provar -s user -- sf provar mcp start --allowed-paths /path/to/your/provar/project
149+
150+
# Project-scoped, shared — creates .mcp.json in project root (commit to source control)
151+
claude mcp add provar -s project -- sf provar mcp start --allowed-paths /path/to/your/provar/project
152+
153+
# Project-scoped, private — stored in .claude/settings.local.json (not committed)
154+
claude mcp add provar -s local -- sf provar mcp start --allowed-paths /path/to/your/provar/project
155+
```
96156

97-
**macOS / Linux:** `~/Library/Application Support/Claude/claude_desktop_config.json`
98-
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
157+
You can also edit `.mcp.json` at your project root directly for the shared project config:
99158

100159
```json
101160
{
@@ -108,11 +167,12 @@ Add a `provar` entry to your Claude Desktop MCP configuration file.
108167
}
109168
```
110169

111-
Restart Claude Desktop after saving the file. The Provar tools will appear in the tool list.
170+
### Claude Desktop
112171

113-
### Claude Code
172+
Add a `provar` entry to your Claude Desktop MCP configuration file.
114173

115-
Add the server to your project's `.claude/mcp.json` (project-scoped) or `~/.claude/mcp.json` (user-scoped):
174+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
175+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
116176

117177
```json
118178
{
@@ -125,26 +185,16 @@ Add the server to your project's `.claude/mcp.json` (project-scoped) or `~/.clau
125185
}
126186
```
127187

128-
Alternatively, run directly from a Claude Code session:
188+
> **Windows:** If `sf` is not found, use `sf.cmd` as the command. Claude Desktop may not inherit the full shell PATH, so `sf.cmd` (the npm-installed wrapper) is more reliable.
129189
130-
```
131-
/mcp add provar sf provar mcp start --allowed-paths /path/to/project
132-
```
190+
Restart Claude Desktop after saving the file. The Provar tools will appear in the tool list.
133191

134192
### Cursor / other MCP clients
135193

136194
Any MCP client that supports the **stdio transport** can use this server. Point `command` at `sf` (or the full path to the Salesforce CLI binary) and pass `["provar", "mcp", "start"]` as arguments, plus `--allowed-paths` as appropriate for your project layout.
137195

138196
---
139197

140-
## License requirement
141-
142-
The MCP server requires **Provar Automation IDE** to be installed on the same machine with an activated license. At startup the server reads `~/Provar/.licenses/*.properties` and verifies that at least one icense is in the `Activated` state and was last verified online within the past 48 hours.
143-
144-
If the license check fails, the server exits with a clear error message explaining the reason (not found, stale, or expired). Open Provar Automation IDE to refresh the license online, then retry.
145-
146-
---
147-
148198
## Authentication — Quality Hub API
149199

150200
The `provar.testcase.validate` tool can run in two modes depending on whether an API key is configured.
@@ -365,20 +415,20 @@ Validates an XML test case for schema correctness (validity score) and best prac
365415

366416
**Output**
367417

368-
| Field | Type | Description |
369-
| -------------------------------- | -------------- | ------------------------------------------------------------------------- |
370-
| `is_valid` | boolean | `true` if zero ERROR-level schema violations |
371-
| `validity_score` | number (0–100) | Schema compliance score (100 − errorCount × 20) |
372-
| `quality_score` | number (0–100) | Best-practices score (weighted deduction formula) |
373-
| `error_count` | integer | Schema error count |
374-
| `warning_count` | integer | Schema warning count |
375-
| `step_count` | integer | Number of `<apiCall>` steps |
376-
| `test_case_id` | string | Value of the `id` attribute |
377-
| `test_case_name` | string | Value of the `name` attribute |
378-
| `issues` | array | Schema issues with `rule_id`, `severity`, `message` |
379-
| `best_practices_violations` | array | Best-practices violations with `rule_id`, `severity`, `weight`, `message` |
380-
| `best_practices_rules_evaluated` | integer | How many best-practices rules were checked |
381-
| `validation_source` | string | `quality_hub`, `local`, or `local_fallback` — see Authentication section |
418+
| Field | Type | Description |
419+
| -------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------ |
420+
| `is_valid` | boolean | `true` if zero ERROR-level schema violations |
421+
| `validity_score` | number (0–100) | Schema compliance score (100 − errorCount × 20) |
422+
| `quality_score` | number (0–100) | Best-practices score (weighted deduction formula) |
423+
| `error_count` | integer | Schema error count |
424+
| `warning_count` | integer | Schema warning count |
425+
| `step_count` | integer | Number of `<apiCall>` steps |
426+
| `test_case_id` | string | Value of the `id` attribute |
427+
| `test_case_name` | string | Value of the `name` attribute |
428+
| `issues` | array | Schema issues with `rule_id`, `severity`, `message` |
429+
| `best_practices_violations` | array | Best-practices violations with `rule_id`, `severity`, `weight`, `message` |
430+
| `best_practices_rules_evaluated` | integer | How many best-practices rules were checked |
431+
| `validation_source` | string | `quality_hub`, `local`, or `local_fallback` — see Authentication section |
382432
| `validation_warning` | string | Present when `validation_source` is `local` (onboarding) or `local_fallback` (explains why API failed) |
383433

384434
**Key schema rules:** TC_001 (missing XML declaration), TC_002 (malformed XML), TC_003 (wrong root element), TC_010/011/012 (missing/invalid id/guid), TC_031 (invalid apiCall guid), TC_034/035 (non-integer testItemId).

0 commit comments

Comments
 (0)