About MockHero
MockHero is an MCP server for coding agents that need synthetic test data. It supports schema-based and prompt-based generation, with schema tools and limited preview generation available without an API key.
Key features
- 01Generate JSON, CSV, or SQL test data
- 02Create data from schemas or prompts
- 03Use relational foreign keys
- 04Detect schemas from SQL or JSON
- 05Browse field types and templates
- 06Estimate usage and claim an API key
Use cases
- 01Seed a database with linked test records
- 02Create locale-specific test data
- 03Turn SQL or JSON samples into a schema
MCP support
Exposes data generation, schema discovery, templates, usage estimates, and API-key checkout tools to MCP clients. Clients can connect to the hosted Streamable HTTP endpoint or run the package locally.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://mockhero.dev/mcp/agentclaude mcp add --transport http mockhero https://mockhero.dev/mcp/agent{"mcpServers":{"mockhero":{"type":"http","url":"https://mockhero.dev/mcp/agent"}}}Open in Cursor{"servers":{"mockhero":{"type":"http","url":"https://mockhero.dev/mcp/agent"}}}Open in VS Code{"mcpServers":{"mockhero":{"type":"http","url":"https://mockhero.dev/mcp/agent"}}}{"mcpServers":{"mockhero":{"serverUrl":"https://mockhero.dev/mcp/agent"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
9| Parameter | Type | Required | Description |
|---|---|---|---|
| tables | array | No | |
| prompt | string | No | Plain-English data request. Example: 50 users and 200 orders linked to them. |
| format | enum | No | json | csv | sql |
| sql_dialect | enum | No | postgres | mysql | sqlite |
| locale | string | No | Default locale such as en, de, fr, es, or ja. |
| seed | number | No | Seed for reproducible output. |
| template | enum | No | ecommerce | blog | saas | social |
| scale | number | No | Multiplier for template record counts. |
| estimated_records | integer | No | Required for prompt estimates because this tool does not run prompt-to-schema conversion. |
| daily_used_before | integer | No | Optional assumption when no API key is supplied. |
| api_key | string | No | Optional MockHero API key for no-auth MCP clients. Prefer the Authorization header when the client supports it. |
Details
From the project README@mockherodev/mcp-server
MCP server for MockHero — generate realistic test data from Claude Desktop, Claude Code, Cursor, Windsurf, and other AI agents.
Works with or without an API key:
- No key (free preview): generate up to 100 records per request from explicit table schemas or small templates. Schema detection, field-type listing, templates, and cost estimates are always free.
- With
MOCKHERO_API_KEY(recommended): plain-English prompt generation, larger requests, CSV/SQL output on paid tiers, and metered agent-plan usage.
Hosted agent endpoint
Agents that support remote Streamable HTTP MCP can skip the npm install and connect directly to:
https://mockhero.dev/mcp/agent
The hosted endpoint includes the same tools as this package: cost estimation, loginless Polar checkout, checkout status, API key claiming, schema detection, templates, and data generation. Pass a key via Authorization: Bearer mh_YOUR_API_KEY (or the api_key tool argument) for authenticated calls.
Hosted agent endpoint
Agents that support remote Streamable HTTP MCP can connect directly to:
https://mockhero.dev/mcp/agent
The hosted endpoint includes cost estimation, loginless Polar checkout, checkout status, API key claiming, schema detection, templates, and authenticated data generation.
Setup
Claude Desktop
Add to ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"mockhero": {
"command": "npx",
"args": ["@mockherodev/mcp-server"],
"env": {
"MOCKHERO_API_KEY": "mh_live_your_key_here"
}
}
}
}
Omit the env block entirely to run in free preview mode.
Cursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"mockhero": {
"command": "npx",
"args": ["@mockherodev/mcp-server"],
"env": {
"MOCKHERO_API_KEY": "mh_live_your_key_here"
}
}
}
}
Claude Code
# Free preview mode
claude mcp add mockhero -- npx @mockherodev/mcp-server
# Authenticated
claude mcp add mockhero -- env MOCKHERO_API_KEY=mh_live_xxx npx @mockherodev/mcp-server
Get an API key without leaving your agent (loginless checkout)
No signup or dashboard needed. The agent-plan purchase flow is fully tool-driven:
estimate_agent_usage— estimate cost first. The agent plan includes 500 free records per day, then $0.001 per 100 records (rounded up per request), billed monthly through Polar as Merchant of Record.create_agent_checkout— pass a billing email; returns a Polar checkout URL and a one-timeclaim_token. A human completes payment in the browser.check_agent_checkout_status— poll with theclaim_tokenuntilstatusispaid.claim_agent_api_key— exchange theclaim_tokenfor the API key. The key is returned exactly once — store it securely.- Restart this server with
MOCKHERO_API_KEY=mh_...set (recommended path from here on).
Prefer a dashboard? Sign up free at mockhero.dev instead.
Tools
generate_test_data
Generate realistic test data from a structured schema or plain English description. Relational foreign keys, 156 field types, 22 locales, JSON/CSV/SQL output. Explicit schemas up to 100 records run free without a key; prompt mode and larger requests need MOCKHERO_API_KEY.
"Generate 50 users with German names and 200 orders linked to them"
generate_from_template
Generate data from a pre-built template (ecommerce, blog, saas, social) — no schema definition needed. Small scales (e.g. 0.05) stay within the free 100-record preview.
Use the ecommerce template at 2x scale with German locale
detect_schema
Convert SQL CREATE TABLE statements or JSON samples into MockHero's schema format. Free, no key required.
list_field_types
List all 156 supported field types with descriptions and parameters. Free, no key required.
list_templates
List pre-built schema templates. Free, no key required.
estimate_agent_usage
Estimate agent-plan cost before generating: free daily allowance remaining, billable records, billable 100-record units, and estimated dollar cost. Free, no key required.
create_agent_checkout
Create a loginless Polar checkout for the metered agent plan. Returns a checkout URL and one-time claim_token.
check_agent_checkout_status
Poll a checkout by claim_token until it is paid.
claim_agent_api_key
Claim the API key after payment. Returned once — store it and set MOCKHERO_API_KEY.
Environment variables
| Variable | Required | Description |
|---|---|---|
MOCKHERO_API_KEY | No | MockHero API key (mh_...). Without it, generation runs in free preview mode (≤100 records per request, explicit schemas/templates only). |
MOCKHERO_API_BASE | No | Base URL of the MockHero API. Default https://mockhero.dev. |
Pricing
- Free tier: 500 records/day, 100 per request, JSON output.
- Agent plan (loginless, metered): 500 free records/day, then $0.001 per 100 records, billed monthly via Polar (Merchant of Record).
- Full pricing: mockhero.dev/agent-pricing.json
Links
- Website: mockhero.dev
- Docs: mockhero.dev/docs/mcp
- Agent quickstart: mockhero.dev/agent-quickstart.json
- OpenAPI: mockhero.dev/openapi.json
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.