# PlanetScale Emulator (service host) Create an instance: curl -s -X POST https://planetscale.emulators.dev/_emulate/instances # Hosted deployments create instances lazily when the returned URL is first used. The instance URL is a capability: anyone who has it can read and modify the instance, so save the returned URLs. Never store real secrets in an emulator. # The server generates an unguessable name. An optional {"instance":""} body adds a readable prefix. Then use the returned providerBaseUrl / controlBaseUrl. Example below uses a sample instance. # PlanetScale Emulator Stateful PlanetScale emulator: the Doorkeeper OAuth authorization server with Dynamic Client Registration, PKCE, and literal HTTP Basic client authentication, plus the hosted MCP server at /mcp/planetscale with read-only organization, database, and branch tools over seeded state. Provider base URL: https://planetscale.your-instance.emulators.dev Control base URL: https://planetscale.your-instance.emulators.dev/_emulate Supported surfaces: - PlanetScale OAuth (Doorkeeper): partial at /oauth - PlanetScale MCP server: partial at /mcp/planetscale - OAuth consent page: supported at /oauth/authorize Control endpoints: - https://planetscale.your-instance.emulators.dev/_emulate/manifest - https://planetscale.your-instance.emulators.dev/_emulate/coverage - https://planetscale.your-instance.emulators.dev/_emulate/connections - https://planetscale.your-instance.emulators.dev/_emulate/state - https://planetscale.your-instance.emulators.dev/_emulate/ledger - https://planetscale.your-instance.emulators.dev/_emulate/faults - POST https://planetscale.your-instance.emulators.dev/_emulate/credentials - POST https://planetscale.your-instance.emulators.dev/_emulate/seed - POST https://planetscale.your-instance.emulators.dev/_emulate/reset Fault injection: Arm a one-shot provider failure with a glob pathPattern, then inspect /ledger for faulted: true. curl -s -X POST https://planetscale.your-instance.emulators.dev/_emulate/faults \ -H "content-type: application/json" \ -d '{"match":{"method":"GET","pathPattern":"/v1/*"},"response":{"status":503,"body":{"error":"temporary"}}}' Connect: ## MCP endpoint https://planetscale.your-instance.emulators.dev/mcp/planetscale ## Register a client curl -X POST https://planetscale.your-instance.emulators.dev/oauth/registration \ -H 'content-type: application/json' \ -d '{"client_name":"My app","redirect_uris":["http://localhost:3000/callback"]}' ## Base URL (env) PLANETSCALE_BASE_URL=https://planetscale.your-instance.emulators.dev ## Create a credential curl -s -X POST https://planetscale.your-instance.emulators.dev/_emulate/credentials \ -H "content-type: application/json" \ -d '{"type":"dynamic-client-registration"}' ## Inspect requests curl -s https://planetscale.your-instance.emulators.dev/_emulate/ledger