opentestmcp 0.3.1 → 0.3.3
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 +2 -2
- package/bin/cli.js +2 -2
- package/dist/server.js +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ This writes an `opentest` MCP server into `~/.cursor/mcp.json`:
|
|
|
28
28
|
}
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
Replace `ot_live_YOUR_API_KEY_HERE` with an API key from OpenTest, then restart Cursor or toggle the MCP server off/on.
|
|
31
|
+
Replace `ot_live_YOUR_API_KEY_HERE` with an API key from [OpenTest settings](https://www.flowtest.opentest.live/settings/), then restart Cursor or toggle the MCP server off/on.
|
|
32
32
|
|
|
33
33
|
You can also pass the key directly:
|
|
34
34
|
|
|
@@ -56,7 +56,7 @@ npx opentestmcp install --project
|
|
|
56
56
|
After installing, ask your coding agent:
|
|
57
57
|
|
|
58
58
|
```text
|
|
59
|
-
Use OpenTest to
|
|
59
|
+
Use the OpenTest MCP to convert my login endpoint into an MCP tool.
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
```text
|
package/bin/cli.js
CHANGED
|
@@ -122,9 +122,9 @@ Server name: ${serverName}
|
|
|
122
122
|
Backend: ${config.mcpServers[serverName].env.OPENTEST_BACKEND}
|
|
123
123
|
|
|
124
124
|
Next steps:
|
|
125
|
-
1. ${usedPlaceholder ? `Replace ${API_KEY_PLACEHOLDER} with your OpenTest API key in ${configPath}
|
|
125
|
+
1. ${usedPlaceholder ? `Replace ${API_KEY_PLACEHOLDER} with your OpenTest API key in ${configPath}. Find or create one at https://www.flowtest.opentest.live/settings/.` : "Your OpenTest API key was written to the MCP config."}
|
|
126
126
|
2. Restart Cursor or toggle the OpenTest MCP server off/on.
|
|
127
|
-
3. Ask your agent: "Use OpenTest to
|
|
127
|
+
3. Ask your agent: "Use the OpenTest MCP to convert my login endpoint into an MCP tool." Then open https://www.flowtest.opentest.live/ to see the session and generated MCP.
|
|
128
128
|
`);
|
|
129
129
|
}
|
|
130
130
|
|
package/dist/server.js
CHANGED
|
@@ -857,6 +857,26 @@ export function createServer() {
|
|
|
857
857
|
});
|
|
858
858
|
}
|
|
859
859
|
});
|
|
860
|
+
server.tool("share_endpoints_with_ui", "Push discovered or verified endpoints into the OpenTest Flow Playground so the user can see them, test them, and convert selected endpoints into hosted MCP tools. Use this after verify_endpoints_live or when the user explicitly asks to stream endpoints to the UI.", {
|
|
861
|
+
endpoints: z.array(z.any()).describe("Endpoints to push. Each item should include method plus path/path_template/url; include schemas when available."),
|
|
862
|
+
upstream_base_url: z.string().optional().describe("Default upstream base URL for testing and MCP generation, e.g. http://127.0.0.1:8000 or https://api.example.com"),
|
|
863
|
+
intent: z.string().optional().describe("Short label for the session, e.g. 'Login endpoint' or 'Auth endpoints'"),
|
|
864
|
+
session_id: z.string().optional().describe("Optional existing session id to append/replace. Omit to create a new session."),
|
|
865
|
+
}, async (args) => {
|
|
866
|
+
try {
|
|
867
|
+
const result = await callBackend("share_endpoints_with_ui", args);
|
|
868
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
869
|
+
}
|
|
870
|
+
catch (e) {
|
|
871
|
+
return toolError(e.message, inferErrorCode(e.message), {
|
|
872
|
+
next_actions: [
|
|
873
|
+
"Make sure OPENTEST_API_KEY is set or run opentest_login, then retry.",
|
|
874
|
+
"If the Flow UI opens but is empty, confirm OPENTEST_BACKEND points to the same backend that received this push.",
|
|
875
|
+
],
|
|
876
|
+
related_tools: ["verify_endpoints_live", "mcp_preview", "opentest_status"],
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
});
|
|
860
880
|
server.tool("mcp_preview", "Pick endpoints matching an intent and generate a tool-schema preview. Also writes the same two-pane HTML to opentest-mcp/mcp-preview-last.html and returns preview_file_url — use Cursor Simple Browser or `node opentest-mcp/scripts/open-cursor-preview.mjs` if the inline MCP app panel does not appear. LLM selection when OPENAI_API_KEY is set on the backend; else keyword match. Does NOT write to the DB.", {
|
|
861
881
|
intent: z.string().describe("Free text like 'auth endpoints' or 'everything related to orders'"),
|
|
862
882
|
endpoints: z.array(z.any()).describe("Candidate endpoints (typically the confirmed bucket from verify_endpoints_live)"),
|