Loading video player…

Setting Up for MCP

00:00 In this video course, the example MCP server you’re building is going to expose sales data to an LLM. That’s the example you’re going for. And in order to get there, you’re going to need to set up a couple of things.

00:15 First, you’re going to create a uv project, which is where you’ll have your code and where you’re going to manage the dependencies, namely on the package mcp, which is the Python package that allows you to create MCP servers. You’re going to install the mcp dependency in that project, and then you’re going to download the file sales.csv from the downloadable materials for this course.

00:40 This file sales.csv is a fake CSV file with some dummy data that’s just there to help you materialize the example so that you’re not creating an MCP server that does nothing.

00:55 To create the uv project, go ahead and open your terminal and run the command uv init mcp-data. This will create a project called mcp-data inside the current directory, so you press enter and then you can cd into mcp-data.

01:11 If you list the contents of the directory, you will see a couple of files and folders. main.py is the file where you’ll write your code and pyproject.toml is a file that contains some metadata about your projects.

01:24 Now don’t worry too much about the structure of this folder, but if you want to learn more about how to use uv to manage Python projects, Real Python has a great video course on this that was also recorded by yours truly.

01:36 If you don’t want to use uv, feel free to set up a project with whatever tool you want, but the most important thing is that you have a way to install the package mcp in an isolated environment.

01:50 That could be a pip install into a virtual environment you created, that could be adding a dependency to whatever project management tool you’re using.

01:58 If you’re using uv, all you have to do is write uv add mcp. You press enter, you give it a couple of seconds, and the dependency is installed along with its transitive dependencies. So every package that mcp depends on was also installed.

02:17 After you set up the project and the dependencies, you’ll want to download the file sales.csv and you’ll want to put it in this directory under a subfolder called data.

02:30 So go ahead and run mkdir data and then you want to copy the sales file into or download the sales file into that folder. Once you’ve downloaded the file and copied it into the directory data, you can cd into data and then you can run the command cat sales.csv to take a quick look at the file.

02:54 As you can see, it’s a very short file. It only has two columns, Customer and Amount, and it lists some imaginary sales that were made to some customers for a certain amount. And this is the dummy data you’re going to use to test your MCP server later on.

03:10 When you’re ready to start developing the MCP server, meet me in the next lesson.

Become a Member to join the conversation.