opentestmcp 0.3.0 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +64 -158
  2. package/package.json +10 -8
package/README.md CHANGED
@@ -1,54 +1,16 @@
1
1
  # OpenTest MCP
2
2
 
3
- AI QA engineer for your IDE. Test UI flows and API endpoints from Cursor, Claude Code, or any MCP-compatible coding agent.
3
+ Turn your APIs into MCP tools that coding agents can discover, call, test, and audit.
4
4
 
5
- ## What it does
5
+ OpenTest is agent-first API infrastructure. It lets backend teams expose endpoints to AI coding agents through MCP, add an auth layer around those tools, and see exactly which agent called what.
6
6
 
7
- - **Test UI flows** in your real Chrome browser -- already logged in, no credential hassle
8
- - **Test API endpoints** with assertions and variable chaining
9
- - **Fullstack testing** -- run UI and API tests in parallel
10
- - **Endpoint registry** -- tested endpoints are automatically shared between backend and frontend agents
11
- - **`test_endpoint_by_id`** -- run a saved registry endpoint by UUID from `get_endpoints` (no manual URL assembly); optional `body` for login payloads
12
-
13
- ### Monorepo (Flow backend in this repo)
14
-
15
- See repo root **`AGENTS.md`** for **`ot_live_`** API keys, **`POST /mcp/call-tool`**, the **golden path** (`get_endpoints` → `test_api` or `test_endpoint_by_id`), MCP **Apps** / iframe dashboard, and smoke scripts: [`scripts/smoke-call-tool.mjs`](scripts/smoke-call-tool.mjs), [`scripts/smoke-mcp-flow.mjs`](scripts/smoke-mcp-flow.mjs), [`scripts/smoke-local-endpoint-and-mcp.mjs`](scripts/smoke-local-endpoint-and-mcp.mjs).
16
-
17
- ### Local debug: prove MCP hit your endpoint
18
-
19
- If you want to verify local end-to-end behavior (direct endpoint call + MCP `test_api` call against the same URL), run:
20
-
21
- ```bash
22
- OPENTEST_BACKEND=http://127.0.0.1:8000 \
23
- OPENTEST_API_KEY=ot_live_xxx \
24
- LOGIN_EMAIL=you@example.com \
25
- LOGIN_PASSWORD=your-password \
26
- node opentest-mcp/scripts/smoke-local-endpoint-and-mcp.mjs
27
- ```
28
-
29
- It prints both responses and a `debug_run` id so you can match backend logs for:
30
- 1. `POST /mcp/call-tool` (tool dispatch)
31
- 2. the target endpoint hit by the MCP tool
32
-
33
- ### Real endpoints, not fake servers
34
-
35
- OpenTest tools hit **your real HTTP APIs** (localhost or deployed). The **`preview_login_mock`** name means a **login-shaped form UI** (Postman-style), not a mocked backend: the browser runs `fetch()` to whatever **`api_base` + path** you set. In **Cursor**, the agent opens that URL in the **Agent Browser tab**, runs the same request you would in Postman, and you see **status + body** in the panel. **`test_api`** is the headless path without a browser tab.
36
-
37
- ### Deprecation: `preview_login_mock` / mock-login UI (**~2 days**)
38
-
39
- **Removal target: 2026-04-08.** This login panel and `preview_login_mock` are in a short deprecation window so we can finish testing **hosted OpenTest MCP** (`OPENTEST_BACKEND`, `POST /mcp/call-tool`, **`test_api`** / **`get_endpoints`** without the local lite server). After that date, migrate to the hosted flow and headless tools; do not extend the mock-login stack.
40
-
41
- ## Quick Start
42
-
43
- ### 1. Install in Cursor
44
-
45
- Run this once:
7
+ ## Install
46
8
 
47
9
  ```bash
48
10
  npx opentestmcp install
49
11
  ```
50
12
 
51
- That writes an `opentest` MCP server into `~/.cursor/mcp.json`:
13
+ This writes an `opentest` MCP server into `~/.cursor/mcp.json`:
52
14
 
53
15
  ```json
54
16
  {
@@ -66,7 +28,7 @@ That writes an `opentest` MCP server into `~/.cursor/mcp.json`:
66
28
  }
67
29
  ```
68
30
 
