You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mcp): bulk case creation and template selection/listing (#454)
Add two MCP case-authoring capabilities, reusing the existing transactional
import service rather than duplicating case-creation logic:
- testplanit_cases_create_many creates many cases in one call via a new
app/api/projects/[projectId]/cases/bulk-create route that reuses
persistGeneratedTestCases (one transaction per folder/state group) and
reports per-case success/failure so partial failures are visible. The route
authenticates by session or API token with read-only-token enforcement,
mirroring the ZenStack RPC handler the MCP server already calls.
- testplanit_templates_list returns a project's enabled templates with the
case fields each defines.
- cases_create and cases_create_many accept an optional templateId (default:
the project's first enabled template). Custom fields are resolved and
validated against the chosen template — and the case's own template on
update — so an out-of-template field returns a clear error instead of being
silently dropped.
Consolidate to a single bulk-create path by removing the orphaned legacy
app/api/repository/import-generated-test-cases route (no product callers;
session-only, non-transactional). Its e2e is repointed at the new endpoint and
its audit-coverage and OpenAPI references are dropped.
Update the MCP docs (overview, configuration, prompts) and the package README
for the new tools and the 44-tool count.
Copy file name to clipboardExpand all lines: docs/docs/sdk/mcp-configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ Tokens with both scopes set show a **Read-only** badge and an **Agent token** ba
86
86
87
87
## Tool catalog
88
88
89
-
The full tool catalog — 28 tools across cases, folders, tags, projects, test runs, results, sessions, findings, code repositories, issues, and repository case links — lives in the [npm package README](https://www.npmjs.com/package/@testplanit/mcp-server). Each tool entry shows its input parameters, output shape, and (where applicable) which killer-app composition it participates in.
89
+
The full tool catalog — 44 tools across cases, templates, folders, tags, projects, test runs, results, sessions, findings, milestones, code repositories, issues, and repository case links — lives in the [npm package README](https://www.npmjs.com/package/@testplanit/mcp-server). Each tool entry shows its input parameters, output shape, and (where applicable) which killer-app composition it participates in.
Copy file name to clipboardExpand all lines: docs/docs/sdk/mcp-overview.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,8 @@ The TestPlanIt MCP server lets AI agents — Claude Desktop, Cursor, custom MCP-
10
10
11
11
## What an agent can ask
12
12
13
-
- List, fetch, create, update, and soft-delete test cases (with steps, custom fields, tags, folder breadcrumb, linked issues, and linked automated tests inline)
13
+
- List, fetch, create (one at a time or many in a single bulk call), update, and soft-delete test cases (with steps, custom fields, tags, folder breadcrumb, linked issues, and linked automated tests inline)
14
+
- List a project's templates and the case fields each defines, and choose which template a new case uses — custom fields are validated against that template
14
15
- List and create test runs, add cases to existing runs, submit test results, and update run state
15
16
- List sessions, session results, and session findings — the exploratory testing surface — and create or update sessions
16
17
- Create and update milestones, mark them started or complete, and list milestone progress with pooled status rollups inline
@@ -19,7 +20,7 @@ The TestPlanIt MCP server lets AI agents — Claude Desktop, Cursor, custom MCP-
19
20
- List code repositories configured in a project (with credentials never returned)
20
21
- List folders and tags scoped to a project, with usage counts and tree relationships preserved
21
22
22
-
See the [npm package README](https://www.npmjs.com/package/@testplanit/mcp-server) for the full tool reference, including request/response schemas for all 42 tools.
23
+
See the [npm package README](https://www.npmjs.com/package/@testplanit/mcp-server) for the full tool reference, including request/response schemas for all 44 tools.
Copy file name to clipboardExpand all lines: docs/docs/sdk/mcp-prompts.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,6 +165,33 @@ Mark the login test case as passed in run 5.
165
165
}
166
166
```
167
167
168
+
## "Create these test cases from our checkout spec"
169
+
170
+
```text
171
+
Create these 20 test cases in project Acme under the "Checkout" folder using the
172
+
"Regression" template — each has steps and a Priority.
173
+
```
174
+
175
+
**Tool calls (2–3):**
176
+
177
+
1. (Optional) `testplanit_templates_list({ projectId: <P> })` → lists the project's enabled templates, each with the case fields it defines. The agent picks the right `templateId` and sees which custom fields (e.g. `Priority`) that template accepts.
3.`testplanit_cases_create_many({ projectId: <P>, folderId: <id>, templateId: <id>, cases: [ { name, steps, tags, customFields }, ... ] })` → creates all of them in one call. Each case may override `folderId`/`stateName`; `templateId` defaults to the project's first enabled template when omitted.
180
+
181
+
**What comes back:** a per-case results array so partial failures are visible — each entry is either a success (with the new `caseId`) or an error (with a message). A custom field that isn't part of the chosen template is reported as a per-case error rather than silently dropped.
Copy file name to clipboardExpand all lines: packages/mcp-server/README.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,10 +92,17 @@ Your MCP client discovers each tool's full parameters automatically, so the list
92
92
| --- | --- |
93
93
|`testplanit_cases_list`| List and filter test cases in a project (by folder, tag, name, state, custom field, linked issue, automation, and more). |
94
94
|`testplanit_cases_get`| Get a single test case with its fields and steps. |
95
-
|`testplanit_cases_create`| Create a test case. |
96
-
|`testplanit_cases_update`| Update a test case. |
95
+
|`testplanit_cases_create`| Create a test case. Optionally pass `templateId` to choose a template (defaults to the project's first enabled template); custom fields are validated against the chosen template. |
96
+
|`testplanit_cases_create_many`| Create many test cases in one call — far faster than per-case creates. Each case takes the same fields as a single create plus optional per-case `folderId`/`stateName`; returns a per-case success/failure result so partial failures are visible. |
97
+
|`testplanit_cases_update`| Update a test case. Custom fields are validated against the case's template. |
97
98
|`testplanit_cases_delete`| Delete a test case. |
98
99
100
+
### Templates
101
+
102
+
| Tool | Description |
103
+
| --- | --- |
104
+
|`testplanit_templates_list`| List a project's enabled templates, each with the case fields it defines (display name, system name, type, required) — use it to pick a `templateId` for case creation and to learn which custom fields a template accepts. |
0 commit comments