common-qa-mcp 0.1.0 → 0.1.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
@@ -1,36 +1,53 @@
1
1
  # Common QA MCP
2
2
 
3
- One **product-neutral MCP** that AI clients (Claude Code, Cursor, Windsurf, …) connect to with a
4
- single URL + token, and which **routes** test-case-lifecycle requests to the right product:
3
+ One **product-neutral MCP** that AI clients (Claude Code, Cursor, Windsurf, VS Code, Codex, …)
4
+ connect to with a single URL + token, and which **routes** the whole test-case lifecycle —
5
+ discover, author, **record**, run, triage — to the right product:
5
6
 
6
- - **Walnut** — directly over its REST API (`WalnutAdapter`).
7
+ - **Walnut** — over the **Walnut agent's MCP** (`/mcp`, for the full surface **including browser +
8
+ mainframe recording**) or directly over the **backend REST API** (lifecycle only, no recording).
7
9
  - **SimplifyQA** — over the SimplifyQA agent's own MCP (`SimplifyQaAdapter`, an MCP client).
8
10
 
9
11
  The client sees **one tool vocabulary** and **one neutral data model** regardless of product.
10
12
 
11
13
  ```
12
- AI client ──MCP (url + token)──▶ COMMON QA MCP ──▶ Walnut backend (REST)
13
- └────────▶ SimplifyQA agent MCP ──▶ SQA backend
14
+ ┌─▶ Walnut agent /mcp ─▶ Walnut backend (+ web & mainframe recording)
15
+ AI client ──MCP (url+token)──▶ COMMON QA MCP ─┤─▶ Walnut backend REST (lifecycle only)
16
+ └─▶ SimplifyQA agent /mcp ─▶ SQA backend
14
17
  ```
15
18
 
16
- ## What's here
17
- This repo is the **standalone gateway** build of the neutral core: the API lifecycle surface —
18
- connection, projects, discovery, drafts, validation and save-orchestration. Files under `src/`:
19
+ ## What you can do
20
+ - **Discover** — projects, test cases, suites, and user stories.
21
+ - **Author manual test cases** — draft plain-prose steps that cover a story's acceptance criteria
22
+ (`tc_draft_*`), then promote them to automated in place.
23
+ - **Record automated test cases** — delegate a goal to a technology sub-agent that drives a **real
24
+ browser** (`web`) or a **TN3270 mainframe terminal** (`mainframe`), capturing real
25
+ locators/fields and assertions. _(Requires the Walnut agent — see below. `android` / `db` are
26
+ declared but not built yet.)_
27
+ - **Run & triage** — execute a test case or a suite **local or cloud**, poll status, and report the
28
+ failing step + report link.
29
+ - **Modify** — edit an existing test case's steps (loop / if-else / nested / add / remove / move)
30
+ without re-recording the structure.
19
31
 
20
- - `adapters/` — the `ProviderAdapter` contract + `walnut/` (REST) and `simplifyqa/` (remote MCP) drivers, and the adapter factory.
21
- - `connection.ts` / `requestConnection.ts` — the runtime connection (URL + token, in-memory, validate-before-adopt) and the header/URL-based config connection.
22
- - `domain/` — the neutral data model + validation.
23
- - `drafts/` — the edit-before-save draft store.
24
- - `tools/` — the client-facing tools: `connection.tools` (qa_connect / qa_switch_project / …), `discovery.tools` (list_projects / tc_list / tc_get), `testcase.tools` (tc_draft_*), plus `markdown` / `schemas`.
25
- - `server.ts` — assembles the MCP (`buildServer`).
26
- - `mount.ts` / `httpMain.ts` — the standalone Streamable-HTTP `/mcp` gateway + its entrypoint.
27
- - `vendor/` — three self-contained files vendored from the Walnut agent (`logger`, `actionSignatures`, `bridge`).
32
+ ## How recording works (and what it needs)
33
+ Recording can't run inside an `npx` gateway — `web` needs a real browser/Electron window and
34
+ `mainframe` needs an HLLAPI terminal attachment. That engine lives in the **Walnut agent**, which
35
+ mounts this same core with the extra deps injected. So:
28
36
 