69
- Replace `ot_live_YOUR_API_KEY_HERE` with your OpenTest API key, then restart Cursor or toggle the MCP server off/on.
31
+ Replace `ot_live_YOUR_API_KEY_HERE` with an API key from OpenTest, then restart Cursor or toggle the MCP server off/on.
70
32
 
71
33
  You can also pass the key directly:
72
34
 
@@ -74,21 +36,50 @@ You can also pass the key directly:
74
36
  npx opentestmcp install --api-key ot_live_xxx
75
37
  ```
76
38
 
77
- For a project-local config, run:
39
+ For project-local installation:
78
40
 
79
41
  ```bash
80
42
  npx opentestmcp install --project
81
43
  ```
82
44
 
83
- ### 2. Add to Claude Code
45
+ ## What It Does
84
46
 
85
- ```bash
86
- claude mcp add opentest -- npx -y opentest
47
+ - Converts API endpoints into agent-callable MCP tools.
48
+ - Lets agents test real backend endpoints from the IDE.
49
+ - Syncs endpoint inventory across backend and frontend workflows.
50
+ - Adds API-key auth for OpenTest MCP access.
51
+ - Supports hosted MCPs with consumer tokens for customer-facing agent access.
52
+ - Records per-call observability so teams can audit which agent did what.
53
+
54
+ ## Common Agent Commands
55
+
56
+ After installing, ask your coding agent:
57
+
58
+ ```text
59
+ Use OpenTest to list my endpoints.
60
+ ```
61
+
62
+ ```text
63
+ Use OpenTest to test POST /auth/login.
64
+ ```
65
+
66
+ ```text
67
+ Convert these endpoints into an MCP.
68
+ ```
69
+
70
+ ```text
71
+ Show me the audit log for this hosted MCP.
87
72
  ```
88
73
 
89
- ### 3. Add to Cursor manually
74
+ ## Cursor
90
75
 
91
- Add to `.cursor/mcp.json`:
76
+ The installer targets Cursor by default:
77
+
78
+ ```bash
79
+ npx opentestmcp install
80
+ ```
81
+
82
+ Manual Cursor config:
92
83
 
93
84
  ```json
94
85
  {
@@ -104,127 +95,42 @@ Add to `.cursor/mcp.json`:
104
95
  }
105
96
  ```
106
97
 
107
- ### 4. Authenticate (one time)
108
-
109
- No manual API key needed. Just ask your agent:
110
-
111
- > "Log in to OpenTest"
112
-
113
- This runs the `opentest_login` tool which:
114
- 1. Starts a device authorization flow
115
- 2. Opens a browser link where you approve access
116
- 3. Stores the API key locally at `~/.opentest/credentials.json`
98
+ ## Claude Code
117
99
 
