Cursor & windsurf setup
Connect FirstDistro to Cursor or Windsurf IDE to query customer health while coding.
Connect FirstDistro to Cursor or Windsurf to query customer health, check SDK status, and get setup help while you code.
Prerequisites
- Cursor or Windsurf IDE installed
- FirstDistro API key — Get one from Settings
Note: Use an API key (sk_live_... or sk_test_...), not an Installation Token (fd_...).
Cursor setup
Configure for cursor
Run this command in your terminal:
bash
npx @firstdistro/mcp init --api-key sk_live_your_key_here
This saves your config to ~/.firstdistro/config.json.
Add mcp server to cursor
- Open Cursor Settings (
Cmd+,on macOS,Ctrl+,on Windows) - Search for "MCP" or navigate to Features → MCP Servers
- Click Add Server
- Enter the following:
- Name:
firstdistro - Command:
npx - Args:
@firstdistro/mcp
- Name:
Alternatively, edit your Cursor settings JSON directly:
json
{
"mcpServers": {
"firstdistro": {
"command": "npx",
"args": ["@firstdistro/mcp"]
}
}
}
Verify cursor setup
- Restart Cursor to load the MCP server
- In the Cursor chat, ask: "What FirstDistro tools do you have?"
Windsurf setup
Configure for windsurf
Run this command in your terminal:
bash
npx @firstdistro/mcp init --api-key sk_live_your_key_here
Add mcp server to windsurf
- Open Windsurf Settings
- Navigate to AI → MCP Servers
- Add a new server with:
- Name:
firstdistro - Command:
npx @firstdistro/mcp
- Name:
Or edit your Windsurf config file:
json
{
"mcpServers": {
"firstdistro": {
"command": "npx",
"args": ["@firstdistro/mcp"]
}
}
}
Verify windsurf setup
- Restart the IDE to load the MCP server
- Ask the AI: "Show me my FirstDistro experiences"
Example prompts
Once connected, try these prompts in your IDE:
| Prompt | What it does |
|---|---|
| "Are my FirstDistro events flowing?" | Checks SDK is sending events |
| "Which customers are at risk?" | Lists accounts with low health scores |
| "Show me stuck users in onboarding" | Finds users who stopped mid-flow |
| "Add FirstDistro SDK to this project" | Generates setup files for your framework |
| "What's the completion rate for checkout?" | Gets funnel statistics |
Using environment variables
Instead of running init, you can pass the API key directly in the config:
json
{
"mcpServers": {
"firstdistro": {
"command": "npx",
"args": ["@firstdistro/mcp"],
"env": {
"FIRSTDISTRO_API_KEY": "sk_live_your_key_here"
}
}
}
}
Troubleshooting
Tools not appearing
- Check the MCP server is added correctly in settings
- Restart the IDE completely
- Check the IDE's output/console for MCP errors
"api key invalid" errors
- Verify your API key starts with
sk_live_orsk_test_ - Create a new key at Dashboard → Settings → API Keys
- Run
npx @firstdistro/mcp init --api-key NEW_KEY - Restart the IDE
"not configured" responses
Run the init command:
bash
npx @firstdistro/mcp init --api-key sk_live_your_key_here
Then restart the IDE.
Next steps
- Tools Reference — See all available tools
- MCP Overview — Learn what MCP can do