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: add automatic HTTP server lifecycle management
- Add start_command option for HTTP transport to spawn server automatically
- Add startup_wait_ms option to control server startup delay (default: 2000ms)
- Server process is automatically killed after probing completes
- Update README with HTTP server lifecycle documentation
- Update action.yml with new configuration options
Copy file name to clipboardExpand all lines: README.md
+33-8Lines changed: 33 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,9 +209,15 @@ When using `configurations`, each object supports:
209
209
|-------|-------------|----------|
210
210
| `name` | Identifier for this configuration (appears in report) | Yes |
211
211
| `transport` | `stdio` or `streamable-http` | No (default: `stdio`) |
212
-
| `start_command` | Server start command | Yes (unless using external server) |
213
-
| `server_url` | URL for HTTP transport | Required if transport is `streamable-http` |
212
+
| `start_command` | Server start command (stdio: spawns process, HTTP: starts server in background) | Yes for stdio, optional for HTTP |
213
+
| `server_url` | URL for HTTP transport | Required for `streamable-http` |
214
+
| `startup_wait_ms` | Milliseconds to wait for HTTP server to start (when using `start_command`) | No (default: 2000) |
215
+
| `pre_test_command` | Command to run before probing (alternative to `start_command` for HTTP) | No |
216
+
| `pre_test_wait_ms` | Milliseconds to wait after `pre_test_command` | No |
217
+
| `post_test_command` | Command to run after probing (cleanup, used with `pre_test_command`) | No |
218
+
| `headers` | HTTP headers for this configuration | No |
214
219
| `env_vars` | Additional environment variables | No |
220
+
| `custom_messages` | Config-specific custom messages | No |
215
221
216
222
## How It Works
217
223
@@ -265,26 +271,45 @@ The default transport communicates with your server via stdin/stdout using JSON-
265
271
266
272
### Streamable HTTP Transport
267
273
268
-
For servers exposing an HTTP endpoint:
274
+
For servers exposing an HTTP endpoint, the action can automatically manage the server lifecycle. Use `start_command` and the action will spawn your server, wait for it to start, probe it, then shut it down:
269
275
270
276
```yaml
271
277
- uses: SamMorrowDrums/mcp-conformance-action@v1
272
278
with:
273
279
setup_node: true
274
280
install_command: npm ci
275
281
build_command: npm run build
276
-
start_command: node dist/http.js
277
-
transport: streamable-http
278
-
server_url: http://localhost:3000/mcp
282
+
configurations: |
283
+
[{
284
+
"name": "http-server",
285
+
"transport": "streamable-http",
286
+
"start_command": "node dist/http.js",
287
+
"server_url": "http://localhost:3000/mcp",
288
+
"startup_wait_ms": 2000
289
+
}]
279
290
```
280
291
281
292
The action will:
282
293
1. Start the server using `start_command`
283
-
2. Poll the endpoint until it responds (up to `server_timeout` seconds)
294
+
2. Wait `startup_wait_ms` (default: 2000ms) for the server to initialize
284
295
3. Send MCP requests via HTTP POST
285
296
4. Terminate the server after tests complete
286
297
287
-
For pre-deployed servers, omit `start_command`:
298
+
For more control, you can use `pre_test_command` and `post_test_command` to manage server lifecycle yourself:
Copy file name to clipboardExpand all lines: action.yml
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,18 @@ inputs:
72
72
required: false
73
73
default: ''
74
74
configurations:
75
-
description: 'JSON array of test configurations for multiple transports. Each object: name, transport, start_command, server_url, env_vars, custom_messages'
75
+
description: |
76
+
JSON array of test configurations for multiple transports/scenarios.
0 commit comments