Stoplight Prism
$ prism Official Low RiskStoplight Prism (@stoplight/prism-cli) turns OpenAPI 2/3 specs or Postman collections into a local mock HTTP server (prism mock) or contract-validating reverse proxy (prism proxy). Because both subcommands run long-lived HTTP servers, agents should spawn them in the background and probe them with curl or test suites.
npm install -g @stoplight/prism-cli Spawning a local OpenAPI mock server with prism mock lets integration tests hit real HTTP endpoints directly without MCP.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive flag configuration (-p, --dynamic, -h), though both mock and proxy are blocking server processes that emit plain-text request logs rather than structured JSON summaries.
- Server processes block foreground execution until killed
- Plain-text HTTP validation log lines
prism mock is purely read-only on local specs; prism proxy forwards requests to the specified upstream URL so target selection matters.
- Zero spec file writes;
proxyforwards live traffic to upstream
Cross-platform via npm or npx @stoplight/prism-cli (plus Docker images).
- Available via
npmandnpx
Quickly spins up realistic contract mocks (--dynamic) or catches backend contract drift via prism proxy.
- Supports both static examples and
--dynamicJSON Schema Faker responses
Official Stoplight repository (stoplightio/prism) under Apache-2.0.
- Official Stoplight GitHub organization
Well-documented CLI flags and HTTP mock/proxy behavior at docs.stoplight.io/docs/prism.
- Official Stoplight documentation
Security, Auth & Guardrails
None required; operates on local OpenAPI specs (or forwards caller headers in proxy mode).
100% free and Apache-2.0 open-source.
# Stoplight Prism Agent Rules - `prism mock` and `prism proxy` are blocking HTTP servers—always run them in the background or a daemon process. - Do not point `prism proxy` at production APIs with mutating requests; point it at local/staging upstreams.
Agent-Ready Command Recipes
Safe Read-Only Queries
prism mock -p 4010 --dynamic openapi.yaml
Serves schema-generated dynamic responses from openapi.yaml on localhost without touching any files.
Controlled Writes & Previews
prism proxy -p 5000 openapi.yaml http://localhost:3000
Proxies requests to http://localhost:3000 and logs OpenAPI request/response contract violations.
Strengths for Agents
- + Instant OpenAPI mock server (
--dynamicor spec examples) with zero code required. - +
prism proxyvalidates both incoming requests and upstream responses against the OpenAPI contract. - + Available immediately via
npx @stoplight/prism-cli.
Caveats & Pitfalls
- ! Both
mockandproxyare long-running servers that hang foreground agent commands if not daemonized. - !
prism proxyforwards live HTTP calls to the target upstream—never point it at production with mutating tests.