29
- > **Not here:** browser recording + the live editor. Those need a real browser/Electron window, so
30
- > they stay in the **Walnut agent**, which mounts this same core with those extra deps injected.
37
+ - Point **`QA_MCP_URL` at the Walnut agent's `/mcp`** (default `http://127.0.0.1:4050/mcp`) and the
38
+ gateway **relays** the recording tools to it — you get the full surface.
39
+ - Point it at the **backend REST URL** for a zero-agent gateway: discovery / drafts / save / run,
40
+ **no recording**.
41
+
42
+ Recording is **non-blocking and two-step**: `web` (or `mainframe`) **starts** a session, returns a
43
+ `sessionId` immediately, and opens a live window; you then **poll** `web_status` (or
44
+ `mainframe_status`) until `status` is `"done"`, which returns an **unsaved draft**. Nothing is
45
+ persisted until you explicitly save. **Mainframe** additionally needs the agent on **Windows** with
46
+ `WINDOWS_MCP_ENABLED` and a 3270 emulator (Quick3270 `.ecf` / IBM PCOMM `.ws` / Micro Focus
47
+ Reflection `.rd3x`).
31
48
 
32
49
  ## Install
33
- Nothing to install — AI clients launch it over stdio with `npx`. Requires Node >= 20.
50
+ Nothing to build or clone — AI clients launch it over stdio with `npx`. Requires **Node ≥ 20**.
34
51
 
35
52
  `.mcp.json` (Claude Code, Cursor, Windsurf, …):
36
53
  ```json
@@ -40,21 +57,37 @@ Nothing to install — AI clients launch it over stdio with `npx`. Requires Node
40
57
  "command": "npx",
41
58
  "args": ["-y", "common-qa-mcp"],
42
59
  "env": {
43
- "QA_MCP_URL": "http://localhost:8080",
60
+ "QA_MCP_URL": "http://127.0.0.1:4050/mcp",
44
61
  "QA_MCP_TOKEN": "<token>",
45
- "QA_MCP_PROJECT_ID": "<projectId>"
62
+ "QA_MCP_PRODUCT": "walnut"
46
63
  }
47
64
  }
48
65
  }
49
66
  }
50
67
  ```
68
+ - `QA_MCP_URL` — the Walnut **agent** (`…:4050/mcp`) for the full surface incl. recording, or the
69
+ **backend REST** URL for lifecycle only.
70
+ - `QA_MCP_TOKEN` — your **raw** auth token (JWT, **no** `Bearer` prefix).
71
+ - `QA_MCP_PRODUCT` — `walnut` (default) or `simplifyqa`.
72
+ - `QA_MCP_PROJECT_ID` — **optional**; add it to pin a default project, or omit it and the agent asks
73
+ which project to use (then `qa_switch_project` changes it anytime).
74
+
51
75
  With no `QA_MCP_*` set it starts in **offline** mode — draft authoring only, zero network — and you
52
76
  can connect from chat with `qa_connect`.
53
77
 
54
- Install the Walnut QA agent (persona + tool guidance) into your project:
78
+ Install the QA agent (persona + tool guidance) into your project:
55
79
  ```bash
56
80
  npx common-qa-mcp init-agents --loop=claude # claude | cursor | windsurf | vscode | codex | all
57
81
  ```
82
+ The installed agent asks which **technology** (web / mainframe / android / db) and **manual or
83
+ automated** before recording, and **never saves on its own** — it persists a test case only when you
84
+ explicitly tell it to.
85
+
86
+ ## Use it
87
+ Reload your client, then drive it in plain language:
88
+ - _"List my projects"_ → _"switch to project X"_
89
+ - _"Record a login test on web"_ → answer the setup questions → review the draft → _"save this test case"_
90
+ - _"Run TC_123 on cloud"_ · _"show me the login stories"_ · _"add a loop around steps 3–5 of TC_42"_
58
91
 
59
92
  ## Develop
