Everybody is talking about MCP or Model Control Protocol. Here I am going to share my understanding of:
- What is MCP?
- How to create a MCP server
- Call MCP server from Claude Desktop app.
I can say that this is the first time I am using Claude desktop and MCP.

What is MCP?
MCP or model control protocol – is compared to USB C – is a brand new protocol to make communication between LLM applications and external resources. Simply put, it’s like enhanced version of API or Application Programming Interfaces.
Think of it this way: you know how APIs work – you build endpoints, expose functions, and applications call them. MCP works exactly the same way, but it’s designed specifically for AI applications. Existing API designs follow very strict schema structures, but LLM applications use natural language, so traditional APIs can restrict the capabilities of AI applications. MCP is introduced by Anthropic, the company behind Claude language model, to solve this problem.
Based on my understanding, MCP creates a standardized protocol that allows large language models to access various resources, from databases and file systems to external services like weather APIs, financial data feeds, and business applications.. This means if anybody wants to build resources to be consumed by LLM applications, or expose existing resources to be accessed by LLM applications, then you need to build an MCP server and expose it. Like APIs provide multiple functions, MCP servers can provide multiple tools.
To explain this, I created a simple MCP server which provides three tools:
- Add two numbers
- Multiply two numbers
- Calculate area of a rectangle
To make calls to the MCP server, I used Claude desktop. You can test MCP servers from your code, but I thought using Claude Desktop is easier for testing the MCP server.
If you don’t know what Claude Desktop is, it’s like ChatGPT or Google Gemini App but uses Anthropic’s Claude language model. Claude desktop allows you to configure and call MCP servers directly from the chat window. Remember how we use Postman app to test APIs? Similarly, we can use Claude desktop to test calls to MCP server tools.
Creating My First MCP Server
Now let’s create an MCP server.
First, I installed two packages:
pip install mcp[cli]
pip install fastmcp
I used FastMCP to create the MCP server because it makes building MCP servers really easy. Here’s how I started:
import sys
from mcp.server.fastmcp import FastMCPimport sys
# Create an MCP server
mcp = FastMCP("MyFristMCPServer")
FastMCP is a framework that simplifies creating MCP servers – think of it like Flask for APIs, but for MCP.
Next, I added three functions (tools) using simple decorators:
# Create an MCP server
mcp = FastMCP("Demo")
Now I added three functions (tools) for addition, multiplication and to calculate area of rectangle
# addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
return a + b
# multiplication tool
@mcp.tool()
def multiply(a: int, b: int) -> int:
return a * b
# area calculation tool
@mcp.tool()
def calculate_area(length: float, width: float) -> float:
return length * width
Notice how similar this is to creating API endpoints? The @mcp.tool() decorator is like @app.route() in Flask – it exposes the function as a tool that AI models can call.
The final step is running the server:
# actually run the server!
if __name__ == "__main__":
print("Running MCP server...", file=sys.stderr)
try:
mcp.run()
except Exception as e:
print(f"Server error: {e}", file=sys.stderr)
Now let us run the server from command line
> python server.py
Starting MCP server...
Running MCP server...
And that’s it! Your MCP server is now running and ready to accept connections.
Connecting the MCP Server to Claude Desktop
As I said earlier, I installed Claude Desktop. Now I need to tell Claude Desktop about all the available MCP servers, right?
For that, you need to look for the claude_desktop_config.json file in your AppData folder:
%AppData%\Claude\claude_desktop_config.json file.
I think you can specify any external MCP server info in this file – I haven’t tried connecting to remote servers yet though.
For my local server, there are only two things you need to specify: the path to your python.exe and a reference to your server.py file.
Here is the info I added
{
"mcpServers": {
"MyFirstMCPServer": {
"command": "path\\to\\your\\python\\python.exe",
"args": [
"path\\to\\your\\server.py"
]
}
}
}
Make sure to replace “path/to/your/server.py” with the actual path to where you saved your MCP server file. Note that once your MCP server is configured in Claude Desktop’s config file, it automatically starts and manages the server for you – no need to manually run python server.py
anymore.
Once you update this config file, restart Claude Desktop, and it should automatically connect to your MCP server when you start a new chat.
Testing Your MCP Server
Now open Claude Desktop app. You’ll get errors if any configuration issues occurred. For any errors during configuration or while making calls to your MCP server, you can check the log files in:
%AppData%\Claude\logs folder
These logs are really helpful for debugging what’s going wrong.
Once Claude Desktop opens without errors, click on ‘Search and Tools’ to see all the MCP servers you added in the config file. You should see your “MyFirstMCPServer” listed there.

Click on the server name ‘MyFirstMCPServer’ to see all the available tools (functions) in the server.

Alright, now let’s see how Claude desktop make call to our server.
I asked: ‘What is 2+2’
Earlier I mentioned Postman App for testing APIs but how Clade Desktop makes calls to MCP server is different. See the workflow below:
User Message → LLM (Claude) → Tool Decision → MCP Call → LLM → Response
Here’s what happens step by step:
You send a prompt message in Claude Desktop
Claude Desktop sends the prompt to the LLM (Claude) for a response. While sending the prompt, Claude Desktop also sends information about the MCP server and available tools along with the prompt request.
Now the LLM receives both the request and available tool info, right? So the LLM makes a decision: should it get the actual answer directly or make a call to the MCP server?
In my request “What is 2+2?”, the LLM decided: “Oh, I need to calculate the sum of two numbers, so I will need to call the tool for addition.” As instructed by the model, Claude Desktop made a call to MyFirstMCPServer’s add function.
When Claude Desktop makes a call to the server, you will see a popup.

See, it’s calling the add tool of my MyFirstMCPServer. If you don’t want to see this popup every time, just click “Allow Always.”
The MCP server responds with the answer.
Now Claude Desktop makes another call to prepare the formal response.
That’s what you see on the screen – the final formatted result.

The same thing happened when I asked:
What is the area of a rectangle, l=10 and b=4?
So what’s happening here?
It depends on the request – the model checks the available tools and decides if it needs to make a call to any tool.
Like this, you can configure Claude Desktop to use external MCP servers to get weather information or currency conversion or anything else. You can also create MCP servers for your internal resources like databases to get necessary information.
Making Your MCP Server Accessible from Outside
MCP servers are designed to run locally—often on localhost
—to securely connect AI applications like Claude Desktop to your system and tools. If external access is needed, you can expose your MCP server by adding a web layer like Flask or FastAPI that creates HTTP endpoints.
Look, I’m probably oversimplifying MCP a bit, but honestly, this is how I learned it and it makes sense to me!
I’ll write another article to explain how to call MCP servers directly from Python code.