iTranslated by AI
Building an MCP Server from Scratch: Experience the Ease of Development and the Next Challenge
Introduction
Hello. My learning of MCP (Model Context Protocol) has finally moved from the "utilization" phase to the "development" phase.
I thought MCP server development would be difficult, but by following the quickstart in the official documentation, I was able to create an MCP server and make it available in Claude Desktop much more easily than expected.
In this post, I will summarize the ease of the FastMCP SDK, which is the core of development, the environment setup hurdles I faced, and my next goal of building a "Japanese version Weather server."
1. Barriers to MCP Server Development and the Power of FastMCP
MCP servers operate as external functions for AI agents. While the barriers to server development may seem high, the Python SDK FastMCP significantly lowers that difficulty.
🛠️ How FastMCP Simplifies Development
The greatest advantage of FastMCP is that it automatically generates tool definitions using Python type hints and docstrings.
Use of decorators: By simply adding the @mcp.tool() decorator to a function, tool definition is completed without being conscious of MCP's complex specifications.
Code simplification: If implemented from scratch without using the SDK, it would be necessary to create multiple endpoints compliant with MCP specifications, which increases the development burden.
🔨 Quickstart Environment Setup
Before starting development, I set up the project environment using the following steps.
Project creation (Command Prompt / Terminal): Created a project with uv init weather and established a virtual environment with uv venv.
Installing dependencies (Command Prompt / Terminal): Installed the MCP SDK and network library with uv add mcp[cli] httpx.
Note: Temporarily change the PowerShell execution policy so that the virtual environment activation script (.venv\Scripts\activate.ps1) can be executed.
Running the server (Claude Desktop): Write the code in the weather.py file and add the JSON configuration to Claude Desktop.

⚠️ Setup hurdles: I spent some time editing the JSON file at server startup (managing indentation and commas), which reminded me once again that strict environment configuration is the key to success.
2. Practical Demo: Verification of the US Version Weather Server
The Weather server created in the quickstart provides two tools: get_alerts (acquiring alerts) and get_forecast (acquiring forecasts), utilizing the US NWS (National Weather Service) API.
Workflow (Example: Weather in Las Vegas)
Question: A user asks, "What is the weather in Las Vegas today?"
Inference: Claude analyzes the available tools and selects the get_forecast tool.
Tool Execution: The client executes get_forecast through the MCP server (passing Las Vegas coordinates as arguments).
Data Retrieval: A helper function within the server sends a request to the NWS API.
Response: Based on the retrieved results, Claude generates a response in natural language.

Demo Results: Claude accurately answered the high temperature, wind speed, weather, and chance of precipitation for Las Vegas. This demonstrates that the AI completely integrates external logic and data, functioning autonomously.
3. Next Challenge: Building a Japanese Version Weather Server
The success of the quickstart made me realize that the difficulty of server development has decreased. However, this US version server does not support Japanese weather.
My next goal is to apply this successful experience to create a custom Japanese version Weather server.
Goal: Create a tool that utilizes the Japan Meteorological Agency's (JMA) Disaster Prevention Information XML format (PULL type) data to retrieve weather forecasts within Japan.
Challenge: Since parsing the JMA's XML is complex, I will resolve data processing challenges by referring to existing Python tutorials (e.g., aitc-api-tutorial-jma).
By taking the first step into MCP server development, I have seen the great potential to localize AI agent functions to meet my own needs. Next time, I would like to share the record of this challenge.
References
Discussion