数学与天气服务聚合器

一个聚合数学计算和天气查询的服务,通过数学服务器计算结果并传递给天气服务器获取天气信息。

  • by kasinathnalla
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 kasinathnalla/mcp-add-weather

使用说明

我用紫外线作为虚拟环境

我的客户 llm 将调用Math Server以获取加法和乘法,然后将值从Math Server传递给天气服务器以获取天气详细信息。

所有人:

  • 返回邮政编码,而不是返回多个位置。将该邮政编码传递给天气服务器以获取天气结果。
  • 请创建.env文件并添加 GROQ_API_KEY=“您的钥匙”

运行命令 ```如果你没有pyproject.toml,或者你是从头开始做的,那么就启动uv init。

开放1号航站楼运行天气

uv venv source .venv/bin/activate uv add -r requirements.txt python weather.py

打开终端2运行聚合添加和天气的客户端

uv venv source .venv/bin/activate uv add -r requirements.txt python client.py 或 python client_local_ollama.py 用于本地

在当地跑步

安装Ollama。安装Ollama后,请运行以下命令进行验证 ollama run llama3 如果它奏效了,那么我们就可以出发了。


输出


1. **Add 3 and 5**:  
   \( 3 + 5 = 8 \)

2. **Multiply the result by 12**:  
   \( 8 \times 12 = 96 \)

**Final Answer:**  
\boxed{96}
Extracted number : 96
Weather Answer: The weather in location 96 is **rainy all the time**. However, the temperature information you mentioned ({math_result}) isn't available through the provided tools. Let me know if you'd like further clarification!
(MCP-Add-Weather) kasinathnalla@macbookpro MCP-Add-Weather % ```