TNS
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
NEW! Try Stackie AI
AI / AI Agents / Software Development

Tutorial: Build a Simple MCP Server With Claude Desktop

We walk you through the step-by-step process of building an MCP server and integrating it with Claude Desktop.
May 7th, 2025 4:00pm by
Featued image for: Tutorial: Build a Simple MCP Server With Claude Desktop
Photo by Danielle-Claude Bélanger on Unsplash.

In the previous part of this series, I introduced the basic concepts of Model Context Protocol (MCP) — an open standard designed to streamline how AI models interact with external tools, data sources and resources. In this installment, I’ll walk you through the step-by-step process of building an MCP server and integrating it with Claude Desktop.

We’ll use Python and FastMCP 2.0 to build an MCP server that utilizes the FlightAware API. For more information on FlightAware, refer to the previous tutorial, where I integrated it with large language model (LLM) tools. Ensure that you have a valid FlightAware API key before proceeding.

In subsequent parts of this series, I’ll demonstrate how to extend this to work with AI agents built with OpenAI Agents SDK and Google Agent Development Kit (ADK).

Step 1: Setting Up the Environment

Let’s start by creating a virtual environment and installing the required Python modules:


Step 2: Building the MCP Server

First, import the required Python modules in the code:


The next step is to create the MCP object from FastMCP:


We’ll then create a function and decorate it with the @mcp.tool() annotation to explicitly identify it as a tool:


The last step is to create the main function to run the server if it’s executed directly:


That’s it! We’re done building our first MCP server. It’s time to put it to the test by integrating it with Claude Desktop.

Step 3: Integrating With Claude Desktop

Ensure you have the latest version of Claude Desktop. Open the Settings menu to access the Developer tab:

Click on the Edit Config button to access the MCP settings file named claude_desktop_config.json.

Open the file in your favorite editor and add the following content:


Replace the path with the absolute path to your Python environment and MCP server and save the file.

Restart Claude, and you should now find your MCP server within the settings option.

Make sure it’s turned on. Now we’re all set to use our MCP server from Claude.

It’s time to test the MCP server by asking Claude about a flight schedule. Claude will ask for your permission to access a third-party service.

Once you allow it, Claude will invoke the MCP server and fetch the data, which acts as the context to the original prompt.

As we can see from the output, Claude invoked the MCP server to fetch the real-time status. Note that we are using the STDIO transport.

You can find the entire code in the Gist below:

In upcoming articles in this series, we’ll explore how to use other transport protocols, including streamable HTTP transport. Stay tuned!

Created with Sketch.
TNS owner Insight Partners is an investor in: OpenAI.
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.