An MCP-powered Voice Agent

...powered by Qwen 3 LLM.

👉
Hey! Enjoy our free data science newsletter! Subscribe below and receive a free data science PDF (530+ pages) with 150+ core data science and machine learning lessons.

TODAY'S ISSUE

TODAY’S DAILY DOSE OF DATA SCIENCE

An MCP-powered Voice Agent

Today, we are releasing another MCP demo, which is an MCP-driven voice Agent that queries a database and falls back to web search if needed.

Here’s the tech stack:

Let’s go!

Here's our workflow:

  • The user's speech query is transcribed to text with AssemblyAI.
  • Agent discovers DB & web tools.
  • LLM invokes the right tool, fetches data & generates a response.
  • The app delivers the response via text-to-speech.

Let’s implement this!

We have added a video below that gives a complete walkthrough of this demo.

0:00
/0:52

The GitHub repo with code and instructions is linked later in the issue.

Implementation details

An MCP-powered Voice Agent

Now, let's dive into the code!

Initialize Firecrawl & Supabase

We instantiate Firecrawl to enable web searches and start our MCP server to expose Supabase tools to our Agent.

Image

Define web search tool

We fetch live web search results using Firecrawl search endpoint. This gives our agent up-to-date online information.

Image

Get Supabase MCP Tools

We list our Supabase tools via the MCP server and wrap each of them as LiveKit tools for our Agent.

Image

Build the Agent

We set up our Agent with instructions on how to handle user queries.

We also give it access to the Firecrawl web search and Supabase tools defined earlier.

Image

Configure Speech-to-Response flow

Image
  • We transcribe user speech with AssemblyAI Speech-to-Text.
  • Qwen 3 LLM, served locally with Ollama, invokes the right tool.
  • A voice output is generated via TTS.

Launch the Agent

We connect to LiveKit, start our session with a greeting, then continuously listen and respond until the user stops.

Image

Done! Our MCP-powered Voice Agent is ready.

0:00
/0:52
  • If the query is related to a database, it queries Supabase via MCP tools.
  • Otherwise, it performs a web search via Firecrawl.

You can find the code to reproduce this demo in this GitHub repo →

Thanks for reading!

THAT'S A WRAP

No-Fluff Industry ML resources to

Succeed in DS/ML roles

At the end of the day, all businesses care about impact. That’s it!

  • Can you reduce costs?
  • Drive revenue?
  • Can you scale ML models?
  • Predict trends before they happen?

We have discussed several other topics (with implementations) in the past that align with such topics.

Here are some of them:

  • Learn sophisticated graph architectures and how to train them on graph data in this crash course.
  • So many real-world NLP systems rely on pairwise context scoring. Learn scalable approaches here.
  • Run large models on small devices using Quantization techniques.
  • Learn how to generate prediction intervals or sets with strong statistical guarantees for increasing trust using Conformal Predictions.
  • Learn how to identify causal relationships and answer business questions using causal inference in this crash course.
  • Learn how to scale and implement ML model training in this practical guide.
  • Learn 5 techniques with implementation to reliably test ML models in production.
  • Learn how to build and implement privacy-first ML systems using Federated Learning.
  • Learn 6 techniques with implementation to compress ML models.

All these resources will help you cultivate key skills that businesses and companies care about the most.

Our newsletter puts your products and services directly in front of an audience that matters — thousands of leaders, senior data scientists, machine learning engineers, data analysts, etc., around the world.

Get in touch today →


Join the Daily Dose of Data Science Today!

A daily column with insights, observations, tutorials, and best practices on data science.

Get Started!
Join the Daily Dose of Data Science Today!

Great! You’ve successfully signed up. Please check your email.

Welcome back! You've successfully signed in.

You've successfully subscribed to Daily Dose of Data Science.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.