mcp-server
About
mcp-server is a Python-based MCP (Model Context Protocol) server example that provides two simple tools: BMI calculation and weather retrieval. It demonstrates how to build an MCP server using the fastmcp library.
Details
- Author
- zusdn90
- Downloads
- 273
- Categories
- Other
Jump to
- BMI calculator from weight and height
- Weather lookup by city name
- Built with Python and fastmcp
- Uses httpx for async HTTP requests
- Demonstrates MCP tool definition and execution
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
mcp-serverCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install dependencies (pip install httpx fastmcp), then run the server with python server.py. The server exposes two tools: calculate_bmi (takes weight in kg and height in m, returns BMI) and fetch_weather (takes a city name, returns current weather via a mock API endpoint).
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp-server": {
"mcp-server-zusdn90": {
"command": "python",
"args": [
"server.py"
]
}
}
}
}
McpServers
{
"mcp-server-zusdn90": {
"command": "python",
"args": [
"server.py"
]
}
}
mcp-server
Python 기반 MCP 서버 예제
주요 기능
- BMI 계산: 체중(kg)과 키(m)를 입력받아 BMI(체질량지수)를 계산합니다.
- 날씨 조회: 도시명을 입력받아 해당 도시의 현재 날씨 정보를 조회합니다.
사용 예시
1. BMI 계산
@mcp.tool()
def calculate_bmi(weight_kg: float, height_m: float) -> float:
""" Calculate the BMI given weight in kg and height in meters"""
return weight_kg / (height_m ** 2)
2. 날씨 조회
@mcp.tool()
async def fetch_weather(city: str) -> str:
""" Fetch current weather for a city"""
async with httpx.AsyncClient() as client:
response = await client.get(f"https://api.weather.com/{city}")
return response.text
실행 방법
1. 의존성 설치
pip install httpx fastmcp
2. 서버 실행
python server.py
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



