Skip to main content
Glama

Weather MCP

by kaisumi
mcp_server.py652 B
from mcp import Implementation from mcp.server.fastmcp import FastMCP from app.weather_service import WeatherService implementation = Implementation( name="Weather MCP Server", version="0.1.0" ) mcp = FastMCP(implementation) weather_service = WeatherService() @mcp.tool() async def get_weather(city: str) -> dict: """指定した都市の天気情報を返すTool""" if not city: return {"error": "都市名が指定されていません"} try: result = await weather_service.get_weather_for_city(city) return result except Exception as e: return { "error": str(e) }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kaisumi/weather-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server