# Mocktail

> A free, self-hosted mock API server with a built-in dashboard, shipped as a single ~25 MB binary with AI assistant and MCP server support.

Mocktail is a completely free, open-source mock API server that ships as a single self-contained binary for macOS, Linux, and Windows. It bundles a modern web dashboard, a SQLite-backed database, an in-app AI assistant, and a built-in MCP server — all without requiring a sign-up or paid tier. The project is licensed under MIT and hosted on GitHub under the handle Huseyinnurbaki.

## What It Is

Mocktail lets developers define HTTP mock endpoints — GET, POST, PUT, PATCH, DELETE — and serve them locally or on self-hosted infrastructure as if they were real APIs. The dashboard opens at `localhost:6625` and provides a live traffic stream, a JSON editor with syntax highlighting, per-field data randomization, response delay simulation, and custom status codes. It is designed to cover the full development lifecycle: building frontends before a backend exists, testing error states and edge cases, and running stable demos or QA environments.

## Architecture and Deployment

Mocktail is distributed as a single binary (~25 MB) with no external runtime dependencies. Key architectural choices include:

- **Pure-Go SQLite** (no CGO) for cross-platform compatibility and CGO-free cross-compilation
- **Persistent storage** in a per-user app-data directory by default (`~/Library/Application Support/mocktail/apis.db` on macOS), or a mounted Docker volume
- **Multi-platform binaries** for amd64 and arm64 (Intel, Apple Silicon, Raspberry Pi)
- **Installation options**: Homebrew cask, Docker, Docker Compose, or direct binary download
- A native desktop app is listed as "coming soon" on the homepage

The server listens on port 6625 by default ("MOCK" on a phone keypad, per the README), with optional API key authentication for both served mocks (`MOCKTAIL_API_KEY`) and the management API (`MOCKTAIL_ADMIN_KEY`).

## AI Assistant and MCP Integration

Mocktail v4 introduced two AI-driven workflows:

- **Built-in AI assistant**: A right-panel chat interface in the dashboard that can create, update, and delete endpoints from plain-language prompts. It uses the user's own Anthropic (Claude) API key, stored in the OS keychain on desktop or injected via environment variable in containers. The key is never sent to the browser and all provider calls are made server-side.
- **MCP server**: Available on npm as `mocktail-mcp`, the MCP server exposes five tools (`list_mocks`, `create_mock`, `update_mock`, `delete_mock`, `import_mocks`) that let Claude Desktop, Claude Code, or any MCP-compatible agent manage mock endpoints through natural language without opening the dashboard.

## Key Features

- 20+ faker types for per-field data randomization (UUIDs, emails, prices, names, and more)
- Live traffic stream filterable by path and status, showing method, latency, response body, and headers
- CodeMirror 6 JSON editor with syntax highlighting, error detection, and code folding
- Auto-generated code snippets for cURL, Node.js, Python, and Go
- Import/export mocks as JSON (including randomize config and headers)
- CORS configuration via environment variables
- Health check endpoint at `/health` for monitoring and orchestration
- Light/dark/system themes with accent color options

## Update: v4.0.3

The latest release is **v4.0.3**, published on 2026-08-15, following the v4.0.0 major release on 2026-08-14. Version 4 introduced the in-app AI assistant, the MCP server, the pure-Go SQLite driver (replacing the CGO build), the new app-data directory for DB persistence, and the `MOCKTAIL_ADMIN_KEY` for management API protection. Users on v3 can stay on the `v3.1.9` branch or follow the upgrade guide in the changelog. The repository was last pushed on 2026-08-15 and has 274 stars and 11 forks on GitHub.

## Features
- Single binary deployment (~25 MB)
- Built-in web dashboard at localhost:6625
- AI assistant for creating/editing mocks from natural language
- MCP server for Claude Desktop and Claude Code integration
- Live traffic stream with method, status, latency, and response details
- Per-field data randomization with 20+ faker types
- Custom HTTP status codes (200, 401, 429, 500, etc.)
- Response delay simulation (0–30000ms)
- Custom response headers per mock
- CodeMirror 6 JSON editor with syntax highlighting and error detection
- Auto-generated code snippets for cURL, Node.js, Python, and Go
- Import/export mocks as JSON
- SQLite persistent storage (no CGO)
- Optional API key authentication for mocks and management API
- CORS configuration via environment variables
- Health check endpoint
- Multi-platform: amd64 and arm64 support
- Docker and Docker Compose support
- Light/dark/system themes with accent colors

## Integrations
Claude Desktop, Claude Code, Docker, Docker Compose, Homebrew, Kubernetes, Anthropic Claude API, MCP (Model Context Protocol), npm (mocktail-mcp)

## Platforms
WINDOWS, MACOS, LINUX, WEB, API, VSC_EXTENSION, CLI

## Pricing
Open Source

## Version
v4.0.3

## Links
- Website: https://getmocktail.com
- Documentation: https://github.com/Huseyinnurbaki/mocktail/blob/master/changelog.md
- Repository: https://github.com/Huseyinnurbaki/mocktail
- EveryDev.ai: https://www.everydev.ai/tools/mocktail
