Using Model Context Protocol to connect AI to databases
Dan Byler taught me to use MCP to have AI generate visualizations directly from a SQL database. How this works:
Instead of loading large amounts of data into context (bad idea) Claude writes SQL queries and runs them on the database, and then gets back the aggregated results
I can ask Claude for ideas for analyses to run! Claude can read the schema.
Claude can visualize the results (!!)
âŠand all of this without knowing any context on the business. Imagine what it could do with a little bit of background on strategy, target customer, metrics, or past experiments.As a product manager: Just like with AI prototyping, this allows me to iterate a lot faster on ârough draftsâ of analyses with myself and sharpen my ask. It also allows me to explore moonshot ideas I wouldnât waste scarce analyst time for.For product analysts: Product analysts can expect PMs who know what they want, and spend far less time iterating on things that could have been figured out ahead of time. They can focus more on higher level work like making sure weâre asking the right question, answering with the right business context, and quantitative integrity.
If youâre reading this, youâre in the top 5% of people leaning into AI agents for real work (even if it doesnât feel that way, trust me).To go deeper, join me for a live, hands-on workshop. To get your team on board, book an AI build sprint.