MCP

MCP Server

Use MockHero directly from your AI coding agent. Generate test data without leaving your editor — just describe what you need in plain English.

What is MCP?

The Model Context Protocol (MCP) lets AI agents call external tools. When you install the MockHero MCP server, your AI agent gets direct access to test data generation — it can create schemas, generate data, and detect field types without you writing any API calls.

Supported Agents

Claude Desktop

Claude Code

Cursor

Windsurf

Cline

Codex CLI

VS Code Copilot

Zed

Continue

Any MCP-compatible agent will work. The setup is the same — point it at @mockherodev/mcp-server with your API key.

Installation

You need an API key from MockHero. Sign up free and create one in your dashboard.

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"
      }
    }
  }
}

Claude Code

claude mcp add mockhero -- env MOCKHERO_API_KEY=mh_live_xxx npx @mockherodev/mcp-server

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"
      }
    }
  }
}

Available Tools

Once installed, your AI agent can use these tools:

generate_test_data

Generate realistic test data from a structured schema or plain English. Works with all 156 field types, 22 locales, and relational references.

"Generate 50 users with German names and 200 orders linked to them"
detect_schema

Convert SQL CREATE TABLE statements or JSON samples into MockHero schema format. Paste your existing DDL and get a ready-to-use schema back.

list_field_types

List all 156 supported field types with descriptions and parameters.

list_templates

List pre-built schema templates — e-commerce, blog, SaaS, and social network.

generate_from_template

Generate data using a template with optional scale and locale overrides. No schema definition needed.

"Use the ecommerce template at 2x scale with German locale"

npm Package

The MCP server is published as @mockherodev/mcp-server on npm. You can also run it directly:

MOCKHERO_API_KEY=mh_live_xxx npx @mockherodev/mcp-server