Custom MCP Servers using FastMCP and Python
Model Context Protocol (MCP) is trending all over the internet, which has given a new boost to the AI agents’ revolution. In this tutorial, I will be explaining to you how you can create your own custom MCP server for free using Python and Fast MCP.
What is Model Context Protocol?
What is the Model Context Protocol (MCP)?
Let’s get started
https://medium.com/media/dc4ad4374e85fb6d4ea84f52f71cc6c6/href
Step 1: Run the following commands to get started with UV
npm install uv
uv init
uv add "mcp[cli]"
pip install mcp fastmcp
uv run mcp
Step 2: Create your server file. Name it “server.py”
# demo.py
from fastmcp import FastMCP
mcp = FastMCP("Demo")
@mcp.tool()
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
@mcp.tool()
def subtract(a: int, b: int) -> int:
"""Add two numbers"""
return a - b
The above script adds two MCP Tools for Claude AI, i.e. add and subtract
Step 3: Install the server file
mcp install server.py

Note: If using Windows, you need to change certain things in the config.json for Claude. Do check out the above video to note the changes.
Step 4: End Claude AI from Task Manager. This is very important.
Step 5: Re-launch Claude AI, and now you should be able to see your custom tools in the MCP tools.

That’s it! Within just five minutes, you should be able to add up custom tools to Claude AI, and now Claude AI will be able to use them.
https://medium.com/media/c9493a5ea965e5e224f02c2feb3004fc/hrefhttps://medium.com/media/ce74d190fe6ba83e69de581b691a707b/href
How to Create Custom MCP Servers for Free? was originally published in Data Science in Your Pocket on Medium, where people are continuing the conversation by highlighting and responding to this story.