60
93
  ```bash
@@ -66,7 +99,7 @@ npm run start:http # HTTP gateway on http://127.0.0.1:4060/mcp (override wit
66
99
  npm run dev:http # HTTP gateway via tsx watch
67
100
  ```
68
101
 
69
- ## Connect an AI client over HTTP (config-based, no chat)
102
+ ## Connect over HTTP (config-based, no chat)
70
103
  `.mcp.json`:
71
104
  ```json
72
105
  {
@@ -77,8 +110,7 @@ npm run dev:http # HTTP gateway via tsx watch
77
110
  "headers": {
78
111
  "Authorization": "Bearer <token>",
79
112
  "x-qa-product": "walnut",
80
- "x-qa-url": "http://localhost:8080",
81
- "x-project-id": "<projectId>"
113
+ "x-qa-url": "http://127.0.0.1:4050/mcp"
82
114
  }
83
115
  }
84
116
  }
@@ -89,6 +121,28 @@ there instead. Everything after `Authorization` may also be passed as `?query` p
89
121
  back to the `QA_MCP_*` environment. At runtime, `qa_connect` / `qa_switch_project` override the
90
122
  connection without re-entering credentials.
91
123
 
124
+ ## What's inside (for contributors)
125
+ The **standalone gateway** build of the neutral core — the lifecycle surface plus the recording
126
+ **relay**. Files under `src/`:
127
+
128
+ - `adapters/` — the `ProviderAdapter` contract + `walnut/` (REST), `remoteMcp/` (relays to the
129
+ Walnut agent / SimplifyQA over MCP), and the adapter factory.
130
+ - `connection.ts` / `requestConnection.ts` — the runtime connection (URL + token, in-memory,
131
+ validate-before-adopt) and the header/URL-based config connection.
132
+ - `domain/` — the neutral data model + validation.
133
+ - `drafts/` — the edit-before-save draft store.
134
+ - `tools/` — the client-facing tools: `connection.tools` (`qa_connect` / `qa_switch_project` / …),
135
+ `discovery.tools` (`list_projects` / `tc_list` / `tc_get`), `testcase.tools` (`tc_draft_*`),
136
+ `recording.tools` (relayed `web` / `mainframe` + their status polls), `run.tools`, plus
137
+ `markdown` / `schemas`.
138
+ - `server.ts` — assembles the MCP (`buildServer`).
139
+ - `mount.ts` / `httpMain.ts` — the standalone Streamable-HTTP `/mcp` gateway + its entrypoint.
140
+ - `vendor/` — self-contained files vendored from the Walnut agent (`logger`, `actionSignatures`, `bridge`).
141
+
142
+ > The browser/Electron recording **engine** and the live editor themselves stay in the **Walnut
143
+ > agent** (they need a real window). This gateway **relays** those tools whenever `QA_MCP_URL`
144
+ > targets the agent's `/mcp`.
145
+
92
146
  ## SimplifyQA integration
93
147
  The SimplifyQA agent implements its own MCP exposing the provider-operation tools this gateway calls
94
148
  (`info`, `list_projects`, `list_testcases`, `get_testcase`, `create_testcase`, `update_testcase`,
package/dist/server.js CHANGED
@@ -9,7 +9,7 @@ import { ok, err } from './mcpResult.js';
9
9
  export { ok, err };
10
10
  const OFFLINE_TOOLS = ['actions_catalog', 'tc_draft_create', 'tc_draft_update', 'tc_draft_get', 'tc_draft_discard', 'tc_draft_open'];
11
11
  export function buildServer(deps) {
12
- const server = new McpServer({ name: 'common-qa-mcp', version: '0.1.0' });
12
+ const server = new McpServer({ name: 'common-qa-mcp', version: '0.1.1' });
13
13
  const drafts = deps.drafts ?? new DraftStore();
14
14
  server.registerTool('project_info', {
15
15
  description: 'Validate the configured connection and return provider, org/project and entity counts.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "common-qa-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Common QA MCP — one product-neutral MCP that routes test-case lifecycle requests to Walnut or SimplifyQA for any AI client. Launch over stdio via npx; install the Walnut QA agent with `init-agents`.",
6
6
  "bin": {