from mcp.server.fastmcp import FastMCP
mcp = FastMCP("Weather Service")
@mcp.tool()
def get_weather(location: str) -> str:
"""Get the current weather for a given location."""
# In a real implementation, this function would call a weather API.
return f"The current weather in {location} is sunny with a temperature of 25°C."
if __name__ == "__main__":
mcp.run()
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/sritajkumarpatel/learn_mcp_2025'
If you have feedback or need assistance with the MCP directory API, please join our Discord server