API

API

The gateway exposes REST endpoints for integrations that don’t use MCP. These endpoints accept JSON requests and return validation decisions — the caller decides what to do with the result.

All endpoints use the same CEL and AI policy engines that the MCP gateway uses. One set of policies, multiple integration surfaces.

Endpoints

EndpointPurpose
POST /api/v1/cli/validateValidate CLI commands before execution
POST /api/v1/action/validateValidate agent actions before execution
POST /api/v1/interceptValidate tool calls from agent hook scripts

Common Headers

All API endpoints accept these headers:

HeaderRequiredDescription
Content-TypeYesMust be application/json
X-Maybe-Dont-Client-IDNoClient identifier for audit attribution
X-Request-IDNoPer-request tracing ID (generated if missing)

Choosing a Validation Surface

The API endpoints listed above are not the only way to validate with Maybe Don’t. The MCP gateway validates inline as a proxy. This table compares all validation surfaces to help you choose the right integration point.

AspectMCP GatewayCLI ValidateAction ValidateIntercept
IntegrationMCP proxy (inline)REST endpointREST endpointREST endpoint
TriggerMCP tool call through gatewayExternal CLI wrapperAgent frameworkAgent hook script
PhasesRequest + response (automatic)Request onlyRequest onlyRequest + response (caller chooses)
Proxies executionYesNoNoNo
Response formatMCP protocolallowed booleanallowed + risk_levelvalid boolean + messages

Server Requirements

API endpoints require the gateway to be running in http or sse mode (not stdio), since they need a network listener.

server:
  type: http
  listen_addr: ":8080"