type:servertitle:stringdescription:string (supports Markdown)tags:string[]import:record<string, string> — see Data importsprotocol:http|https|ws| env token (e:MOCK_PROTOCOL/<<e:MOCK_PROTOCOL>>; defaulthttp)port:number (1–65535) | env token (e:MOCK_PORT/<<e:MOCK_PORT>>) — requiredconnection:object — see TLSmode:plain|tls|mtls(defaultplain;httpsimpliestlswhen omitted)cert:string (path relative to the.mmtfile)key:stringclient_ca:string (required whenmodeismtls)
cors:booleandelay:number (global response delay in ms; default0)headers:record<string, string> (applied to all endpoint responses)endpoints:array of endpoint objects — see Endpointsproxy:string (forward unmatched requests to a real backend URL)fallback:object (response when no endpoint matches)status:number (default404)format:json|xml|xmle|text|urlencodedheaders:record<string, string>body:string, object, or array
method:HTTP verb | env token — required unlessreflect: truepath:string — required (supports:paramsegments)name:string (optional label; must be unique within the file)match:object (all listed rules must match)body:record<string, JSONValue> — dotted paths + check/expect operators (nested maps still work)headers:record<string, string> — same operators; header names are case-insensitivequery:record<string, string> — same path/operator rules asbody- When several endpoints share method+path, a successful
matchwins over a bare (no-match) endpoint even if the catch-all is listed first. Among successful filters, file order wins.
status:number (100–599; default200)format:json|xml|xmle|text|urlencodedheaders:record<string, string>body:string, object, or array (supports${url.*},${body.*},${header.*},${query.*},e:,r:,c:— see Tokens)delay:number (per-endpoint delay in ms)reflect:boolean (echo the request back as the response)
path:string — requiredreflect:booleanbody:string, object, or array (initial/connect response)format:json|xml|xmle|text|urlencodedmessages:array of {match?,body?,format?,delay?} (reply rules for incoming messages)
Notes:
- Mock server files are not run directly from the CLI — they start from tests (
runstep) or suites (servers:/ inline items). See CLI. portandprotocolaccept env tokens resolved at runtime from the active environment.- YAML comments (
#) are preserved when you format the file (Format Document).