Back to MCP directory
publicPublicdnsLocal runtime

mcp-server-u4o

一个简单的MCP服务器项目,提供天气信息查询功能。

article

README

🚀 MCP服务器

我们创建了一个简单的MCP(模型上下文协议),该协议可用于实现特定功能,例如获取天气信息等。

🔍 输出示例

示例图像

💡 更多示例提示词

天气信息工具

  • 提示示例
    • "东京的天气怎么样?"
    • "告诉我纽约的温度,单位是华氏度"
    • "伦敦现在在下雨吗?"

💻 使用示例

基础用法

// 测试用例 1:已知位置,默认单位(摄氏度)
await WeatherInfo({
  location: "Tokyo"
});
// 预期结果:东京的天气数据,温度为摄氏度

// 测试用例 3:另一个已知位置
await WeatherInfo({
  location: "London"
});
// 预期结果:伦敦的天气数据

高级用法

// 测试用例 2:已知位置,指定华氏度
await WeatherInfo({
  location: "New York",
  unit: "fahrenheit"
});
// 预期结果:纽约的天气数据,温度为华氏度

// 测试用例 4:未知位置(生成随机天气数据)
await WeatherInfo({
  location: "Atlantis"
});
// 预期结果:为未知位置生成的天气数据
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client