API
MCP Setup
Connect Streakfox MCP with a customer-scoped token.
Streakfox exposes an MCP server for agents that set up and operate retention programs.
Production endpoint:
https://mcp.streakfox.com/mcpAuthentication
MCP uses customer-scoped bearer tokens. Tokens are created from an authenticated dashboard session and are stored by Streakfox as hashes.
Create a token through the dashboard API:
curl -X POST https://app.streakfox.com/api/trpc/mcp.createToken \
-H "Content-Type: application/json" \
-b "YOUR_DASHBOARD_SESSION_COOKIE" \
-d '{"json":{"name":"Local agent"}}'The response includes the raw token once. Use it as the MCP bearer token:
Authorization: Bearer sfx_mcp_...Do not use deployment tokens or internal ingest secrets for customer MCP setup.
Tools
| Tool | Purpose |
|---|---|
list_projects | List projects available to the authenticated token. |
create_project | Create a project in the token's user or organization scope. |
list_programs | List programs for an authorized project. |
create_program | Create a program/widget for an authorized project. |
update_program | Update program name, event key, cadence, target, timezone, or status. |
create_or_rotate_webhook_secret | Create or rotate a program inbound webhook secret. |
get_install_snippets | Return widget, REST, webhook, and MCP setup snippets. |
record_event | Record a program event through MCP. |
get_streak_state | Read current program state for a subject. |
list_at_risk_users | Find subjects whose streak has not updated since a cutoff date. |
create_milestone | Create or update a milestone for a program event key. |
Setup Flow
- Create an MCP token from the dashboard API.
- Configure your MCP client with
https://mcp.streakfox.com/mcpand the bearer token. - Call
list_projectsorcreate_project. - Call
create_programorupdate_program. - Call
create_or_rotate_webhook_secretif inbound webhooks will record events. - Call
get_install_snippetsfor widget, REST, webhook, and MCP examples. - Call
record_event, thenget_streak_stateto verify the event updated state.
Example Tool Arguments
Create a program:
{
"projectId": "PROJECT_ID",
"name": "Activation streak",
"eventKey": "activation_complete",
"mode": "continuous",
"cadence": "daily",
"target": 1,
"status": "live"
}Record an event:
{
"projectId": "PROJECT_ID",
"userHash": "agent-user-123",
"event": "activation_complete",
"externalService": "internal-agent",
"integrationId": "support-resolution-agent",
"meta": {
"ticketId": "TCK-123"
}
}MCP events are stored with source: "mcp" so they appear separately in event-source analytics while updating the same program state.