This repository is forked from Vercel Labs' emulate project. Useful Software
Co maintains this fork to support deployable emulator surfaces and product
testing flows for our own development and agent-driven use cases.
Local drop-in replacement services for CI and no-network sandboxes. Fully stateful, production-fidelity API emulation. Not mocks.
npx emulateAll services start with sensible defaults. No config file needed:
- Vercel on
http://localhost:4000 - GitHub on
http://localhost:4001(REST, GraphQL, OAuth, and MCP) - Google on
http://localhost:4002 - Slack on
http://localhost:4003 - Apple on
http://localhost:4004 - Microsoft on
http://localhost:4005 - Okta on
http://localhost:4006 - AWS on
http://localhost:4007 - Resend on
http://localhost:4008 - Stripe on
http://localhost:4009 - MongoDB Atlas on
http://localhost:4010 - Clerk on
http://localhost:4011 - Spotify on
http://localhost:4012 - X on
http://localhost:4013(OAuth 2.0, users, Posts, direct messages, DM media, webhooks with X Activity API DM events, X rate limits) - WorkOS on
http://localhost:4014(AuthKit, user directory, organizations, organization domains, Vault, and OAuth) - Autumn on
http://localhost:4015 - PostHog on
http://localhost:4016 - MCP on
http://localhost:4017 - GitLab on
http://localhost:4018(full real GraphQL schema) - Context on
http://localhost:4019(company lookup by work email domain) - PlanetScale on
http://localhost:4020(Doorkeeper OAuth with DCR, MCP server at/mcp/planetscale) - Miro on
http://localhost:4021(MCP server at/, OAuth with DCR and HS256 ID tokens) - OpenAI on
http://localhost:4022(Responses API and Chat Completions for text, API keys, deterministic answers) - Zapier MCP on
http://localhost:4023(managed-mode MCP server at/api/v1/connect, OAuth per person, per-account tool lists of any size)
Every running service also exposes a public control plane under /_emulate:
| Route | Purpose |
|---|---|
GET /_emulate |
Human-readable landing page for the service instance |
GET /_emulate/manifest |
Machine-readable service manifest, including supported surfaces, auth capabilities, spec coverage, and resolved connection snippets |
GET /_emulate/quickstart |
Plain-text instructions for humans and agents |
GET /_emulate/specs |
Advertised specs and protocol surfaces |
GET /_emulate/coverage |
Per-operation coverage report with a summary grouped by status (generated, hand-authored, partial, unsupported) |
GET /_emulate/connections |
Copyable SDK, CLI, env, and curl snippets resolved against this instance (optional ?token=, ?client_id=, ?client_secret=) |
GET /_emulate/openapi |
Redirect to the advertised OpenAPI document when one exists |
GET /_emulate/graphql |
Return the GraphQL endpoint when the service exposes one |
GET /_emulate/mcp |
Return the MCP endpoint when the service exposes one |
GET /_emulate/ledger |
Recent API calls with sensitive fields redacted |
DELETE /_emulate/ledger |
Clear the request ledger |
POST /_emulate/faults |
Arm a one-shot or counted fault against matching provider requests |
GET /_emulate/faults |
List armed faults with remaining counts |
DELETE /_emulate/faults |
Clear all armed faults |
DELETE /_emulate/faults/:id |
Clear one armed fault |
GET /_emulate/logs |
Webhook deliveries plus recent requests |
GET /_emulate/state |
Current emulator store snapshot |
POST /_emulate/reset |
Reset state, webhooks, and request logs, then replay seed data |
POST /_emulate/seed |
Add runtime seed data using the service seed schema |
POST /_emulate/credentials |
Create bearer tokens, API keys, OAuth clients, or client-credentials apps where supported |
POST /_emulate/tokens/revoke |
Revoke one token: later requests with it get the provider's own 401, other tokens keep working |
POST /_emulate/instances |
Return URLs for a lazily created hosted instance with a server-generated, unguessable name |
Stripe exposes the same hand-authored OpenAPI subset at GET /openapi.json and GET /openapi.yaml.
The manifest is the machine-readable single source of truth for a service. Each plugin package owns its manifest and serves it at /_emulate/manifest. It describes service identity, supported surfaces, auth capabilities, specs with per-operation coverage, scenarios, seed schema, state model, reset behavior, inspector tabs, request ledger capabilities, copyable connection snippets, and a docs link. OpenAPI, GraphQL, MCP, discovery documents, and OAuth metadata can inform those surfaces, but the emulator only advertises protocols that match the real service shape.
The request ledger is a core feature, not a debug afterthought. Each entry records a correlation id (honored from X-Correlation-Id or X-Request-Id, echoed back in the X-Correlation-Id response header, otherwise generated), the matched route and operation id, method, host, path, query, sanitized request headers and body, the authenticated identity, the response status with a one-line summary, recorded side effects, webhook deliveries, fault markers, and the request duration. On the hosted Cloudflare surface the ledger is persisted across Durable Object eviction, so it survives instance restarts.
Tests and development harnesses can arm one-shot faults with POST /_emulate/faults. A fault matches all provided criteria: operationId when the emulator can resolve one from its service manifest, method, and pathPattern. pathPattern uses a simple glob where * matches any characters in the request path. Matching requests short-circuit with the configured response, decrement remaining, and are removed at zero. A fault can also match request headers by exact value: "headers": { "authorization": "Bearer tok_1" } faults only that caller (header names are case-insensitive). Faulted requests are still written to /_emulate/ledger with faulted: true and faultId. On the hosted Cloudflare surface armed faults, their remaining counts and the next fault id are persisted with the instance, so a fault keeps its count when Cloudflare replaces the instance between arming it and the requests it targets.
curl -s -X POST "$EMULATOR_URL/_emulate/faults" \
-H "content-type: application/json" \
-d '{"match":{"method":"GET","pathPattern":"/v1/*"},"response":{"status":503,"body":{"error":"temporary"}}}'Credential creation follows each service's real shape. For example, GitHub can mint a bearer token for a user, Spotify creates a client credentials app, Google/Microsoft/Apple/Okta/Clerk create OAuth/OIDC clients, Stripe and Resend create API-key style credentials, and AWS advertises provider-specific SDK credentials instead of pretending to be OAuth.
The standalone MCP emulator accepts an oauth seed block for RFC 7591, RFC 8414, and RFC 9728 client compliance tests. These settings are read for each request, so POST /_emulate/seed changes a running instance without restarting it:
mcp:
oauth:
issuerOverride: https://evil.example.com
resourceOverride: https://other.example.com/mcp
tokenEndpointAuthMethods: [client_secret_basic]
dcrAuthMethodOverride: client_secret_basic
rejectClientNameContaining: GitHubSet tokenEndpointAuthMethods to omit to leave token_endpoint_auth_methods_supported out of authorization-server metadata. A client_secret_basic DCR override returns and stores that method, mints a secret, and requires HTTP Basic authentication at /token; client_secret_post continues to require form-body credentials.
The /mcp endpoint authenticates in one of four modes, set with auth in the mcp seed block: oauth (the default: MCP OAuth with dynamic client registration), bearer (Authorization: Bearer <seeded token>), query (?token=<seeded token>, or the name given in queryParam), or none (no sign-in; every request acts as the first seeded user, as a public or locally trusted MCP server does).
Every OAuth consent page that lists users to approve as also has a Deny button. It sends the person back to the client's registered redirect URI with error=access_denied and the request's state (RFC 6749 section 4.1.2.1), in the response mode the request asked for (query, fragment or form_post), and issues no code.
# Start all services (zero-config)
npx emulate
# Start specific services
npx emulate --service vercel,github
# Custom port
npx emulate --port 3000
# Use a seed config file
npx emulate --seed config.yaml
# Generate a starter config
npx emulate init
# Generate config for a specific service
npx emulate init --service vercel
# List available services
npx emulate list| Flag | Default | Description |
|---|---|---|
-p, --port |
4000 |
Base port (auto-increments per service) |
-s, --service |
all | Comma-separated services to enable |
--seed |
auto-detect | Path to seed config (YAML or JSON) |
--base-url |
none | Override advertised base URL (supports {service} template) |
--portless |
off | Serve over HTTPS via portless (auto-registers aliases) |
The port can also be set via EMULATE_PORT or PORT environment variables.
portless gives emulators trusted HTTPS URLs with auto-generated certs and no browser warnings.
# Start the portless proxy (first time only)
portless proxy start
# Start emulate with portless integration
npx emulate start --portlessEach service registers as a portless alias and gets a named HTTPS URL:
github https://github.emulate.localhost
google https://google.emulate.localhost
slack https://slack.emulate.localhost
If portless is not installed, emulate will prompt to install it (npm i -g portless).
The --portless flag overwrites any existing portless aliases matching *.emulate. Aliases are removed automatically when emulate shuts down.
For a custom base URL without portless (any reverse proxy), use --base-url or the EMULATE_BASE_URL env var:
npx emulate start --base-url "https://{service}.myproxy.test"The PORTLESS_URL env var is automatically set by the portless CLI wrapper when running a command through it (e.g. portless github.emulate emulate start), typically to a value like https://{service}.emulate.localhost. It supports {service} interpolation, just like --base-url and EMULATE_BASE_URL. When no explicit baseUrl is provided, it is used as a fallback.
Per-service overrides are also supported in the seed config (these take highest priority over all other base URL sources):
github:
baseUrl: https://github.emulate.localhostAll services are available on host-based routing when deployed: github, gitlab, mcp, vercel, google, okta, microsoft, spotify, slack, apple, aws, resend, stripe, mongoatlas, clerk, x, workos, autumn, context, planetscale, miro, openai, zapier, and posthog. Each one supports three addressing forms:
https://github.emulators.dev # service host (control plane only)
https://github.my-instance.emulators.dev # instance host
https://emulators.dev/github/my-instance # local/path form
The instance host and path form route to the same stateful service instance. The subdomain form is preferred for public examples because the provider base URL is the origin itself, which better matches services such as GitHub that expose API, OAuth, GraphQL, and MCP surfaces under service-owned hosts. The instance control plane is available at https://github.my-instance.emulators.dev/_emulate.
Create instances with POST /_emulate/instances: the server generates an unguessable name (an optional {"instance":"<prefix>"} body adds a readable prefix) and returns the instance URLs. The instance URL is a capability. There is no authentication in front of hosted instances, so anyone who has the URL can read state, read the ledger, and mint credentials on that instance. Treat the URL like a token: save the response instead of re-deriving the name, and never put real secrets into an emulator. Hand-picked instance names (addressing an instance host directly) still work for local and private deployments, but a hand-picked name on the public host is guessable by anyone who picks the same one.
The bare service host (for example https://github.emulators.dev) serves a service-level control plane so a human or agent can learn what the service is and connect without first creating an instance. It responds to GET /_emulate, /_emulate/manifest, /_emulate/quickstart, /_emulate/specs, /_emulate/coverage, /_emulate/connections, /_emulate/openapi, and POST /_emulate/instances. There is no shared instance behind the service host: provider routes return a 404 pointing at instance creation, so all provider traffic happens on an instance of your own.
A global catalog lists every hosted service from any host, including the apex:
GET /_emulate/services
It returns each service's id, name, description, service host, instance host pattern, path form, and manifest URL, so agents can discover the full surface without repository context.
The apex https://emulators.dev is the emulator catalog: a links-out landing page that lists every emulator and links to each one's service host. The console builds it from GET /_emulate/services. The apex is not the docs site.
Discovery documents (/.well-known/oauth-protected-resource, /.well-known/oauth-authorization-server, /.well-known/openid-configuration, and any other /.well-known/ path) are served only by instances, at <instance base>/.well-known/<type> or the path-aware https://emulators.dev/.well-known/<type>/<service>/<instance>. The apex and service hosts answer them with a JSON 404, never a page, so OAuth discovery clients fall through to the next candidate instead of failing to parse HTML.
Documentation is a separate site at https://docs.emulators.dev. Per-service docs live at https://docs.emulators.dev/<service>, which is the docsUrl convention each manifest advertises.
POST /_emulate/credentials is the canonical, uniform way to mint a credential for any service (a bearer token, API key, or OAuth client depending on the service's auth shape). On the hosted Cloudflare worker the legacy /__seed, /__token, and /__reset endpoints still work, but the /_emulate/* routes are canonical.
The emulator worker is named emulate-hosts. It serves emulators.dev/* (the apex catalog) and *.emulators.dev/*, that is every service and instance subdomain. The EmulatorDurableObject class is declared through a wrangler migrations entry (new_classes). Each stateful instance is backed by one EmulatorDurableObject; the store snapshot, the request ledger, armed faults, every token the instance has issued (OAuth access tokens, API keys, bearer credentials, and their revocations) and webhook subscriptions are persisted to Durable Object storage, so an instance keeps them across eviction and deploys. The ledger and tokens are saved after every request, reads included (each ledger entry once, as its own value); the store after every write. Values over the storage limit for a single value are split across several, so a large body saves like any other. A save that fails never changes the answer: the response goes out and the failure is listed at GET /_emulate/persistence, and the next save catches up. A deploy still closes open streams, which clients reconnect. Each instance runs in a Durable Object with 128 MB of memory, and an isolate that runs out is reset with every request in it, so hosted instances refuse what would exhaust it rather than fail: a request body over 16 MiB (32 MiB for the OpenAI emulator) is refused with a 413 before it is read, in the provider's error shape where it has one, and a write that would take an instance's stored data past 32 MiB is refused with a 507 (instance_storage_full; reset or re-seed the instance). GET /_emulate/persistence shows the stored size and the budget. Request bodies over 1 MiB are recorded in the ledger by size only. Hosted emulators are HTTPS only: a plain http request is redirected to the same address over https with a 308, which keeps the method and body.
The docs site (apps/web, worker name emulate-docs) serves docs.emulators.dev. Because that host is more specific than *.emulators.dev, it wins for docs traffic.
npm install emulateEach call to createEmulator starts a single service:
import { createEmulator } from "emulate";
const github = await createEmulator({ service: "github", port: 4001 });
const vercel = await createEmulator({ service: "vercel", port: 4002 });
github.url; // 'http://localhost:4001'
vercel.url; // 'http://localhost:4002'
await github.close();
await vercel.close();// vitest.setup.ts
import { createEmulator, type Emulator } from "emulate";
let github: Emulator;
let vercel: Emulator;
beforeAll(async () => {
[github, vercel] = await Promise.all([
createEmulator({ service: "github", port: 4001 }),
createEmulator({ service: "vercel", port: 4002 }),
]);
process.env.GITHUB_EMULATOR_URL = github.url;
process.env.VERCEL_EMULATOR_URL = vercel.url;
});
afterEach(() => {
github.reset();
vercel.reset();
});
afterAll(() => Promise.all([github.close(), vercel.close()]));| Option | Default | Description |
|---|---|---|
service |
(required) | Service name: 'vercel', 'github', 'gitlab', 'google', 'slack', 'apple', 'microsoft', 'okta', 'aws', 'resend', 'stripe', 'mongoatlas', 'clerk', 'spotify', 'x', 'workos', 'autumn', 'context', 'planetscale', 'miro', 'openai', 'zapier', or 'posthog' |
port |
4000 |
Port for the HTTP server. 0 picks a free port; port and url on the instance report the one bound. createEmulator resolves once the server is listening and rejects if it cannot bind. |
hostname |
all interfaces | Address to listen on, e.g. '127.0.0.1' or '::1'. When given, the default URL names it (http://127.0.0.1:<port>) instead of localhost |
seed |
none | Inline seed data (same shape as YAML config) |
baseUrl |
none | Override advertised base URL. Per-service baseUrl in seed config takes highest priority, then this option, then EMULATE_BASE_URL env var (supports {service}), then PORTLESS_URL (supports {service}, automatically set by the portless CLI wrapper), then http://<hostname>:<port> (or http://localhost:<port> without a hostname). |
strict |
false |
Only seeded or minted tokens authenticate; an unknown or revoked token gets the real API's unauthorized answer. When false, an unknown token acts as the service's default user. Hosted strict instances behave the same. |
| Method | Description |
|---|---|
url |
Base URL of the running server |
port |
Port the server is listening on |
onRequest(fn) |
Call fn with each provider request's ledger entry once it is handled and its state is visible; returns a function that stops it |
reset() |
Wipe the store and replay seed data |
close() |
Shut down the HTTP server, returns a Promise |
faults.arm() |
Arm a one-shot or counted fault |
faults.list() |
List armed faults with remaining counts |
faults.clear() |
Clear one fault by id, or all faults |
Configuration is optional. The CLI auto-detects config files in this order: emulate.config.yaml / .yml, emulate.config.json, service-emulator.config.yaml / .yml, service-emulator.config.json. Or pass --seed <file> explicitly. Run npx emulate init to generate a starter file.
tokens:
my_token:
login: admin
scopes: [repo, user]
vercel:
users:
- username: developer
name: Developer
email: [email protected]
teams:
- slug: my-team
name: My Team
projects:
- name: my-app
team: my-team
framework: nextjs
deployments:
- target: preview
runtimeActivity: false
github:
users:
- login: octocat
name: The Octocat
email: [email protected]
orgs:
- login: my-org
name: My Organization
repos:
- owner: octocat
name: hello-world
language: JavaScript
auto_init: true
google:
users:
- email: [email protected]
name: Test User
- email: [email protected]
name: Admin
hd: acme.com
oauth_clients:
- client_id: my-client-id.apps.googleusercontent.com
client_secret: GOCSPX-secret
redirect_uris:
- http://localhost:3000/api/auth/callback/google
labels:
- id: Label_ops
user_email: [email protected]
name: Ops/Review
color_background: "#DDEEFF"
color_text: "#111111"
messages:
- id: msg_welcome
user_email: [email protected]
from: [email protected]
to: [email protected]
subject: Welcome to the Gmail emulator
body_text: You can now test Gmail, Calendar, and Drive flows locally.
label_ids: [INBOX, UNREAD, CATEGORY_UPDATES]
calendars:
- id: primary
user_email: [email protected]
summary: [email protected]
primary: true
selected: true
time_zone: UTC
calendar_events:
- id: evt_kickoff
user_email: [email protected]
calendar_id: primary
summary: Project Kickoff
start_date_time: 2025-01-10T09:00:00.000Z
end_date_time: 2025-01-10T09:30:00.000Z
drive_items:
- id: drv_docs
user_email: [email protected]
name: Docs
mime_type: application/vnd.google-apps.folder
parent_ids: [root]
slack:
team:
name: My Workspace
domain: my-workspace
users:
- name: developer
real_name: Developer
email: [email protected]
profile:
title: Local Developer
status_text: Testing locally
status_emoji: ":computer:"
presence: active
channels:
- name: general
topic: General discussion
- name: random
topic: Random stuff
bots:
- name: my-bot
oauth_apps:
- client_id: "12345.67890"
client_secret: example_client_secret
app_id: A000000001
name: My Slack App
redirect_uris:
- http://localhost:3000/api/auth/callback/slack
scopes:
- chat:write
- channels:read
- channels:history
- channels:join
- channels:manage
- channels:write
- groups:read
- groups:history
- groups:write
- im:read
- im:history
- im:write
- mpim:read
- mpim:history
- mpim:write
- users:read
- users:read.email
- users.profile:read
- users.profile:write
- users:write
- files:read
- files:write
- pins:read
- pins:write
- bookmarks:read
- bookmarks:write
- reactions:read
- reactions:write
- team:read
user_scopes: [users:read, users.profile:read]
bot_name: my-bot
tokens:
- token: xoxb-local-test
user: developer
scopes:
- chat:write
- channels:read
- channels:history
- channels:join
- channels:manage
- channels:write
- groups:read
- groups:history
- groups:write
- im:read
- im:history
- im:write
- mpim:read
- mpim:history
- mpim:write
- users:read
- users:read.email
- users.profile:read
- users.profile:write
- users:write
- files:read
- files:write
- pins:read
- pins:write
- bookmarks:read
- bookmarks:write
- reactions:read
- reactions:write
- team:read
strict_scopes: false
apple:
users:
- email: [email protected]
name: Test User
oauth_clients:
- client_id: com.example.app
team_id: TEAM001
name: My Apple App
redirect_uris:
- http://localhost:3000/api/auth/callback/apple
microsoft:
users:
- email: [email protected]
name: Test User
oauth_clients:
- client_id: example-client-id
client_secret: example-client-secret
name: My Microsoft App
redirect_uris:
- http://localhost:3000/api/auth/callback/microsoft-entra-id
drive_items:
- name: Project Notes.txt
mime_type: text/plain
content: Notes
aws:
region: us-east-1
s3:
buckets:
- name: my-app-bucket
- name: my-app-uploads
sqs:
queues:
- name: my-app-events
- name: my-app-dlq
iam:
users:
- user_name: developer
create_access_key: true
roles:
- role_name: lambda-execution-role
description: Role for Lambda function executionThe emulator supports configurable OAuth apps and integrations with strict client validation.
vercel:
integrations:
- client_id: "oac_abc123"
client_secret: "secret_abc123"
name: "My Vercel App"
redirect_uris:
- "http://localhost:3000/api/auth/callback/vercel"github:
oauth_apps:
- client_id: "Iv1.abc123"
client_secret: "secret_abc123"
name: "My Web App"
redirect_uris:
- "http://localhost:3000/api/auth/callback/github"If no oauth_apps are configured, the emulator accepts any client_id (backward-compatible). With apps configured, strict validation is enforced.
An app revokes one of its tokens with DELETE /applications/:client_id/token (Basic auth with the client id and secret, { "access_token": "..." } in the body), as on GitHub: 204, then that token gets 401 Bad credentials while the app's other tokens keep working. POST /_emulate/tokens/revoke does the same without the app's secret. POST /_emulate/tokens/revoke with { "token": "..." } revokes one token, as when a user revokes an app's access: later requests with it get the provider's own 401 (GitHub's Bad credentials, OpenAI's invalid_api_key, and so on), on hosted instances across unloads too, while every other token keeps working. It covers tokens in the shared token map (GitHub, Google, Apple, Microsoft, Slack, Vercel, Okta, Clerk, PostHog, MCP, and /_emulate/credentials tokens) and the tokens X, Zapier, PlanetScale and Miro keep, OpenAI API keys, and WorkOS API keys and refresh tokens. WorkOS access tokens are signed JWTs checked by signature alone and cannot be revoked one by one; revoking the session's refresh token ends the session.
Full GitHub App support with JWT authentication and installation access tokens:
github:
apps:
- app_id: 12345
slug: "my-github-app"
name: "My GitHub App"
private_key: |
-----BEGIN RSA PRIVATE KEY-----
...your PEM key...
-----END RSA PRIVATE KEY-----
permissions:
contents: read
issues: write
events: [push, pull_request]
webhook_url: "http://localhost:3000/webhooks/github"
webhook_secret: "my-secret"
installations:
- installation_id: 100
account: my-org
repository_selection: allJWT authentication: sign a JWT with { iss: "<app_id>" } using the app's private key (RS256). The emulator verifies the signature and resolves the app.
App webhook delivery: When events occur on repos where a GitHub App is installed, the emulator mirrors real GitHub behavior:
- All webhook payloads (including repo and org hooks) include an
installationfield with{ id, node_id }. - If the app has a
webhook_url, the emulator delivers the event there with theinstallationfield and (if configured) anX-Hub-Signature-256header signed withwebhook_secret.
slack:
oauth_apps:
- client_id: "12345.67890"
client_secret: "example_client_secret"
name: "My Slack App"
redirect_uris:
- "http://localhost:3000/api/auth/callback/slack"apple:
oauth_clients:
- client_id: "com.example.app"
team_id: "TEAM001"
name: "My Apple App"
redirect_uris:
- "http://localhost:3000/api/auth/callback/apple"microsoft:
oauth_clients:
- client_id: "example-client-id"
client_secret: "example-client-secret"
name: "My Microsoft App"
redirect_uris:
- "http://localhost:3000/api/auth/callback/microsoft-entra-id"Every endpoint below is fully stateful with Vercel-style JSON responses and cursor-based pagination.
GET /v2/user- authenticated userPATCH /v2/user- update userGET /v2/teams- list teams (cursor paginated)GET /v2/teams/:teamId- get team (by ID or slug)POST /v2/teams- create teamPATCH /v2/teams/:teamId- update teamGET /v2/teams/:teamId/members- list membersPOST /v2/teams/:teamId/members- add member
POST /v11/projects- create project (with optional env vars and git integration)GET /v10/projects- list projects (search, cursor pagination)GET /v9/projects/:idOrName- get project (includes env vars)PATCH /v9/projects/:idOrName- update projectDELETE /v9/projects/:idOrName- delete project (cascades)GET /v1/projects/:projectId/promote/aliases- promote aliases statusPATCH /v1/projects/:idOrName/protection-bypass- manage bypass secrets
POST /v13/deployments- create deployment (auto-transitions to READY; acceptsruntimeActivity: false)GET /v13/deployments/:idOrUrl- get deployment (by ID or URL)GET /v6/deployments- list deployments (filter by project, target, state)DELETE /v13/deployments/:id- delete deployment (cascades)PATCH /v12/deployments/:id/cancel- cancel building deploymentGET /v2/deployments/:id/aliases- list deployment aliasesGET /v3/deployments/:idOrUrl/events- get build events/logsGET /v1/projects/:projectId/deployments/:deploymentId/runtime-logs- stream runtime logs; idle deployments hold the response without headersGET /v6/deployments/:id/files- list deployment filesPOST /v2/files- upload file (by SHA digest)
POST /v10/projects/:idOrName/domains- add domain (with verification challenge)GET /v9/projects/:idOrName/domains- list domainsGET /v9/projects/:idOrName/domains/:domain- get domainPATCH /v9/projects/:idOrName/domains/:domain- update domainDELETE /v9/projects/:idOrName/domains/:domain- remove domainPOST /v9/projects/:idOrName/domains/:domain/verify- verify domain
GET /v10/projects/:idOrName/env- list env vars (with decrypt option)POST /v10/projects/:idOrName/env- create env vars (single, batch, upsert)GET /v10/projects/:idOrName/env/:id- get env varPATCH /v9/projects/:idOrName/env/:id- update env varDELETE /v9/projects/:idOrName/env/:id- delete env var
Every endpoint below is fully stateful. Creates, updates, and deletes persist in memory and affect related entities.
GET /user- authenticated userPATCH /user- update profileGET /users/:username- get userGET /users- list usersGET /users/:username/repos- list user reposGET /users/:username/orgs- list user orgsGET /users/:username/followers- list followersGET /users/:username/following- list following
GET /repos/:owner/:repo- get repoPOST /user/repos- create user repoPOST /orgs/:org/repos- create org repoPATCH /repos/:owner/:repo- update repoDELETE /repos/:owner/:repo- delete repo (cascades)GET/PUT /repos/:owner/:repo/topics- get/replace topicsGET /repos/:owner/:repo/languages- languagesGET /repos/:owner/:repo/contributors- contributorsGET /repos/:owner/:repo/forks- list forksPOST /repos/:owner/:repo/forks- create forkGET/PUT/DELETE /repos/:owner/:repo/collaborators/:username- collaboratorsGET /repos/:owner/:repo/collaborators/:username/permissionPOST /repos/:owner/:repo/transfer- transfer repoGET /repos/:owner/:repo/tags- list tags
GET /repos/:owner/:repo/issues- list (filter by state, labels, assignee, milestone, creator, since)POST /repos/:owner/:repo/issues- createGET /repos/:owner/:repo/issues/:number- getPATCH /repos/:owner/:repo/issues/:number- update (state transitions, events)PUT/DELETE /repos/:owner/:repo/issues/:number/lock- lock/unlockGET /repos/:owner/:repo/issues/:number/timeline- timeline eventsGET /repos/:owner/:repo/issues/:number/events- eventsPOST/DELETE /repos/:owner/:repo/issues/:number/assignees- manage assignees
GET /repos/:owner/:repo/pulls- list (filter by state, head, base)POST /repos/:owner/:repo/pulls- createGET /repos/:owner/:repo/pulls/:number- getPATCH /repos/:owner/:repo/pulls/:number- updatePUT /repos/:owner/:repo/pulls/:number/merge- merge (with branch protection enforcement)GET /repos/:owner/:repo/pulls/:number/commits- list commitsGET /repos/:owner/:repo/pulls/:number/files- list filesPOST/DELETE /repos/:owner/:repo/pulls/:number/requested_reviewers- manage reviewersPUT /repos/:owner/:repo/pulls/:number/update-branch- update branch
- Issue comments: full CRUD on
/repos/:owner/:repo/issues/:number/comments - Review comments: full CRUD on
/repos/:owner/:repo/pulls/:number/comments - Commit comments: full CRUD on
/repos/:owner/:repo/commits/:sha/comments - Repo-wide listings for each type
GET /repos/:owner/:repo/pulls/:number/reviews- listPOST /repos/:owner/:repo/pulls/:number/reviews- create (with inline comments)GET/PUT /repos/:owner/:repo/pulls/:number/reviews/:id- get/updatePOST /repos/:owner/:repo/pulls/:number/reviews/:id/events- submitPUT /repos/:owner/:repo/pulls/:number/reviews/:id/dismissals- dismiss
- Labels: full CRUD, add/remove from issues, replace all
- Milestones: full CRUD, state transitions, issue counts
- Branches: list, get, protection CRUD (status checks, PR reviews, enforce admins)
- Refs: get, match, create, update, delete
- Commits: get, create
- Trees: get (with recursive), create (with inline content)
- Blobs: get, create
- Tags: get, create
- Orgs: get, update, list
- Org members: list, check, remove, get/set membership
- Teams: full CRUD, members, repos
- Releases: full CRUD, latest, by tag
- Release assets: full CRUD, upload
- Generate release notes
- Repo webhooks: full CRUD, ping, test, deliveries
- Org webhooks: full CRUD, ping
- Real HTTP delivery to registered URLs on all state changes
GET /search/repositories- full query syntax (user, org, language, topic, stars, forks, etc.)GET /search/issues- issues + PRs (repo, is, author, label, milestone, state, etc.)GET /search/users- users + orgsGET /search/code- blob content searchGET /search/commits- commit message searchGET /search/topics- topic searchGET /search/labels- label search
- Workflows: list, get, enable/disable, dispatch
- Workflow runs: list, get, cancel, rerun, delete, logs
- Jobs: list, get, logs
- Artifacts: list, get, delete
- Secrets: repo + org CRUD
- Check runs: create, update, get, annotations, rerequest, list by ref/suite
- Check suites: create, get, preferences, rerequest, list by ref
- Automatic suite status rollup from check run results
GET /rate_limit- rate limit statusGET /meta- server metadataGET /octocat- ASCII artGET /emojis- emoji URLsGET /zen- random zen phraseGET /versions- API versions
GitLab is modelled as a single GraphQL surface that mirrors gitlab.com/api/graphql. The emulator carries GitLab's full, real schema (4000+ types), printed to SDL from the live API, so introspection and validation behave exactly like the real endpoint: malformed operations are rejected with verbatim graphql-js validation errors, and the complete type system is introspectable. Resolver coverage is intentionally partial and declared honestly in the manifest.
npx emulate --service gitlabWhen all services run together, GitLab uses http://localhost:4018.
POST /api/graphql- the GraphQL endpoint (queries, introspection, validation)
Only a curated set of root fields return data today: metadata (instance version, revision, enterprise flag) and an echo query. currentUser resolves to null, matching GitLab's public, unauthenticated GraphQL endpoint. A Personal Access Token may be sent as an Authorization: Bearer header to match GitLab's shape, but it is not yet used to resolve an authenticated identity.
curl -s -X POST http://localhost:4018/api/graphql \
-H "content-type: application/json" \
-d '{"query":"{ metadata { version revision enterprise } }"}'Because the full schema is real, this surface is well suited to testing GraphQL clients and generators against a large, production-shaped type system without calling gitlab.com. Use /_emulate/manifest for the declared coverage and /_emulate/ledger to inspect calls.
PlanetScale is modelled as its two surfaces an MCP client touches: the Doorkeeper OAuth authorization server and the hosted MCP server.
npx emulate --service planetscaleWhen all services run together, PlanetScale uses http://localhost:4020.
GET /.well-known/oauth-authorization-server- authorization server metadata (client_secret_basicandclient_secret_postonly,plainandS256PKCE,issin the authorization response)POST /oauth/registration- Dynamic Client Registration. Returns apscale_app_client id and a 61 characterpscale_app_secret_secret with noclient_secret_expires_at, and replaces the requested scope with PlanetScale's default setGET /oauth/authorize- consent page with one sign in button per seeded user; the button POSTs to/oauth/authorizeand redirects withcode,state, andissPOST /oauth/token-authorization_code(with PKCE) andrefresh_tokengrantsPOST /oauth/revoke- token revocationPOST /mcp/planetscale- Streamable HTTP MCP server with read onlyplanetscale_list_organizations,planetscale_get_organization,planetscale_list_databases,planetscale_get_database, andplanetscale_list_branchestoolsGET /.well-known/oauth-protected-resource/mcp/planetscale- protected resource metadata
Client authentication follows Doorkeeper exactly: the HTTP Basic header is base64 decoded, split on the first colon, and compared literally with no form url decoding. A client that form url encodes its id or secret before base64 (as RFC 6749 section 2.3.1 describes, and as oauth4webapi's ClientSecretBasic does, escaping _ as %5F) fails with 401 invalid_client and Doorkeeper's WWW-Authenticate: Bearer realm="Doorkeeper", ... header. Every token and revoke call records a ledger side effect such as client_auth method=client_secret_basic outcome=unknown_client client_id="pscale%5Fapp%5F..." client_id_percent_encoded=true. Secrets are never recorded.
planetscale:
users:
- login: planetscale-user
organizations:
- name: acme
databases:
- name: app-db
kind: mysql
branches:
- name: main
production: trueMiro is modelled as the remote MCP server at https://mcp.miro.com/ and the OAuth 2.1 authorization server on the same origin.
npx emulate --service miroWhen all services run together, Miro uses http://localhost:4021.
GET /.well-known/oauth-authorization-server- RFC 8414 metadata. The issuer is the base URL with a trailing slash. Nojwks_uriand no ID token fieldsGET /.well-known/openid-configuration- OIDC metadata that disagrees with the RFC 8414 document exactly as Miro's does:token_endpoint_auth_methods_supported: ["none"], HS256 ID tokens,revocation_endpoint, and a nonstandardaudienceGET /.well-known/oauth-protected-resource- protected resource metadata for the resource<base>/POST /register- Dynamic Client Registration, issuing a client secretGET /authorize- consent page with one sign in button per seeded user; S256 PKCE is requiredPOST /token-authorization_codeandrefresh_tokengrants withclient_secret_postorclient_secret_basic. The advertised jwt-bearer grant is not emulatedPOST /oidc/revoke- token revocationPOST /- Streamable HTTP MCP server with read onlyboard_search_boardsandcanvas_searchtools. Any request without a valid bearer token, on any unknown path, answers401 {"error":"Authentication required"}withWWW-Authenticate: Bearer resource_metadata="<base>/.well-known/oauth-protected-resource"
When openid is granted, the token response carries an id_token signed HS256 with the client secret, with iss, sub, aud, exp, iat, and (with email) email and email_verified. Like real Miro, it never includes nonce, even when the authorization request sent one, so OIDC clients that validate the nonce reject it. Seed id_token_nonce: echo to compare against compliant behaviour.
miro:
id_token_nonce: omit
users:
- email: [email protected]
name: Miro User
boards:
- name: Product Roadmap
items:
- type: sticky_note
content: Ship OAuth for MCPGoogle ID tokens use RS256 signatures. Verify them with the public keys at /oauth2/v3/certs, the instance issuer, your client ID, and the request nonce. Signing keys last for the server process; restarting it invalidates earlier tokens.
OAuth 2.0, OpenID Connect, and mutable Google Workspace-style surfaces for local inbox, calendar, and drive flows.
GET /o/oauth2/v2/auth- authorization endpointPOST /oauth2/token- token exchange; the client authenticates withclient_secret_postorclient_secret_basic, as discovery advertisesGET /oauth2/v2/userinfo- get user infoGET /.well-known/openid-configuration- OIDC discovery documentGET /oauth2/v3/certs- JSON Web Key Set (JWKS)GET /gmail/v1/users/:userId/messages- list messages withq(includinglist:),labelIds,maxResults, andpageTokenGET /gmail/v1/users/:userId/messages/:id- fetch a Gmail-style message payload infull(every header, includingList-IdandList-Unsubscribe),metadata(themetadataHeadersnamed),minimal, orrawformatsGET /gmail/v1/users/:userId/messages/:messageId/attachments/:id- fetch attachment bodiesPOST /gmail/v1/users/:userId/messages/send- create sent mail fromrawMIME or structured fieldsPOST /gmail/v1/users/:userId/messages/import- import inbox mailPOST /gmail/v1/users/:userId/messages- insert a message directlyPOST /gmail/v1/users/:userId/messages/:id/modify- add/remove labels on one messagePOST /gmail/v1/users/:userId/messages/batchModify- add/remove labels across many messagesPOST /gmail/v1/users/:userId/messages/:id/trashandPOST /gmail/v1/users/:userId/messages/:id/untrashGET /gmail/v1/users/:userId/drafts,POST /gmail/v1/users/:userId/drafts,GET /gmail/v1/users/:userId/drafts/:id,PUT /gmail/v1/users/:userId/drafts/:id,POST /gmail/v1/users/:userId/drafts/:id/send,DELETE /gmail/v1/users/:userId/drafts/:idPOST /gmail/v1/users/:userId/threads/:id/modify- add/remove labels across a threadGET /gmail/v1/users/:userId/threadsandGET /gmail/v1/users/:userId/threads/:idGET /gmail/v1/users/:userId/labels,POST /gmail/v1/users/:userId/labels,PATCH /gmail/v1/users/:userId/labels/:id,DELETE /gmail/v1/users/:userId/labels/:idGET /gmail/v1/users/:userId/profile-emailAddress,messagesTotal,threadsTotal,historyIdGET /gmail/v1/users/:userId/history,POST /gmail/v1/users/:userId/watch,POST /gmail/v1/users/:userId/stopGET /gmail/v1/users/:userId/settings/filters,POST /gmail/v1/users/:userId/settings/filters,DELETE /gmail/v1/users/:userId/settings/filters/:idGET /gmail/v1/users/:userId/settings/forwardingAddresses,GET /gmail/v1/users/:userId/settings/sendAsGET /calendar/v3/users/:userId/calendarList,GET /calendar/v3/calendars/:calendarId/events,POST /calendar/v3/calendars/:calendarId/events,DELETE /calendar/v3/calendars/:calendarId/events/:eventId,POST /calendar/v3/freeBusyGET /drive/v3/files,GET /drive/v3/files/:fileId,POST /drive/v3/files,PATCH /drive/v3/files/:fileId,PUT /drive/v3/files/:fileId,DELETE /drive/v3/files/:fileId,POST /upload/drive/v3/files
Gmail push: users.watch notifies the topic's Cloud Pub/Sub push subscriptions after a matching mailbox change (labelIds with INCLUDE or EXCLUDE), at most once a second per user, as Gmail does. Pub/Sub is not emulated, so configure push subscriptions with the pubsub_push_subscriptions seed field or POST /_emulate/google/pubsub/subscriptions:
google:
pubsub_push_subscriptions:
- name: projects/demo/subscriptions/gmail-push
topic: projects/demo/topics/gmail
push_endpoint: https://app.example.test/push
audience: https://app.example.test/pushEach push is the Pub/Sub-wrapped body (message.data is base64 {"emailAddress","historyId"}, plus messageId, publishTime and subscription) with Authorization: Bearer <OIDC token>. The token is RS256, with aud (the audience, or the push endpoint), email (default gmail-push@{project}.iam.gserviceaccount.com), email_verified, sub, azp, iat and exp. Google signs with its own keys and iss https://accounts.google.com; the emulator signs with its OIDC key, so point the receiver's verifier at the emulator: JWKS <base>/oauth2/v3/certs and issuer <base>.
For a test the emulator cannot reach:
POST /_emulate/google/gmail/arrivewith{"to":"[email protected]","from":"[email protected]","subject":"hi","text":"hello","headers":[{"name":"List-Id","value":"..."}]}delivers mail to the INBOX and notifies the watch.POST /_emulate/google/gmail/preview-pushwith{"email":"[email protected]"}returns each push's URL, headers (with the signed token) and body without sending them.GET /_emulate/google/pubsub/deliverieslists the pushes made and whether each was acknowledged (102, 200, 201, 202 or 204).
Fully stateful Slack Web API emulation with channels, messages, threads, reactions, user profiles, presence, modern file uploads, pins, bookmarks, views, OAuth v2, and incoming webhooks. Chat writes preserve common rich message fields such as blocks, attachments, metadata, formatting flags, unfurl flags, and client message ids. Conversation writes update archive state, names, topics, purposes, membership, DMs, MPIMs, and read cursors. User writes update profile fields, status, custom fields, and deterministic active or away presence. File writes support the current external upload flow with local upload URLs, file share messages, reads, lists, downloads, and deletes. Pin and bookmark writes support channel message pins and link bookmarks. View writes support App Home publishing and modal stacks. Seeded OAuth apps and OAuth installs create bot users and installation records. OAuth exchanges and explicit token seeds create scoped token records. Supported write state changes dispatch Slack event_callback payloads to configured webhook URLs.
POST /api/auth.test- test authenticationPOST /api/chat.postMessage- post message with text or rich payload fields (supports threads viathread_tsand DM user IDs).channelis a conversation ID or a channel name, with or without the leading#(generalor#general); the same applies to every method that takeschanneland to an incoming webhook'schanneloverridePOST /api/chat.postEphemeral- post ephemeral message outside channel historyPOST /api/chat.update- update message text and rich payload fieldsPOST /api/chat.delete- delete messageGET /api/chat.getPermalink/POST /api/chat.getPermalink- get message permalinkPOST /api/chat.scheduleMessage- schedule pending messagePOST /api/chat.deleteScheduledMessage- delete pending scheduled messagePOST /api/chat.scheduledMessages.list- list pending scheduled messagesPOST /api/chat.meMessage- /me message
POST /api/conversations.list- list conversations (cursor pagination,types,exclude_archived)POST /api/conversations.info- get channel infoPOST /api/conversations.create- create channelPOST /api/conversations.archive/conversations.unarchive- archive/restore channelPOST /api/conversations.rename- rename channelPOST /api/conversations.setTopic/conversations.setPurpose- update topic/purposePOST /api/conversations.history- channel history with rich message fieldsPOST /api/conversations.replies- thread replies with rich message fieldsPOST /api/conversations.join/conversations.leave- join/leavePOST /api/conversations.invite/conversations.kick- manage membershipPOST /api/conversations.open/conversations.close- open/close DMs and MPIMsPOST /api/conversations.mark- mark read cursorPOST /api/conversations.members- list members
POST /api/users.list- list users (cursor pagination)POST /api/users.info- get user infoPOST /api/users.lookupByEmail- lookup by emailGET /api/users.profile.get/POST /api/users.profile.get- get user profile fieldsPOST /api/users.profile.set- update profile fields, status, and custom fieldsGET /api/users.getPresence/POST /api/users.getPresence- get active or away presencePOST /api/users.setPresence- set the authed user to away or automatic presencePOST /api/reactions.add/reactions.remove/reactions.get- manage reactions
POST /api/files.getUploadURLExternal- create a local external upload sessionPOST /upload/v1/:fileId- receive raw uploaded file bytesPOST /api/files.completeUploadExternal- complete uploads and optionally share file messagesGET /api/files.info/POST /api/files.info- get file metadataGET /api/files.list/POST /api/files.list- list completed filesGET /files-pri/:fileId/:filename- download file bytes with a bearer token that can access the filePOST /api/files.delete- delete a completed file
POST /api/pins.add- pin a message to a channelGET /api/pins.list/POST /api/pins.list- list pinned message items for a channelPOST /api/pins.remove- remove a message pin from a channelPOST /api/bookmarks.add- add a link bookmark to a channelPOST /api/bookmarks.edit- update a link bookmarkPOST /api/bookmarks.list- list channel bookmarksPOST /api/bookmarks.remove- remove a bookmark from a channel
POST /api/views.publish- publish or update an App Home view for a userPOST /api/views.open- open a modal viewPOST /api/views.update- update a view byview_idorexternal_idPOST /api/views.push- push a modal view onto the current modal stackPOST /api/views.generateTriggerId- local helper for tests that need a modal trigger id
Modal opens and pushes require values from /api/views.generateTriggerId. Pass the returned value as trigger_id or interactivity_pointer; generate push values with an existing view_id and use them within 3 seconds.
POST /api/team.info- workspace infoPOST /api/bots.info- bot infoPOST /services/:teamId/:botId/:webhookId- incoming webhook with text or rich payload fields
GET /oauth/v2/authorize- authorization (shows user picker)POST /oauth/v2/authorize/callback- local user picker callback that creates the auth codePOST /api/oauth.v2.access- token exchange
GET /- tabbed local inspector for conversations, messages, files, views, auth records, incoming webhooks, event subscriptions, and event deliveries
Slack scope checks are relaxed by default so local tests can use simple bearer tokens. Set slack.strict_scopes: true in seed config to make supported Web API methods return Slack-style missing_scope errors with needed and provided fields. Strict mode checks chat:write, channels:read, channels:history, channels:join, channels:manage, channels:write, groups:read, groups:history, groups:write, im:read, im:history, im:write, mpim:read, mpim:history, mpim:write, users:read, users:read.email, users.profile:read, users.profile:write, users:write, files:read, files:write, pins:read, pins:write, bookmarks:read, bookmarks:write, reactions:read, reactions:write, and team:read. Slack lists no method-specific scopes for views.publish, views.open, views.update, or views.push, so the emulator requires auth but does not add strict-scope checks for those methods.
Current Slack limits: Slack Connect, Enterprise Grid admin APIs, Audit Logs API, SCIM, Legal Holds, Socket Mode, slash command and interaction simulation, user groups, reminders, stars, calls, canvases, lists, functions, workflows, chat streaming, legacy files.upload, exact rate limiting, and paid-plan behavior are not implemented.
When all services run together, X uses http://localhost:4013. Tokens come from the real OAuth 2.0 flows (/2/oauth2/authorize, /2/oauth2/token); the dm.read, dm.write and media.write scopes are accepted and enforced per route as X's OpenAPI spec lists them.
GET /2/dm_events,GET /2/dm_conversations/with/:participant_id/dm_events,GET /2/dm_conversations/:id/dm_events,GETandDELETE /2/dm_events/:event_idPOST /2/dm_conversations/with/:participant_id/messages,POST /2/dm_conversations/:dm_conversation_id/messages,POST /2/dm_conversations(group)max_results,pagination_token,event_types,dm_event.fields,expansions(sender_id,participant_ids,attachments.media_keys),user.fields,media.fields; events from the last 30 days, newest first
Seed history cheaply: generate describes events computed on demand, never stored.
x:
users:
- username: developer
- username: alice
dm_conversations:
- participants: [developer, alice]
messages:
- from: alice
text: Hi!
attachment: { bytes: 4194304, media_type: image/jpeg }
generate: { count: 2000, interval_seconds: 60, attachment_every: 50 }
dm_bulk: { user: developer, conversations: 50, events_per_conversation: 1000 }
rate_limits:
endpoints:
getDirectMessagesEvents: { limit: 3, window_seconds: 5 }POST /2/media/upload (one request), POST /2/media/upload/initialize, /:id/append, /:id/finalize and GET /2/media/upload?command=STATUS (all media.write). Attach with attachments: [{ media_id }] on a send. Participants download with GET /2/dm_conversations/media/:dm_id/:media_key/:media_id (dm.read), streamed; includes.media[].url points there. Pace a DM attachment's download with stream: { chunks, interval_ms } on a seeded or arriving attachment, or POST /_emulate/x/media/:media_key/stream, the same controls as the OpenAI emulator's paced answers: exactly chunks pieces interval_ms apart (for example 90 MiB as 300 pieces 100 ms apart arrives in about 30 s). An emulator control, not X behaviour; downloads are unpaced unless asked, and {"stream": null} clears it.
/2/webhooks (create, list, PUT for a CRC, delete) and /2/activity/subscriptions for dm.sent and dm.received. Creating a webhook sends GET <url>?crc_token=... and refuses a wrong answer. Deliveries use X's envelope and are signed over the raw body with X-Twitter-Webhooks-Signature-OAuth2 (the client secret), plus X-Twitter-Webhooks-Signature when a consumer_secret is seeded. The deprecated Account Activity API is not emulated.
For a test the emulator cannot reach:
POST /_emulate/x/webhooks/crc-deliverywith{"mode":"control"}(or seedwebhook_crc_delivery: control) is an emulator mode: creation sends no challenge, andGET /_emulate/x/webhooks/:id/challengereturns the GET X would send for the test to deliver; report the answer withPOST /_emulate/x/webhooks/:id/challenge. In control modePOST /2/webhooksalso accepts anhttpaddress or one with a port, which X refuses (an emulator-only relaxation), so a local receiver can be registered, subscribed to and its deliveries previewed; outbound mode keeps X's rule (https, no port). The emulator never calls such an address: its deliveries are held and listed as held, andPOST /_emulate/x/dm/preview-deliverygives the exact signed request. Deliveries go only to a webhook whose challenge was answered (X's CRC at creation or onPUT /2/webhooks/:id, or, in control mode, a correct answer atPOST /_emulate/x/webhooks/:id/challenge); until then they are held, as are a seeded webhook's untilPUT.POST /_emulate/x/dm/arrivewith{"to":"developer","from":"alice","text":"hi"}makes a message arrive (stored, then delivered).POST /_emulate/x/dm/preview-deliverywith{"dm_event_id":"..."}returns the exact URL, headers and body of each delivery without sending it.
Limited responses carry x-rate-limit-limit, x-rate-limit-remaining and x-rate-limit-reset (epoch seconds); a spent window answers 429 with {"errors":[{"code":88,"message":"Rate limit exceeded"}]}. Windows follow X's table (for example 15 DM reads per 15 minutes per user). Override them with the rate_limits seed field or POST /_emulate/x/rate-limits; GET /_emulate/x/rate-limits shows the open windows. Every request, including 429s, is in /_emulate/ledger with its operation id, status and user.
When all services run together, OpenAI uses http://localhost:4022. Point an SDK at it with baseURL: "<base>/v1" and an API key: the default instance has sk-proj-emulate-default-key, seed api_keys, or create one with POST /_emulate/openai/keys or POST /_emulate/credentials (type api-key). Unknown keys answer 401 invalid_api_key.
POST /v1/responses- Responses API for text:inputas a string or message items,instructions,max_output_tokens(truncates withstatus: "incomplete"),stream(the documented events in order, withsequence_number)POST /v1/chat/completions-chat.completionobjects, or withstream: truechunks ending withdata: [DONE]and a usage chunk whenstream_options.include_usageis setGET /v1/models,GET /v1/models/:model- seeded models; with none seeded, any model id is accepted
Answers are deterministic: queued answers first (answer_queue, POST /_emulate/openai/answers/queue), then the first matching rule (answer_rules), then Emulated response from <model> to: <last user message>. An answer can pace its stream:
openai:
api_keys:
- { name: primary, key: sk-proj-test-primary }
- { name: limited, rate_limit: { requests: 0, window_seconds: 60 } }
models: [{ id: gpt-5-mini }]
answer_rules:
- match: { contains: summarise }
answer: A short summary.
- match: { last_user_equals: slow }
answer: { text: "...600 or more characters...", stream: { chunks: 600, interval_ms: 500 } }A key's rate_limit (or POST /_emulate/openai/keys/:name/rate-limit) answers 429 rate_limit_exceeded with Retry-After and x-ratelimit-*-requests for that key only. Token counts are approximate (one token per four characters) and identical in responses and in GET /_emulate/openai/usage, which lists every call with its key, model, tokens, whether it streamed and the request size. Request bodies over 64 KiB are recorded in the ledger by size only. Request bodies are limited to 32 MiB (33,554,432 bytes), the emulator's own limit since OpenAI documents no overall one for these endpoints (only 50 MB across the files in one request); a larger body is refused before it is read with 413 and {"error":{"type":"invalid_request_error","code":"request_too_large"}}. Tools, images, audio, embeddings, stored responses and OpenAI's Realtime and WebSocket transports are not emulated. A WebSocket endpoint, an emulator control and not OpenAI's Realtime or WebSocket-mode protocol: GET /_emulate/openai/websocket (ws:// locally, wss:// hosted) accepts the upgrade and echoes each message, text or binary, as it was received. With ?chunks=N&interval_ms=M, the same controls as the paced answers, it also sends N messages of its own ({"type":"emulate.message","n":1,"of":N,"at":...}) M ms apart, then stays open, so a client can hold a busy connection or an idle one for as long as it likes. It closes when the client closes, answering with the client's close code (1000 for a normal close).
Zapier's remote MCP server in managed mode: one tool per action an account enabled, a different list per account, OAuth per person. When all services run together, Zapier uses http://localhost:4023.
POST /api/v1/connect- Streamable HTTP for protocol2026-07-28(per-request_metaand theMCP-Protocol-Version,Mcp-MethodandMcp-Nameheaders, checked against the body;server/discover;subscriptions/listen) and the2025-11-25and2025-06-18handshake era (initialize, no session minted). No state is kept between requests, so a sessionless client is the normal casetools/list- paged at 100 with opaque cursors bound to the list version (a cursor from before a change answers-32602); a request without a cursor gets the first page and anextCursor, or the whole list whensettings.page_sizeis0tools/call- deterministic results; a tool outside the caller's own list answers-32602 Unknown tool- OAuth as
mcp.zapier.compublishes it:/.well-known/oauth-protected-resource/api/v1/connect,/.well-known/oauth-authorization-server, dynamic registration at/api/v1/oauth/register, S256 PKCE at/oauth/authorize,/api/v1/oauth/tokenwith refresh rotation, revocation and userinfo. Connection tokens (Authorization: Beareror?token=) come fromPOST /_emulate/zapier/accounts/:email/connection-tokenorPOST /_emulate/credentials
zapier:
accounts:
- email: [email protected]
tools: { count: 3000 }
- email: [email protected]
tools: { count: 40, seed: bob }
behaviors:
- { tool: <a tool name>, delay_ms: 2000 }
- { tool: <another>, fail: tool }
- { tool: <another>, result_bytes: 1048576 }The same seed gives the same tools, schemas and results on every instance and after eviction. POST /_emulate/zapier/accounts/:email/tools changes one account's list now (add, remove, rename, replace); the change is silent by default, as Zapier announces none, and is recorded in the ledger with what changed. Two settings are the emulator's own, not Zapier's, and say so: list_changed (send notifications/tools/list_changed on listen and handshake-era streams) and rate_limit (a per-account 429 with Retry-After), set with POST /_emulate/zapier/settings. Agentic mode's meta-tools, resources, prompts, sampling, elicitation and the SSE transport are not emulated.
Sign in with Apple emulation with authorization code flow, PKCE support, RS256 ID tokens, and OIDC discovery.
GET /.well-known/openid-configuration- OIDC discovery documentGET /auth/keys- JSON Web Key Set (JWKS)GET /auth/authorize- authorization endpoint (shows user picker)POST /auth/token- token exchange (authorization code and refresh token grants)POST /auth/revoke- token revocation
Microsoft Entra ID (Azure AD) v2.0 OAuth 2.0 and OpenID Connect emulation with authorization code flow, PKCE, client credentials, RS256 ID tokens, OIDC discovery, and a curated Microsoft Graph subset.
GET /.well-known/openid-configuration- OIDC discovery documentGET /:tenant/v2.0/.well-known/openid-configuration- tenant-scoped OIDC discoveryGET /discovery/v2.0/keys- JSON Web Key Set (JWKS)GET /oauth2/v2.0/authorize- authorization endpoint (shows user picker)POST /oauth2/v2.0/token- token exchange (authorization code, refresh token, client credentials)GET /oidc/userinfo- OpenID Connect user infoGET /v1.0/me- Microsoft Graph user profileGET /v1.0/users- Microsoft Graph usersGET /v1.0/me/messages- Outlook mail messagesPOST /v1.0/me/sendMail- send mailGET /v1.0/me/events- calendar eventsGET /v1.0/me/drive/root/children- OneDrive root childrenPOST /v1.0/me/drive/root/children- create a OneDrive folderPUT /v1.0/me/drive/root:/{path}:/content- create or replace file bytes by pathGET /v1.0/me/drive/items/:id/content- redirect to file bytesPUT /v1.0/me/drive/items/:id/content- replace file bytes by item IDGET /v1.0/drives/:driveId/root/children- drive-scoped OneDrive root childrenGET/PUT /v1.0/drives/:driveId/items/:itemId/content- drive-scoped file bytesGET /oauth2/v2.0/logout- end session / logoutPOST /oauth2/v2.0/revoke- token revocation
S3, SQS, IAM, and STS emulation with AWS SDK-compatible S3 paths and query-style SQS/IAM/STS endpoints. All responses use AWS-compatible XML.
S3 routes use root paths matching the real AWS S3 wire format, so the official AWS SDK works out of the box with forcePathStyle: true. Legacy /s3/ prefixed paths are also supported for backward compatibility.
GET /- list all bucketsPUT /:bucket- create bucketDELETE /:bucket- delete bucketHEAD /:bucket- check existenceGET /:bucket- list objects (prefix, delimiter, max-keys, continuation-token, start-after)POST /:bucket- presigned POST upload (browser-style multipart form with policy validation)PUT /:bucket/:key- put object (supports copy viax-amz-copy-source)GET /:bucket/:key- get objectHEAD /:bucket/:key- head objectDELETE /:bucket/:key- delete object
All operations via POST /sqs/ with Action parameter:
CreateQueue,ListQueues,GetQueueUrl,GetQueueAttributesSendMessage,ReceiveMessage,DeleteMessagePurgeQueue,DeleteQueue
All operations via POST /iam/ with Action parameter:
CreateUser,GetUser,ListUsers,DeleteUserCreateAccessKey,ListAccessKeys,DeleteAccessKeyCreateRole,GetRole,ListRoles,DeleteRole
All operations via POST /sts/ with Action parameter:
GetCallerIdentity,AssumeRole
Embed emulators directly in your Next.js app so they run on the same origin. This solves the Vercel preview deployment problem where OAuth callback URLs change with every deployment.
npm install @emulators/adapter-next @emulators/github @emulators/googleOnly install the emulators you need. Each @emulators/* package is published independently.
Create a catch-all route that serves emulator traffic:
// app/emulate/[...path]/route.ts
import { createEmulateHandler } from "@emulators/adapter-next";
import * as github from "@emulators/github";
import * as google from "@emulators/google";
export const { GET, POST, PUT, PATCH, DELETE } = createEmulateHandler({
services: {
github: {
emulator: github,
seed: {
users: [{ login: "octocat", name: "The Octocat" }],
repos: [{ owner: "octocat", name: "hello-world", auto_init: true }],
},
},
google: {
emulator: google,
seed: {
users: [{ email: "[email protected]", name: "Test User" }],
},
},
},
});Point your provider at the emulator paths on the same origin:
import GitHub from "next-auth/providers/github";
const baseUrl = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : "http://localhost:3000";
GitHub({
clientId: "any-value",
clientSecret: "any-value",
authorization: { url: `${baseUrl}/emulate/github/login/oauth/authorize` },
token: { url: `${baseUrl}/emulate/github/login/oauth/access_token` },
userinfo: { url: `${baseUrl}/emulate/github/user` },
});No oauth_apps need to be seeded. When none are configured, the emulator skips client_id, client_secret, and redirect_uri validation.
Emulator UI pages use bundled fonts. Wrap your Next.js config to include them in the serverless trace:
// next.config.mjs
import { withEmulate } from "@emulators/adapter-next";
export default withEmulate({
// your normal Next.js config
});If you mount the catch-all at a custom path, pass the matching prefix:
export default withEmulate(nextConfig, { routePrefix: "/api/emulate" });By default, emulator state is in-memory and resets on every cold start. To persist state across restarts, pass a persistence adapter:
import { createEmulateHandler } from "@emulators/adapter-next";
import * as github from "@emulators/github";
const kvAdapter = {
async load() {
return await kv.get("emulate-state");
},
async save(data: string) {
await kv.set("emulate-state", data);
},
};
export const { GET, POST, PUT, PATCH, DELETE } = createEmulateHandler({
services: { github: { emulator: github } },
persistence: kvAdapter,
});For local development, @emulators/core ships filePersistence:
import { filePersistence } from '@emulators/core'
// ...
persistence: filePersistence('.emulate/state.json'),The persistence adapter is called on cold start (load) and after every mutating request (save). Saves are serialized via an internal queue to prevent race conditions.
packages/
emulate/ # CLI entry point (commander)
@emulators/
core/ # HTTP server, in-memory store, plugin interface, middleware
adapter-next/ # Next.js App Router integration
vercel/ # Vercel API service
github/ # GitHub API service
google/ # Google OAuth 2.0 / OIDC + Gmail, Calendar, Drive
slack/ # Slack Web API, OAuth v2, incoming webhooks
apple/ # Apple Sign In / OIDC
microsoft/ # Microsoft Entra ID OAuth 2.0 / OIDC + Graph users, mail, calendar, and files
aws/ # AWS S3, SQS, IAM, STS
apps/
web/ # Documentation site (Next.js), deployed to docs.emulators.dev
The core provides a generic Store with typed Collection<T> instances supporting CRUD, indexing, filtering, and pagination. Each service plugin registers its routes with the shared internal app and uses the store for state.
Tokens are configured in the seed config and map to users. Pass them as Authorization: Bearer <token> or Authorization: token <token>.
Vercel: All endpoints accept teamId or slug query params for team scoping. Pagination uses cursor-based limit/since/until with pagination response objects.
GitHub: Public repo endpoints work without auth. Private repos and write operations require a valid token. Pagination uses page/per_page with Link headers.
Google: Standard OAuth 2.0 authorization code flow. Configure clients in the seed config.
Slack: All Web API endpoints require Authorization: Bearer <token>. Seeded OAuth apps create local installation records, and OAuth v2 flow with user picker UI creates scoped bot tokens. Optional strict scope mode returns missing_scope when a token lacks a required method scope.
Apple: OIDC authorization code flow with RS256 ID tokens. On first auth per user/client pair, a user JSON blob is included.
Microsoft: OIDC authorization code flow with PKCE support. Also supports client credentials grants and Microsoft Graph users, mail, calendar, and OneDrive routes.
AWS: Bearer tokens or IAM access key credentials. Default key pair always seeded: AKIAIOSFODNN7EXAMPLE / wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY.