-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Bug Report
Package: @smartbear/mcp v0.15.0
Tool: zephyr_create_test_script
Affects: All POST calls to /testcases/{key}/testscript
Steps to Reproduce
- Configure
@smartbear/mcpwith a validZEPHYR_API_TOKEN - Call
zephyr_create_test_scriptwith a valid test case key,type: "bdd", and a Gherkin step text - Observe the error
Expected Behavior
The test script is created and the tool returns a success response.
Actual Behavior
Error: fetch failed
The error occurs consistently on every attempt. Note: zephyr_get_test_script (GET on the same endpoint) works fine — only the POST call fails.
Root Cause (suspected)
Looking at src/zephyr/tool/test-case/create-test-script.ts, the post() call has no try-catch. Any exception (network error, API validation error, etc.) propagates uncaught → the MCP runtime catches it as a generic "fetch failed" with no further detail.
Additionally, the tool returns content: [] on success, so even a successful call discards the API response body — making debugging impossible from the client side.
Workaround
A direct HTTP call to the same endpoint works correctly:
import json, urllib.request
token = "<ZEPHYR_API_TOKEN>"
payload = json.dumps({"type": "bdd", "text": "Given ...\nWhen ...\nThen ..."}).encode()
req = urllib.request.Request(
"https://api.zephyrscale.smartbear.com/v2/testcases/PROJ-TXXX/testscript",
data=payload,
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
method="POST"
)
with urllib.request.urlopen(req) as r:
print(r.status, r.read().decode())Environment
@smartbear/mcpversion: 0.15.0- Platform: Linux
- MCP client: Claude Code + Windsurf (Codeium)