AI

Generate Test Data in Windsurf with MockHero MCP

The Problem

Windsurf's Cascade agent excels at understanding your entire codebase and making multi-file edits. But when it generates test data, the results are often shallow. You get a few hardcoded records that are enough to make the code compile but not enough to test real-world scenarios like pagination, search filtering, or edge cases in business logic.

Building a proper seed script manually defeats the purpose of using an AI-powered editor. You want the agent to handle the boring parts, including generating realistic data that actually exercises your application.

The Solution: MockHero MCP in Windsurf

Windsurf supports MCP tool servers, allowing Cascade to call external services. By adding MockHero as an MCP server, Cascade can generate realistic, relationally-consistent test data directly within your workflow. Describe your data needs in the chat, and Cascade does the rest.

Quick Setup

Add MockHero to your Windsurf MCP configuration:

{
  "mcpServers": {
    "mockhero": {
      "command": "npx",
      "args": ["-y", "@mockhero/mcp-server"],
      "env": {
        "MOCKHERO_API_KEY": "mh_your_api_key"
      }
    }
  }
}

Save the configuration and restart Windsurf. Cascade will detect the MockHero tool automatically.

Step-by-Step Guide

1. Get your MockHero API key

Sign up at mockhero.dev/sign-up and copy your API key from the dashboard.

2. Configure MCP in Windsurf

Open Windsurf's MCP settings and add the MockHero server configuration shown above. The server runs via npx so there are no global installations needed.

3. Restart and verify

Restart Windsurf and open the Cascade panel. You should see MockHero listed as an available tool. If it does not appear, check that your API key is set correctly.

4. Ask Cascade to generate data

Use natural language in the Cascade chat:

"I need a seed script for my SaaS app. Generate 10 organizations,
50 users across those orgs, and 200 projects with realistic names
and descriptions. Use my Supabase database."

Cascade will call MockHero, receive the data, and write a seed script tailored to your project's database setup.

5. Execute and test

Cascade can run the seed script from Windsurf's terminal. Open your database GUI to verify the data and its relationships.

Why MockHero MCP in Windsurf vs Alternatives

  • Cascade-native — works within Windsurf's agentic workflow. No context switching to external tools.
  • Codebase-aware — Cascade understands your schema files and can generate MockHero requests that match your actual tables.
  • Production-realistic — 156+ field types produce data that looks like a real production database, not placeholder text.
  • Multi-table — generate complex schemas with multiple related tables in a single request.

Get Started

Give Windsurf's Cascade the ability to generate real test data. Sign up free at mockhero.dev, add the MCP config, and let your AI agent handle test data while you focus on building features.

M

MockHero Team

Guides and tutorials for generating realistic test data with the MockHero API.

Start generating test data for free

1,000 rows/month on the free tier. No credit card required.

Get Your API Key

Related Articles