@datafast/mcp-server
Allows Codeium's Windsurf IDE to query DataFast analytics through MCP tools.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@datafast/mcp-server how many visitors did I get this month?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@datafast/mcp-server
An MCP (Model Context Protocol) server that exposes DataFast analytics as tools for AI assistants like Claude, Cursor, and others.
Ask your AI assistant questions like:
"How many visitors did I get this week?"
"What are my top referrers this month?"
"Show me revenue by country for Q4"
"Which pages have the highest conversion rate?"
"What's my real-time visitor count?"
Requirements
Node.js 18.0.0 or later
A DataFast account with an API key
Related MCP server: Clamp Analytics MCP Server
Setup
1. Get your API key
Go to your DataFast dashboard → Settings → API Keys and create a new key.
2. Install
npm install @datafast/mcp-server3. Configure your AI client
Cursor
Add this to your .cursor/mcp.json:
{
"mcpServers": {
"datafast": {
"command": "npx",
"args": ["-y", "@datafast/mcp-server"],
"env": {
"DATAFAST_API_KEY": "df_your_api_key_here"
}
}
}
}Claude Desktop
Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"datafast": {
"command": "npx",
"args": ["-y", "@datafast/mcp-server"],
"env": {
"DATAFAST_API_KEY": "df_your_api_key_here"
}
}
}
}Windsurf
Add this to your ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"datafast": {
"command": "npx",
"args": ["-y", "@datafast/mcp-server"],
"env": {
"DATAFAST_API_KEY": "df_your_api_key_here"
}
}
}
}Available Tools
Analytics
Tool | Description |
| High-level metrics: visitors, sessions, bounce rate, revenue, conversion rate |
| Time series data (hourly/daily/weekly/monthly) for trend analysis |
| Top pages by visitor count with revenue attribution |
| Top traffic referrers with revenue attribution |
| Visitors and revenue by country |
| Visitors and revenue by city |
| Visitors and revenue by region/state |
| Visitors and revenue by browser |
| Visitors and revenue by device type |
| Visitors and revenue by OS |
| UTM campaign performance data |
| Goal completion data |
| Visitors and revenue by hostname |
| Current real-time visitor count |
| Real-time visitor locations with recent events |
| Website metadata (domain, timezone, currency) |
Visitor Details
Tool | Description |
| Detailed visitor profile with identity, activity, and conversion predictions |
Tracking
Tool | Description |
| Track a custom goal completion |
| Track a payment event for revenue attribution |
| Link a visitor to a user in your system |
Data Management
Tool | Description |
| Delete goal events by date range, visitor, or goal name |
| Delete payment events by transaction ID, visitor, or date range |
Filtering
All analytics tools support powerful filtering:
UTM parameters:
utm_source,utm_medium,utm_campaign,utm_term,utm_contentTraffic sources:
ref,source,via,referrerContent:
page,entry_page,hostnameGeography:
country,region,cityTechnology:
browser,os,deviceDate range:
startAt,endAt(ISO 8601)Pagination:
limit,offsetTimezone:
timezone(IANA format)
Environment Variables
Variable | Required | Description |
| Yes | Your DataFast API key (starts with |
| No | API base URL (defaults to |
Development
# Install dependencies
npm install
# Build
npm run build
# Type check
npm run typecheck
# Run locally
DATAFAST_API_KEY=df_your_key node dist/index.jsTroubleshooting
"DATAFAST_API_KEY environment variable is required"
Ensure your AI client (Cursor, Claude Desktop, etc.) is configured to pass the DATAFAST_API_KEY in the env object. The key must start with df_.
"Invalid API key format"
DataFast API keys start with df_. Verify you copied the full key from the DataFast dashboard → Settings → API Keys.
MCP server not appearing in Cursor
Restart Cursor after adding the MCP config
Ensure the config file is at
.cursor/mcp.json(or the path your Cursor version expects)Check that
npxcan resolve@datafast/mcp-server(try runningnpx -y @datafast/mcp-serverin a terminal withDATAFAST_API_KEYset)
API errors
If you see DataFast API error (401), your API key may be invalid or expired. Generate a new key from the dashboard. For DataFast API error (403), check that your API key has the required permissions.
License
MIT
Available Tools
22 toolsdelete_goalsDelete Goal EventsA
Delete goal events. Filter by date range, visitor ID, or goal name. At least one filter must be provided.
Inputs: name, endAt, startAt, datafast_visitor_id.
delete_paymentsDelete Payment EventsA
Delete payment events. Filter by transaction ID, visitor ID, or date range. At least one filter must be provided.
Inputs: endAt, startAt, transaction_id, datafast_visitor_id.
get_browsersGet Visitors by BrowserB
Get visitor counts and revenue broken down by web browser (Chrome, Safari, Firefox, etc.).
Inputs: os, ref, via, city, +19 more.
get_campaignsGet Campaign/UTM DataA
Get visitor counts and revenue broken down by UTM campaign parameters (source, medium, campaign, term, content). Great for measuring marketing campaign performance.
Inputs: os, ref, via, city, +19 more.
get_citiesGet Visitors by CityA
Get visitor counts and revenue broken down by city.
Inputs: os, ref, via, city, +19 more.
get_countriesGet Visitors by CountryA
Get visitor counts and revenue broken down by country. Returns country name, flag image URL, visitor count, and revenue.
Inputs: os, ref, via, city, +19 more.
get_devicesGet Visitors by DeviceB
Get visitor counts and revenue broken down by device type (desktop, mobile, tablet).
Inputs: os, ref, via, city, +19 more.
get_goalsGet Goal CompletionsA
Get custom goal completion data including goal name, number of completions, and unique visitors who completed each goal.
Inputs: os, ref, via, city, +19 more.
get_hostnamesGet Visitors by HostnameA
Get visitor counts and revenue broken down by hostname (useful for multi-domain tracking).
Inputs: os, ref, via, city, +19 more.
get_metadataGet Website MetadataA
Get metadata about the tracked website including domain, timezone, name, KPI settings, and currency configuration.
Inputs: no named parameters.
get_operating_systemsGet Visitors by Operating SystemB
Get visitor counts and revenue broken down by operating system (Windows, macOS, iOS, Android, Linux, etc.).
Inputs: os, ref, via, city, +19 more.
get_overviewGet Analytics OverviewB
Get high-level analytics metrics including visitors, sessions, bounce rate, average session duration, revenue, revenue per visitor, and conversion rate. Returns aggregate data for the specified time period.
Inputs: os, ref, via, city, +17 more.
get_pagesGet Top PagesA
Get the most visited pages on the website, ranked by visitor count. Includes hostname, path, visitor count, and revenue attribution per page.
Inputs: os, ref, via, city, +19 more.
get_realtimeGet Real-time VisitorsA
Get the number of visitors currently active on the website in real time.
Inputs: no named parameters.
get_realtime_mapGet Real-time Visitor MapA
Get real-time visitor data with geographic coordinates for map visualization. Includes recent events, recent payments, and conversion predictions.
Inputs: no named parameters.
get_referrersGet Top ReferrersA
Get the top traffic referrers (sources linking to the website). Includes referrer URL, visitor count, and revenue attributed to each referrer.
Inputs: os, ref, via, city, +19 more.
get_regionsGet Visitors by RegionC
Get visitor counts and revenue broken down by region/state.
Inputs: os, ref, via, city, +19 more.
get_timeseriesGet Timeseries DataB
Get time series analytics data with configurable intervals (hour, day, week, month). Returns visitors, sessions, revenue, and conversion rate over time. Great for trend analysis and charts.
Inputs: fields (required), interval (required), os, ref, +21 more.
get_visitorGet Visitor DetailsA
Get detailed information about a specific visitor including their identity (country, browser, device), activity (visit count, page views, goals completed), and conversion predictions.
Inputs: visitorId (required).
identify_visitorIdentify VisitorB
Link a DataFast visitor to a user in your system. Associates the visitor ID with a user ID and optional metadata for enriched analytics.
Inputs: user_id (required), datafast_visitor_id (required).
track_goalTrack Goal CompletionB
Track a custom goal completion for a specific visitor. Goal names must be lowercase, alphanumeric with underscores/hyphens, max 64 characters.
Inputs: name (required), visitorId (required), metadata, description.
track_paymentTrack PaymentA
Track a payment event for revenue attribution. Links payments to visitors for conversion tracking.
Inputs: amount (required), currency (required), transaction_id (required), name, +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Most tools are clearly distinct, especially the get_* breakdowns which explicitly name their dimension (country, city, browser, etc.). Minor confusion could arise between get_realtime and get_realtime_map, but their outputs differ enough. The large family of similar analytics tools requires careful reading, but names and descriptions mitigate ambiguity.
All tool names follow a consistent lowercase_with_underscores pattern using verb_noun: get_* for retrievals, track_* for event creation, delete_* for deletions, and identify_visitor for association. This is highly predictable and consistent across the entire set.
At 22 tools, the server is on the heavier side but the count is justified by the wide range of analytics dimensions (countries, cities, browsers, devices, etc.) plus tracking and deletion operations. It exceeds the ideal 15-tool range but does not feel bloated for an analytics platform.
The analytics surface is broad, covering many breakdowns and real-time data. However, there are notable gaps: no get_payments to read payment events despite having delete_payments, and no list/search for visitors beyond fetching a single visitor by ID. These missing read operations create dead ends in the tracking lifecycle.
Related MCP Connectors
Query your Betterlytics web analytics from AI agents: traffic, funnels, journeys, errors, uptime.
AI access to Hitsteps analytics, live visitors, uptime, goals, alerts, and chats.
Marketing data and actions for AI agents: GA4, Search Console, ads, social, SEO and WordPress.
Ask your website analytics in plain language and set up funnels, features and dashboards.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Umami Analytics for both Cloud and self-hosted instances. It provides tools to retrieve website statistics, visitor metrics, pageview trends, and real-time active user counts.51MIT
- AlicenseAqualityCmaintenanceProvides AI assistants with read access to Clamp analytics data including pageviews, visitors, referrers, and custom events. Enables traffic analysis, conversion funnel evaluation, and metric alerts through natural language queries.3317 npm2MIT
- AlicenseAqualityDmaintenanceExposes Rybbit Analytics as MCP tools for querying site traffic, page views, visitor sessions, and live visitor counts through natural language.978 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables querying MRRscope analytics (visitors, revenue, MRR, traffic sources, AI crawlers, realtime) via 6 read-only tools for AI agents.6 npmMIT