@qcentriq/mcp 0.2.0 → 0.3.1

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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@qcentriq/mcp.svg?style=flat-square)](https://www.npmjs.com/package/@qcentriq/mcp)
4
4
  [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg?style=flat-square)](LICENSE)
5
- [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
5
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D22.12.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
6
6
  [![MCP](https://img.shields.io/badge/protocol-Model%20Context%20Protocol-orange.svg?style=flat-square)](https://modelcontextprotocol.io)
7
7
 
8
8
  Official [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for **QCentriq** automated test discovery, error diagnostics, script retrieval, and local test execution.
@@ -14,7 +14,7 @@ Connect your AI coding assistants (**Cursor**, **Claude Desktop**, **VS Code Cli
14
14
  - **Remote Cloud Discovery & Diagnostics**: Instantly query test cases, groups, run logs, failure stack traces, and environment variables via authenticated REST client endpoints.
15
15
  - **Local Playwright Test Execution**: Safely execute tests locally with `pytest` without triggering unwanted cloud runners. Supports headless and headed modes across Chromium, Firefox, and WebKit.
16
16
  - **Smart Environment Setup**: Probes installed local Python package managers (`uv`, `poetry`, `conda`, or standard `venv`) and generates ready-to-run setup commands (prefers `uv` for lightning-fast setup).
17
- - **Direct Workspace Script Saving**: Download test scripts and accompanying fixtures (`conftest.py`) directly to your workspace `tests/` directory with path traversal protections.
17
+ - **Direct Workspace Script Saving**: Download test scripts and accompanying fixtures (`conftest.py`) into a dedicated `qcentriq_tests/` workspace directory (kept apart from your own `tests/`, so an existing `conftest.py` is never overwritten) with path traversal protections.
18
18
  - **Zero-Leak Redaction**: Automatically filters all outgoing tool payloads, masking API keys (`qc_...`), bearer tokens, and URL credentials before sending them to the LLM.
19
19
  - **Strict Stdio Isolation**: Protocol JSON-RPC frames communicate cleanly over `stdout`, while all diagnostic logs route to `stderr`.
20
20
 
@@ -208,16 +208,24 @@ The QCentriq MCP Server cleanly separates **remote cloud discovery/diagnostics**
208
208
  | `qcentriq_list_tests` | Discover test cases and test groups with status, priority, and update timestamps. Script availability is highlighted. | `project_id` *(uuid)*, `group_id` *(uuid)*, `priority` *("low"\|"medium"\|"high"\|"critical")*, `test_type` *("web"\|"api"\|"mobile")*, `limit` *(int)*, `offset` *(int)* |
209
209
  | `qcentriq_get_test` | Retrieve full test case definitions, step descriptions, preconditions, latest execution diagnostics, and error stack traces. | `test_case_id` *(uuid, required)*, `project_id` *(uuid)* |
210
210
  | `qcentriq_get_test_groups` | Discover and inspect test groups, member test cases, test counts, and script availability. | `project_id` *(uuid)*, `group_id` *(uuid)*, `limit` *(int)*, `offset` *(int)* |
211
- | `qcentriq_download_script` | Download Playwright Python test script and accompanying fixtures (`conftest.py`). Can optionally save files directly to disk. | `group_id` *(uuid, required)*, `project_id` *(uuid)*, `include_fixtures` *(bool, default true)*, `save_to_disk` *(bool, default false)*, `destination_dir` *(string, default "./tests")* |
212
- | `qcentriq_get_environment` | Retrieve target environment configuration, base URL (`BASE_URL`), and environment variables for local execution. | `project_id` *(uuid)*, `environment_id` *(uuid)*, `environment_name` *(string)*, `include_secrets` *(bool, default false)* |
211
+ | `qcentriq_download_script` | Download Playwright Python test script and accompanying fixtures (`conftest.py`). Can optionally save files directly to disk. | `group_id` *(uuid, required)*, `project_id` *(uuid)*, `include_fixtures` *(bool, default true)*, `save_to_disk` *(bool, default false)*, `destination_dir` *(string, default "./qcentriq_tests")* |
212
+ | `qcentriq_get_environment` | Retrieve target environment configuration, base URL (`BASE_URL`), environment variables, and required secret variable names for local execution. | `project_id` *(uuid)*, `environment_id` *(uuid)*, `environment_name` *(string)* |
213
213
  | `qcentriq_get_test_run_logs` | Fetch execution history, logs, stdout/stderr, and stack traces across single-case and suite runs. | `test_case_id` *(uuid, required)*, `project_id` *(uuid)*, `run_id` *(uuid)*, `status` *("failed"\|"passed"\|"error")*, `latest_only` *(bool)*, `from_date` *(ISO date)*, `to_date` *(ISO date)*, `limit` *(int)*, `offset` *(int)* |
214
214
 
215
+ ### ✍️ Authoring (Cloud REST Endpoints, writes require `test:write`)
216
+
217
+ | Tool Name | Description | Key Arguments |
218
+ | :--- | :--- | :--- |
219
+ | `qcentriq_get_authoring_guide` | Fetch the contract for plans and scripts: the TaskPlan JSON schema, the `${VAR}` environment-variable convention, the `@allure.id` rules, and the available conftest fixtures. Read-only. | — |
220
+ | `qcentriq_create_plan` | Create test groups and test cases from an authored plan. Returns one UUID per created test case. **Writes.** | `plan` *(object, required)*, `project_id` *(uuid)* |
221
+ | `qcentriq_save_group_script` | Validate and store a test script for a group, replacing the existing one. Every case in the group must appear exactly once as `@allure.id('<case_id>')`. **Writes.** | `group_id` *(uuid, required)*, `content` *(string, required)*, `project_id` *(uuid)*, `filename` *(string)*, `fixtures` *(array)*, `expected_updated_at` *(ISO date)* |
222
+
215
223
  ### 💻 Local Client Tools (Executed in Your Local Workspace)
216
224
 
217
225
  | Tool Name | Description | Key Arguments |
218
226
  | :--- | :--- | :--- |
219
- | `qcentriq_get_setup_instructions` | Detect which Python package managers (`uv`, `poetry`, `conda`, `venv`) are installed on the local system and return step-by-step commands to create a virtual environment matching the QCentriq runner container. *(Read-only instructions, never runs commands).* | `preferred_manager` *("uv"\|"poetry"\|"conda"\|"venv")*, `working_dir` *(string)*, `env_name` *(string, default "qcentriq-tests")*, `python_version` *(string, default "3.12")*, `playwright_version` *(string, default "1.56.0")* |
220
- | `qcentriq_save_script` | Save downloaded test scripts and fixtures directly into the local workspace (defaults to `./tests/`) with path traversal guards. | `file_name` *(string, required)*, `content` *(string, required)*, `conftest_content` *(string)*, `destination_dir` *(string, default "./tests")* |
227
+ | `qcentriq_get_setup_instructions` | Detect which Python package managers (`uv`, `poetry`, `conda`, `venv`) are installed on the local system and return step-by-step commands to create a virtual environment matching the QCentriq runner container. If none are installed, the steps start by installing `uv`. *(Read-only instructions, never runs commands).* | `preferred_manager` *("uv"\|"poetry"\|"conda"\|"venv")*, `working_dir` *(string)*, `env_name` *(string, default "qcentriq-tests")*, `python_version` *(string, default "3.12")*, `playwright_version` *(string, default "1.56.0")* |
228
+ | `qcentriq_save_script` | Save downloaded test scripts and fixtures directly into the local workspace (defaults to `./qcentriq_tests/`) with path traversal guards. | `file_name` *(string, required)*, `content` *(string, required)*, `conftest_content` *(string)*, `destination_dir` *(string, default "./qcentriq_tests")* |
221
229
  | `qcentriq_run_local_test` | Run the test locally via `pytest`. Captures stdout, stderr, execution duration, and exit codes without triggering cloud runners. | `file_path` *(string, required)*, `test_name` *(string)*, `headless` *(bool, default true)*, `browser` *("chromium"\|"firefox"\|"webkit", default "chromium")*, `base_url` *(url)*, `env_vars` *(record)*, `extra_args` *(array)*, `timeout_seconds` *(int, default 60)*, `working_dir` *(string)* |
222
230
 
223
231
 
@@ -251,21 +259,21 @@ sequenceDiagram
251
259
  AI->>MCP: qcentriq_download_script(group_id="...", save_to_disk=true)
252
260
  MCP->>API: GET /api/v1/mcp-client/groups/{id}/script
253
261
  API-->>MCP: Script & conftest.py content
254
- MCP->>Local: Write tests/test_login.py & conftest.py
262
+ MCP->>Local: Write qcentriq_tests/test_login.py & conftest.py
255
263
  MCP-->>AI: File paths confirmed
256
264
 
257
265
  AI->>Local: Inspect and update selector in test_login.py
258
- AI->>MCP: qcentriq_run_local_test(file_path="tests/test_login.py", headless=false)
266
+ AI->>MCP: qcentriq_run_local_test(file_path="qcentriq_tests/test_login.py", headless=false)
259
267
  MCP->>Local: Run pytest with Playwright
260
268
  Local-->>MCP: Test result (PASSED)
261
269
  MCP-->>AI: PASSED (exit code 0, 1.42s)
262
- AI->>User: "Fixed selector in tests/test_login.py and verified locally!"
270
+ AI->>User: "Fixed selector in qcentriq_tests/test_login.py and verified locally!"
263
271
  ```
264
272
 
265
273
 
266
274
  ## 🔒 Security & Privacy
267
275
 
268
- - **Safe Network Boundary**: The client MCP server connects **exclusively** to `${baseUrl}/api/v1/mcp-client/` using HTTPS. It only performs read operations against cloud test definitions and diagnostic logs.
276
+ - **Safe Network Boundary**: The client MCP server connects **exclusively** to `${baseUrl}/api/v1/mcp-client/` using HTTPS. Discovery and diagnostics tools only read. The authoring tools `qcentriq_create_plan` and `qcentriq_save_group_script` write to your project (creating test groups/cases and replacing a group's script), and the backend rejects them unless the API key carries the `test:write` scope.
269
277
  - **Client-Side Control**: Test executions, script modifications, and environment setups happen **locally on your machine**. No local code or files are uploaded without your knowledge.
270
278
  - **Zero-Leak Redaction**: The server actively scans and redacts API keys (`qc_...`), bearer tokens, and embedded basic-auth credentials before returning data to the LLM.
271
279
  - **Filesystem Security**: Path traversal attacks (e.g. `../../etc/passwd`) are blocked when writing test scripts and fixtures to disk.