

TODAY'S ISSUE
TODAY’S DAILY DOSE OF DATA SCIENCE
[Hands-on] Building an MCP Server (100% locally)
Lately, there has been a lot of buzz around MCPs. We also covered it in a recent newsletter issue.
So today, let’s dive into the implementation.
Here's what we'll be doing:
- Understand MCP with a simple analogy.
- Build a local MCP server and interact with it via Cursor IDE.
- Integrate ​Firecrawl’s MCP server​ and interact with its tools (shown in the video above).
Let's dive in!
But first, let's understand MCP using a translation analogy.
MCP analogy
Imagine you only know English.
To get info from a person who only knows:

- French, you must learn French.
- German, you must learn German.
- And so on.
Learning even 5 languages will be a nightmare for you!
But what if you add a translator that understands all languages?

- You talk to the translator.
- It infers the info you want.
- It picks the person to talk to.
- It gets you a response.
The translator is like an MCP!
It lets you (Agents) talk to other people (tools) through a single interface.
In the context of Agents, integrating a tool/API demands reading docs, writing code—similar to learning a language.
To simplify this, platforms now offer MCP servers. Devs can plug them, and Agents can use their tools/APIs instantly.

Here's how Agents use it:
- Agent realizes it needs more info.
- It contacts the MCP server, which returns the relevant tool + expected input.
- Agent prepares the function call.
- MCP server runs it and returns the output.
- Agent uses the output.
MCP server
​Local implementation
Next, let’s build an MCP server!
Launch an MCP server
First, we define an MCP server with the host URL and port.

Define tool
A tool exposed through an MCP server has two requirements:
- It must be decorated with the "tool" decorator.
- It must have a clear docstring.
Say through our MCP server, we want to expose a tool to count "r"s in a string.
Here’s the code for this tool👇

Integrate MCP server with Cursor
In this case, Cursor is an MCP host/client that will use the tools exposed by the MCP server.
To integrate the MCP server, go to Settings → MCP → Add new global MCP server.
In the JSON file, add what's shown below👇

Done! Your local MCP server is live and connected to Cursor!
Check this👇

Next, let's interact with the MCP server.
As shown in the video below, when asked to count the number "r"s in strawberry:
- It identified the MCP tool.
- Prepared the input argument.
- Invoked the tool.
- Used the tool's output to generate a response.
MCP server
Integrating Firecrawl
Let's make this more practical and realistic by integrating ​Firecrawl's MCP server​ to utilize scraping tools.
To do this, go to Settings → MCP → Add new global MCP server.
In the JSON file, add what's shown below👇

Once done, you will find all the tools exposed by Firecrawl's MCP server your Agents can use!

Notice that we didn't write a line of Python code to integrate Firecrawl's tools. Instead, we just integrated the MCP server.
Next, let's interact with this MCP server.
As shown in the video, when asked to list the imports of CrewAI tools listed in my blog:
- It identified the MCP tool (scraper).
- Prepared the input argument.
- Invoked the scraping tool.
- Used the tool's output to generate a response.
That was simple, wasn’t it?
👉 Over to you: Do you think MCP is more powerful than traditional API setup?
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.
SPONSOR US
Advertise to 600k+ data professionals
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.