test-server¶
Use test-server for quick MCP smoke checks against a running server.
Command¶
openapi-to-mcp test-server [OPTIONS]
Options¶
| Option | Required | Default | Meaning |
|---|---|---|---|
--transport |
Yes | None | streamable-http or stdio |
--host |
No | localhost |
Hostname for streamable-http |
--port |
No | 8080 |
Port for streamable-http |
--mcp-endpoint |
No | /mcp |
HTTP MCP endpoint path |
--list-tools |
No | Off | Send a tools/list request |
--server-cmd |
No | None | Server startup command for stdio |
--tool-name |
No | None | Tool name for tools/call |
--tool-args |
No | None | JSON object string for tool arguments |
--env-source |
No | None | stdio env values as JSON or file path |
Modes¶
List tools¶
openapi-to-mcp test-server \
--transport streamable-http \
--host 127.0.0.1 \
--port 8080 \
--mcp-endpoint /mcp \
--list-tools
Call a tool over streamable HTTP¶
openapi-to-mcp test-server \
--transport streamable-http \
--host 127.0.0.1 \
--port 8080 \
--mcp-endpoint /mcp \
--tool-name getPetById \
--tool-args '{"petId":1}'
List tools over stdio¶
openapi-to-mcp test-server \
--transport stdio \
--server-cmd "node ./generated-server/build/index.js" \
--env-source ./generated-server/.env \
--list-tools
Call a tool over stdio with inline env JSON¶
openapi-to-mcp test-server \
--transport stdio \
--server-cmd "node ./generated-server/build/index.js" \
--env-source '{"TARGET_API_BASE_URL":"https://example.com/api"}' \
--tool-name getPetById \
--tool-args '{"petId":1}'
Validation rules¶
--server-cmdis required forstdio--mcp-endpointmust start with/--tool-argsrequires--tool-name- you must choose
--list-toolsor--tool-name
Output behavior¶
test-server prints a formatted JSON panel with the raw response payload returned by the transport adapter.
For quick local smoke tests, this is intentionally low-friction rather than highly normalized.
For Streamable HTTP, the command follows only same-origin 307 or 308 redirects, plus
an upgrade from HTTP port 80 to HTTPS port 443 on the same host. Other redirects fail
before the request or session identifier is forwarded.
--env-source formats¶
Accepted values:
- a JSON string
- a path to a
.jsonfile - a path to a
.envfile
When to use MCP Inspector instead¶
Use test-server for automation or quick terminal checks.
Use the MCP Inspector guide when you want a GUI for exploring tools and sending requests interactively.