How to Connect AI Persona Generator to Claude and Cursor via MCP

The Model Context Protocol lets AI agents call external tools directly. Here's a step-by-step guide to wiring up AI Persona Generator as an MCP server so you can generate test users without leaving your editor.

May 14, 20265
tutorialmcpclaudecursordeveloper
How to Connect AI Persona Generator to Claude and Cursor via MCP

There's a workflow shift happening quietly in developer tooling. Instead of switching between your editor, a terminal, and a browser to gather data, you describe what you need in plain language and your AI agent fetches it. The Model Context Protocol (MCP) is the mechanism that makes this possible — a standard interface for AI clients to call external tools.

AI Persona Generator supports MCP natively. This guide walks through the full connection setup for both Claude (the desktop app) and Cursor, along with a practical example of what the workflow actually looks like once everything is running.

What MCP Actually Does Here

Without MCP, generating test personas requires: opening a browser, navigating to the tool, configuring fields, clicking generate, downloading a file, and pasting the data somewhere useful. That's six context switches for what should be a one-line request.

With MCP, you type something like "generate 10 test users for a healthcare app, include age range 25–60 and insurance status" into Claude or Cursor, and get structured JSON back in the same session.

The AI Persona Generator MCP server exposes a generate_personas tool that accepts the same parameters as the REST API. The AI client handles the call transparently.

Prerequisites

  • An AI Persona Generator account with an API key (Settings → API Keys)
  • Claude desktop app (claude.ai/download) or Cursor (cursor.sh)
  • Internet access from your machine (the MCP server is hosted, not local)

Configuring Claude Desktop

Claude uses a JSON config file to register MCP servers. Find it at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following entry (create the file if it doesn't exist):

{ "mcpServers": { "persona-generator": { "type": "sse", "url": "https://aipersonagen.com/api/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } }

Replace YOUR_API_KEY with the key from your account settings. Restart Claude after saving.

To verify it worked: open a new Claude conversation and type "What tools do you have available?" You should see generate_personas listed.

Configuring Cursor

Cursor's MCP config lives in a project-level file (.cursor/mcp.json) or a global config. For a project-specific setup:

{ "mcpServers": { "persona-generator": { "type": "sse", "url": "https://aipersonagen.com/api/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } }

Place this in .cursor/mcp.json at your project root. Cursor will pick it up automatically on the next restart. You can confirm it's active in Settings → MCP.

What the Tool Parameters Look Like

When the AI calls generate_personas, it passes a structured argument matching the API schema. You don't need to write this yourself — the AI constructs it from your natural language request — but knowing the shape helps you write better prompts:

{ "personaCount": 10, "projectDescription": "A healthcare app for patients managing chronic conditions", "outputLanguage": "english", "schemaMode": "ai", "personalPrompt": false, "customFields": false, "enableAvatar": false }

With schemaMode: "ai", the model infers appropriate fields from your description. Switch to "hybrid" or "strict" when you need precise field control.

A Real Workflow Example

Here's how a typical session goes inside Cursor while building a new feature:

You're implementing a dashboard that shows user activity by subscription tier. You need test data before writing the query logic. Instead of context-switching:

"Generate 20 test users for a SaaS analytics tool. Include fields for subscription_tier (free/pro/enterprise, weighted 60/30/10), last_active_days (integer 0–90), and country (US 40%, EU 35%, APAC 25%). Return as JSON."

Cursor calls generate_personas, and within a few seconds you have 20 records with realistic distributions inline in your chat. You paste the JSON into a seed script, confirm the query handles all three tiers, and move on.

The absence of a browser tab is surprisingly liberating.

Handling the Async Pattern

The generate_personas tool returns a taskId for larger batches. The MCP server handles polling automatically — you don't need to manage the status check yourself. The AI client waits for completion and returns the final data.

For very large batches (50+ personas with avatars enabled), the wait can be 10–20 seconds. This is normal; avatar generation is the slow step. For typical development use (10–20 users, no avatars), responses come back in 2–4 seconds.

Practical Tips

Be specific in your prompts. Vague descriptions like "a social app" produce generic fields. Something like "a fitness tracking app for gym members, age 18–45, tracking workout frequency and membership type" produces far more useful output.

Use schemaMode: "strict" with custom fields when you need exact column names to match your database schema. The AI respects field names precisely in strict mode.

Don't regenerate for every test. Generate once per schema version, cache the result, reuse across tests. The API isn't free; treat it like an external service call with appropriate caching.

Once you've had the experience of generating a full, realistic user dataset without touching a browser, it's hard to go back to users.json with twelve rows of placeholder data.

More posts