Local Weather MCP Server

Local Weather MCP Server

Provides a health check and a get_weather tool to query current weather by city name via HTTP, designed for integration with Dify.

Category
Visit Server

README

本地 Dify 可用的 MCP Server(HTTP)

这是一个最小可用的 MCP Server,提供 2 个工具:

  • health:连通性检查
  • get_weather(location):按城市名查询当前天气

1)安装依赖

如果你有系统 Python:

pip install -r requirements.txt

如果你要使用 Codex 内置 Python 运行时:

C:\\Users\\86318\\.cache\\codex-runtimes\\codex-primary-runtime\\dependencies\\python\\python.exe -m pip install -r requirements.txt

2)启动 MCP Server

python server.py

默认监听:

  • Host:0.0.0.0
  • Port:8787
  • MCP URL:http://127.0.0.1:8787/mcp

可选环境变量覆盖:

  • MCP_HOST
  • MCP_PORT
  • MCP_PATH

示例:

$env:MCP_PORT='8800'; python .\\server.py

3)在本地 Dify 接入

在 Dify 的 MCP Server(HTTP)配置里填写:

  • Server URL:http://127.0.0.1:8787/mcp
  • Name:local-weather
  • Server ID:local_weather

保存后,Dify 应该能自动发现以下工具:

  • health
  • get_weather

4)调用示例

在 Agent 或 Workflow 中让模型调用:

  • health
  • get_weather,参数 location = "Shanghai"

5)常见问题

  • 如果 Dify 运行在 Docker 容器里,127.0.0.1 指向容器本身,不是宿主机。
    • 通常改用:http://host.docker.internal:8787/mcp
  • 如果连接失败:
    • 检查端口 8787 是否被占用
    • 检查防火墙规则
    • 确认 URL 包含 /mcp 路径

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured