chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:31:35 +08:00
commit c275ba2868
13613 changed files with 2980806 additions and 0 deletions
@@ -0,0 +1,18 @@
import os
import sys
from server import server
if __name__ == "__main__":
"""Main entry point"""
transport_type = sys.argv[1] if len(sys.argv) > 1 else None
server.settings.log_level = os.environ.get("LOG_LEVEL", "DEBUG")
if transport_type == "sse":
port = int(os.environ.get("PORT", 3001))
server.settings.port = port
server.settings.host = "127.0.0.1"
server.run(transport="sse")
elif transport_type == "stdio":
server.run(transport="stdio")
else:
print("Invalid transport type. Use 'sse' or 'stdio'.")
sys.exit(1)
@@ -0,0 +1,26 @@
import json
import random
from mcp.server.fastmcp import FastMCP
# Initialize FastMCP server
server = FastMCP("weather_mcp")
@server.tool()
async def get_weather(location: str) -> str:
"""Get weather for a location.
Args:
location: Location to get weather for, e.g., city name, state, or coordinates
"""
if not location:
return "Location is required."
# mock weather data
conditions = [ "Sunny", "Rainy", "Cloudy", "Snowy" ]
weather = {
"location": location,
"temperature": f"{random.randint(10, 90)}°F",
"condition": random.choice(conditions),
}
return json.dumps(weather, ensure_ascii=False)