118
- You only need to do this once — credentials persist across sessions. You can also set `OPENTEST_API_KEY` in the env config if you prefer manual key management.
119
-
120
- ### 5. Install the Chrome extension (optional)
121
-
122
- For browser testing, load the extension:
123
-
124
- 1. Open `chrome://extensions`
125
- 2. Enable "Developer mode"
126
- 3. Click "Load unpacked"
127
- 4. Select the `browser/` folder from this package
128
-
129
- ### 6. Start testing
130
-
131
- In your IDE, just ask:
132
-
133
- > "Test the signup flow on localhost:3000"
134
-
135
- > "Test POST /api/users with email test@example.com"
136
-
137
- > "Run fullstack test: signup UI + POST /api/users in parallel"
138
-
139
- ## Inline Visual Results (MCP Apps)
140
-
141
- When you call OpenTest tools from supported clients (Claude, VS Code, Goose), you'll see interactive results rendered directly in the conversation:
142
-
143
- - **test_api** -- Editable API console in the IDE: method, full URL, headers/body JSON, response, inferred schema, and re-send without a new chat message
144
- - **test_endpoint_by_id** -- Same as test_api but keyed by registry UUID from get_endpoints; optional body for login payloads
145
- - **get_endpoints** -- Structured JSON endpoint registry; use `open_endpoints_ui` for the visual dashboard (grouped by tested/needed/draft where the client shows the inline panel)
146
- - **test_flow** -- Step-by-step browser test progress; the MCP server also opens the **starting URL** in your default browser so you can watch the live tab (Hanzi extension). Inline panel shows task + results.
147
- - **import_collection** (Postman / OpenAPI / Bruno / curl) -- Inline panel: generated `.ot.yaml`, per-endpoint request/response schemas when present, dashboard id when saved
148
- - **generate_tests** -- Generated YAML, scenario counts, and save instructions
149
- - **get_coverage** -- Coverage score, top gaps, and summary
150
- - **detect_drift** -- Drift rows with severity and assertion/connection details
151
-
152
- These tools attach `_meta` with a `ui://` resource (`collection-inspector.html`) so the IDE can render the panel (same MCP Apps pattern as `test_api`).
153
-
154
- - **preview_login_mock** — **IDE login / Postman panel** (real `fetch` to your API): set **`api_base`** + **`login_path`**, POST JSON `{ email, password }`, see status/body and inferred shape. Not a mock server—only the form is a small static page. Pair with **`test_api`** for headless-only. Example: `api_base: "http://127.0.0.1:8000"`, `login_path: "/auth/login"`, then **Send login request** or let the agent navigate + click in **Agent Browser**.
155
-
156
- **Cursor — inline browser (recommended):** Enable **Agent Browser** ([Cursor docs: Agent → Browser](https://cursor.com/docs/agent/browser)). After `preview_login_mock`, the tool returns **`mock_login_http_url`**; the agent should use **Browser → navigate** to that URL so the mock login opens **inside Cursor** (tab/pane), not only in external Chrome.
157
-
158
- **If Browser tools do not appear:** Open **Cursor Settings**, enable the **Browser / Agent Browser** integration (enterprise: admins may need to toggle Browser under MCP). Then ask again to navigate to `mock_login_http_url`.
159
-
160
- **Cursor:** `preview_login_mock` does **not** open Safari/Chrome by default (only the **Agent Browser** via `browser_navigate` to `mock_login_http_url`). Set **`OPENTEST_OPEN_MOCK_LOGIN=1`** if you also want the **OS default browser** tab. Or run `npm run open-mock-login` / open `dist/ui/src/ui/mock-login-lite.html` manually after `npm run build`.
161
-
162
- The inline MCP UI panel and Cursor Agent Browser (`browser_navigate` on `ui.url`) are the supported surfaces — the MCP server no longer auto-opens system or Playwright browser windows.
163
-
164
- Click **Re-send from editor** (or **Send**) to re-run API tests without typing a new message.
165
-
166
- ### Supported Clients
167
- - Claude (web + desktop)
168
- - VS Code (GitHub Copilot)
169
- - Goose
170
- - ChatGPT
171
-
172
- ## MCP Tools
173
-
174
- | Tool | What it does |
175
- |------|-------------|
176
- | `opentest_login` | One-time device auth — opens browser link, stores API key locally |
177
- | `opentest_login_complete` | Finishes the login flow after browser approval |
178
- | `opentest_status` | Check authentication status and connection info |
179
- | `opentest_logout` | Clear stored credentials and log out |
180
- | `test_flow` | Test a UI flow in your real Chrome browser |
181
- | `test_api` | Test an API endpoint with assertions |
182
- | `test_fullstack` | Run UI + API tests in parallel |
183
- | `get_endpoints` | Structured JSON inventory of endpoints (registry, sessions, collections) |
184
- | `endpoints_dashboard` | Aggregated endpoint summary from all sources (structured JSON) |
185
- | `open_endpoints_ui` | Open the visual endpoints dashboard in the browser |
186
- | `need_endpoint` | Declare an endpoint the frontend needs |
187
- | `browser_screenshot` | Capture the current browser page |
188
- | `import_api_spec` | Import OpenAPI/Swagger/Postman specs |
189
- | `auto_test` | Auto-discover and test all API endpoints |
100
+ ```bash
101
+ claude mcp add opentest -- npx -y opentestmcp
102
+ ```
190
103
 
191
- ## CLI Options
104
+ ## CLI
192
105
 
193
- ```
194
- npx opentestmcp # Start uses stored credentials or OPENTEST_API_KEY
195
- npx opentestmcp --local # Local only, no dashboard sync
106
+ ```bash
107
+ npx opentestmcp # Start the MCP server
196
108
  npx opentestmcp install # Install Cursor MCP config
109
+ npx opentestmcp install --print # Print config without writing
110
+ npx opentestmcp install --project # Write .cursor/mcp.json in current repo
111
+ npx opentestmcp install --api-key KEY # Install with your OpenTest API key
197
112
  ```
198
113
 
199
- Environment variables:
200
-
201
- - `OPENTEST_API_KEY` -- Manual API key override (skips device auth / stored credentials)
202
- - `OPENTEST_BACKEND` -- Backend URL (default: `https://flow.opentest.live`)
203
- - `OPENTEST_FRONTEND` -- Frontend URL (default: `https://www.flowtest.opentest.live`; use `www` to match the live site and avoid apex/`www` redirect issues in embedded browsers)
204
-
205
- Tool responses and **`endpoints_page_url`** use the SPA entry: `/?agent_session=<uuid>&ot_agent_route=/endpoints` (and similar routes) so the first request always loads `index.html` on static hosting. The Flow app should read **`ot_agent_route`** on boot and run client-side **`navigate()`** to that path.
206
-
207
- ## Dashboard (Optional)
114
+ Options:
208
115
 
209
- Sign up at [flow.opentest.live](https://flow.opentest.live) for:
210
- - Team endpoint registry
211
- - Test history and video recordings
212
- - Jira/Slack integration
213
- - Scheduled test runs
116
+ - `--api-key <key>`: OpenTest API key.
117
+ - `--backend <url>`: OpenTest backend URL. Defaults to `https://flow.opentest.live`.
118
+ - `--frontend <url>`: OpenTest frontend URL. Defaults to `https://www.flowtest.opentest.live`.
119
+ - `--name <name>`: MCP server name. Defaults to `opentest`.
120
+ - `--project`: Write `.cursor/mcp.json` in the current project.
121
+ - `--print`: Print the generated MCP config without writing it.
214
122
 
215
- ```bash
216
- OPENTEST_API_KEY=ot_live_your_api_key npx opentestmcp
217
- ```
123
+ ## Environment Variables
218
124
 
219
- ## Python MCP Server
125
+ - `OPENTEST_API_KEY`: OpenTest API key.
126
+ - `OPENTEST_BACKEND`: OpenTest backend URL.
127
+ - `OPENTEST_FRONTEND`: OpenTest frontend URL.
220
128
 
221
- This package also includes a Python MCP server for API-only testing via `uvx`:
129
+ ## Product
222
130
 
223
- ```bash
224
- uvx opentest-mcp --project-dir ./
225
- ```
131
+ OpenTest helps teams make APIs usable by agents without giving up control. Developers can turn endpoints into MCP servers, hand customers an install snippet or hosted MCP URL, and audit every tool call through OpenTest.
226
132
 
227
- See `pyproject.toml` for Python package details.
133
+ Dashboard: [https://flowtest.opentest.live](https://flowtest.opentest.live)
228
134
 
229
135
  ## License
230
136
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opentestmcp",
3
- "version": "0.3.0",
4
- "description": "AI QA engineer for your IDE test UI flows and API endpoints with inline visual results",
3
+ "version": "0.3.1",
4
+ "description": "Turn APIs into agent-callable MCP tools with auth, testing, and audit logs",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "opentestmcp": "bin/cli.js",
@@ -24,20 +24,22 @@
24
24
  },
25
25
  "keywords": [
26
26
  "mcp",
27
- "testing",
28
- "qa",
29
- "mcp-apps",
30
- "playwright",
31
- "browser-automation",
32
27
  "api-testing",
28
+ "api",
29
+ "agents",
30
+ "agent-tools",
31
+ "audit",
32
+ "auth",
33
+ "hosted-mcp",
33
34
  "cursor",
34
35
  "claude-code"
35
36
  ],
36
37
  "license": "MIT",
37
38
  "repository": {
38
39
  "type": "git",
39
- "url": "git+https://github.com/anthropics/opentest-mcp.git"
40
+ "url": "git+https://github.com/Watcher1223/YC-Hackathon-Backend.git"
40
41
  },
42
+ "homepage": "https://flowtest.opentest.live",
41
43
  "engines": {
42
44
  "node": ">=18"
43
45
  },