opentestmcp 0.3.3 → 0.3.4

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.
Files changed (2) hide show
  1. package/dist/server.js +15 -2
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -877,13 +877,16 @@ export function createServer() {
877
877
  });
878
878
  }
879
879
  });
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.", {
880
+ server.tool("mcp_preview", "Pick endpoints matching an intent, generate a tool-schema preview, and automatically share the selected endpoints into the OpenTest Flow Playground session so the user can see/test/deploy them in the UI. 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.", {
881
881
  intent: z.string().describe("Free text like 'auth endpoints' or 'everything related to orders'"),
882
882
  endpoints: z.array(z.any()).describe("Candidate endpoints (typically the confirmed bucket from verify_endpoints_live)"),
883
883
  upstream_base_url: z.string().describe("Base URL the deployed MCP will proxy to"),
884
884
  }, async (args) => {
885
885
  try {
886
- const result = await callBackend("mcp_preview", args);
886
+ const result = await callBackend("mcp_preview", {
887
+ ...args,
888
+ session_id: AGENT_SESSION_ID,
889
+ });
887
890
  const previewData = (result && typeof result === "object" && !Array.isArray(result))
888
891
  ? result
889
892
  : {};
@@ -892,11 +895,21 @@ export function createServer() {
892
895
  const basePayload = result && typeof result === "object" && !Array.isArray(result)
893
896
  ? result
894
897
  : { raw: result };
898
+ const uiPayload = basePayload.ui && typeof basePayload.ui === "object" && !Array.isArray(basePayload.ui)
899
+ ? basePayload.ui
900
+ : {};
895
901
  const withPreviewNav = {
896
902
  ...basePayload,
897
903
  preview_html_path: absolutePath,
898
904
  preview_file_url: fileUrl,
905
+ _agent_session: {
906
+ session_id: typeof basePayload.session_id === "string" ? basePayload.session_id : AGENT_SESSION_ID,
907
+ dashboard_url: typeof uiPayload.url === "string"
908
+ ? uiPayload.url
909
+ : buildAgentDashboardUrl("/endpoints"),
910
+ },
899
911
  _how_to_see_the_ui: [
912
+ "The selected endpoints were automatically shared into the Flow Playground session. Open ui.url or _agent_session.dashboard_url to see them.",
900
913
  "Cursor may not show the embedded MCP app (no new tab is opened by default).",
901
914
  "Run `node opentest-mcp/scripts/open-cursor-preview.mjs` from the repo root; it copies the http:// URL to the clipboard (macOS) and tries cursor:// + vscode:// Simple Browser handlers.",
902
915
  "If no tab appears: Cmd+Shift+P → “Simple Browser: Show” → paste the http://127.0.0.1:… URL from the script output. In the integrated terminal, Cmd+Click that URL may open the in-editor browser.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opentestmcp",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Turn APIs into agent-callable MCP tools with auth, testing, and audit logs",
5
5
  "type": "module",
6
6
  "bin": {