How to replace your data analyst with Cursor and AI (in 20 minutes)

July 29, 2025 · 3 min read


Last week I spent 35 minutes interviewing a data analyst... and barely scratched the surface of how our platform and database work.
Huge waste of time.

In those same 35 minutes, I could’ve built a fully working web app end-to-end with AI—while having breakfast.

So I thought: What if I just unleash AI on data analysis?
Turns out… you can.

My goal: Extract actionable insights from Spotlight’s massive database of AI prompts, responses, brand mentions, cited websites, and more—for better brand visibility.

Here’s exactly how I did it:


1. Connect Cursor to Your Database via MCP

  • Download Cursor (any AI IDE like Windsurf should work too).
  • In Cursor, head to:
    Settings > Cursor Settings > Tools & Integrations > New MCP Server

This opens a JSON editor where you’ll drop your database credentials.

Where do you get MCP connection details?
Depends on your database provider. Most modern DBs support MCP out of the box.
If yours doesn’t, it’s ridiculously easy to spin one up locally. Ask Claude to build you a quick MCP server—it’ll even tell you how to run it.

Once connected, you’ll see a green dot. Click the 'X tools enabled' to see what access the MCP has on your database.
The one you must have is:
execute_sql → lets Cursor run SQL queries directly.

2. Ask Cursor to Map Your Database

Create a new text file (call it instructions.txt or whatever) and drop in this prompt.
Use Agent Mode—preferably with Cursor 4 (but Gemini 2.5 or OpenAI o3 also work great).

Connect to the DB using MCP. Study the table structure and relationships.  
Write into the document a description of the tables along with data samples.  
If a column is complex (JSON or arrays), fetch a few row samples and show examples of the values.  
Write this description as a guide for future prompts to query the database for insights and actions. 
Output the guide into @instructions.txt

When it’s done, you’ll have a clean document describing your DB structure + sample data.


3. Add Your Business Context

Next, feed Cursor a description of your business and objectives (grab an existing doc, or have Gemini/Perplexity generate one).
Paste it at the top of your instructions file using this prompt:

Add to the top of the file a description of my business and objectives:  
[paste business description + objectives]

Boom. Now Cursor understands both your data and what you actually care about.

4. Query the Database for Insights

Time for the fun part.
I used Claude 4 in Agent Mode, with the instructions file as context. Here’s the prompt (modify according to your needs):

Connect to the DB via MCP.  
Based on the instructions file, query and analyze data and extract 
[10 generic actionable insights that could help marketers improve their brand visibility in AI chatbots].  

For each insight, show me the underlying data + calculations used.  
Write the results into a new file. 

Where to Go From Here

Now you’re basically unlimited:

  • Open new chats, just remember to attach your instructions.txt (or make it a global rule).

  • Always use Agent Mode (MCP won’t work otherwise).

  • Try different models:

    • Gemini 2.5 → giant context window.
    • OpenAI o3 → ridiculously sharp reasoning.
    • Claude → fast and reliable.

Discover something cool?
Hit me up → [email protected]

About the Author

Michael Hermon

Founder of Spotlight. Head of AI brand visibility research and product. Previously led AI and innovation at monday.com