Skip to main content
Glama

Weather MCP Agent

一个模块化、生产级的人工智能代理,提供实时天气预报。该项目采用模型上下文协议(MCP)模式、Google Gemini 2.0 Flash-Lite 提供智能支持,并使用 Streamlit 构建响应式用户界面。

项目概述

该应用作为一个智能代理,能够执行函数调用以检索实时气象数据。其构建注重 SOLID 原则、模块化和清晰架构。

Related MCP server: mcp-foundry

架构

  • 代理编排:使用 Google GenAI SDK 管理对话状态和工具执行。

  • 天气服务:用于外部 API 通信(Open-Meteo)的解耦服务层。

  • 界面:用于交互式天气查询的简洁 Streamlit 聊天界面。

项目结构

weather_mcp_project/
├── .env                  # Environment variables (API Key)
├── .gitignore            # Git exclusion rules
├── app.py                # Streamlit chat interface
├── requirements.txt      # Project dependencies
└── src/                  # Core application logic
    ├── agent_client.py   # AI Agent orchestration
    ├── config.py         # Pydantic-based configuration
    ├── mcp_server.py     # MCP tool definitions
    └── weather_service.py# External data integration

Related MCP Connectors

Related MCP Servers