How to add web analytics to Cursor

You already have your codebase in Cursor. You have a terminal. You have whatever context you've fed the agent. What you probably don't have is your traffic data. Add Lodd's MCP server and your agent gets 42 tools for querying traffic, sources, funnels, custom events, and page performance. The setup takes about two minutes through either Cursor's UI or a config file, and works on the free tier up to 2,500 events per month.

With analytics connected, Cursor's agent can answer questions like "which pages get the most traffic" or "is the new component slowing down that page" without you switching to a browser dashboard. The data just becomes part of the conversation.

How do you add an MCP server to Cursor?

Cursor has two ways to add MCP servers: through the settings UI and through a config file. Both achieve the same result. The settings UI is quicker for a first setup, and the config file is better if you want the server available across projects or committed to your repo.

Through the settings UI: Open Cursor Settings (Cmd+Shift+J on Mac, Ctrl+Shift+J on Windows), go to the MCP section, and click "Add new MCP server." Set the type to "command," the name to "lodd," and the command to:

npx -y @lodd/mcp-server

Then add an environment variable LODD_API_KEY with your API key from lodd.dev.

Through a config file: Create a .cursor/mcp.json file in your project root (or ~/.cursor/mcp.json for global access):

{
  "mcpServers": {
    "lodd": {
      "command": "npx",
      "args": ["-y", "@lodd/mcp-server"],
      "env": {
        "LODD_API_KEY": "your_api_key"
      }
    }
  }
}

After adding the server, Cursor shows a green indicator when the MCP server is connected and the tools are loaded. If you see a red indicator, check that Node.js is installed and the API key is correct.

How do you get a Lodd API key?

Sign up at lodd.dev with your email. You'll get a 6-digit verification code. Once signed in, create an API key from the dashboard. The key starts with ca_ and is shown once, so save it immediately.

You also need to add a tracking script to your site so there's data to query. Create a site in the Lodd dashboard, copy the script tag, and add it to your HTML <head>. The script is about 2KB, uses no cookies, and starts collecting pageviews immediately.

Alternatively, if you're using Claude Code as well, it can handle the whole setup and let you check traffic from the terminal; the API key it generates works in Cursor too.

What can you query from Cursor's agent?

Once the MCP server is connected, Cursor's agent can call any of the 42 tools through natural language. The agent picks the right tool based on what you ask. Some practical examples:

  • "How many visitors did the site get this week?" — the agent calls get_analytics with a 7-day period and returns visitors, pageviews, bounce rate, and average duration compared to the previous week.
  • "Which pages have the highest bounce rate?" — calls get_pages and sorts by bounce rate.
  • "Show me traffic sources for the last 30 days" — calls get_traffic_sources with referrer, UTM, and trackable link breakdowns.
  • "What's the conversion funnel from the landing page to signup?" — calls get_funnel with the steps you specify.
  • "Are there any real-time visitors right now?" — calls get_realtime and returns active visitors in the last 5 minutes.

Every query supports filters for country, browser, OS, device type, UTM source, and referrer. Periods range from "today" to custom date spans. The responses come back as compact JSON that the agent interprets and summarises for you.

How does this compare to Claude Code's MCP support?

The MCP server itself is identical. Same 42 tools, same config format, same API key. The differences are in how the two editors handle MCP: Claude Code uses a .mcp.json file at the project root, Cursor uses .cursor/mcp.json or the settings UI. Claude Code also supports agent-driven setup where the agent writes the config and handles authentication for you, which Cursor's agent can't do because it doesn't have the same file-writing permissions during MCP configuration.

In practice, the experience is very similar. You ask a question about traffic, the agent calls the right tool, and you get the answer. The only difference is where you put the config file.

What does the agent do with traffic data while you're coding?

Checking pageviews from Cursor is useful on its own, but the real benefit is that traffic context is available while the agent is already helping you write code. A few examples of how this works in practice:

Design decisions with data. You're choosing between two layout approaches for a component. Ask "what's the bounce rate on pages using the card grid vs the list view?" The agent calls get_pages filtered to the relevant routes and gives you actual engagement numbers to inform the design, not just aesthetics.

Component-level performance. You refactored a heavy component and want to know whether it helped. Ask "compare load times on /dashboard this week vs last week, broken down by device." The agent calls get_performance with the right filters and tells you whether mobile p95 improved, while you're still in the component file.

Validating a new feature. You shipped a feature behind a new route and want to see if people are finding it. Ask "how many visitors hit /features/export since Monday, and where are they coming from?" The agent calls get_pages and get_traffic_sources with a date filter, giving you adoption data alongside the code you're still iterating on. If the route depends on search traffic, connecting Google Search Console as well lets the agent see what it ranks for, not just who arrived.

What does it cost?

Free up to 2,500 events per month across all your sites. Pageviews and custom events count towards the same limit. The paid plan is €9.99/month for 100,000 events. All 42 tools are available on both tiers. There's a hard stop at the limit, not an overage charge.

What are the limitations?

No dashboard. Lodd is designed for agents, not browsers. The analytics are read-only: Lodd provides data, and your agent or other tools handle the actions. Worth noting that anyone on your team can ask Claude Desktop or claude.ai "how's our traffic this week" and get a plain-English summary, so the lack of a visual dashboard matters less than you might expect. Privacy defaults are strict: no cookies, country-only geolocation, IP hashing with a daily-rotating salt. Good for GDPR compliance, but it means you won't get city-level location data or persistent user tracking across sessions.