drio
Open app

Weather MCP Server

Source

Example of creating MCP server

Catalog onlyCatalog onlySTDIO

Overview

Weather MCP Server is a learning project that implements a simple weather service using the Model Context Protocol (MCP) to provide weather alerts and forecasts through the National Weather Service (NWS) API.

To use the Weather MCP Server, clone the repository, install the required dependencies, and configure the MCP server in your AI assistant according to the provided setup instructions.

  • get_alerts: Retrieve active weather alerts for a US state. - get_forecast: Get weather forecast for a specific location using latitude and longitude.
  1. Providing real-time weather alerts for specific regions.
  2. Offering weather forecasts based on geographical coordinates.
  3. Integrating with AI assistants to enhance user interaction with weather data.

Add to your AI client

Use these steps to connect Weather MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "weather-mcp-server-dsomel21": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-weather-mcp-server-dsomel21"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "weather-mcp-server-dsomel21": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-weather-mcp-server-dsomel21"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "weather-mcp-server-dsomel21": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-weather-mcp-server-dsomel21"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "weather-mcp-server-dsomel21": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-weather-mcp-server-dsomel21"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "weather-mcp-server-dsomel21": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-weather-mcp-server-dsomel21"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "weather-mcp-server-dsomel21": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-weather-mcp-server-dsomel21"
      ]
    }
  }
}

FAQ

What programming language is used for this project?

The project is implemented in Python 3.9 and above.

Is this project suitable for production use?

No, this project is for educational purposes only.

Where can I find the documentation for MCP?

You can find the documentation at https://modelcontextprotocol.io/quickstart/server#core-mcp-concepts.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2117,"uuid":"aaa3c92e-0b6d-454b-b176-c0c17a88e417","name":"weather-mcp-server","title":"Weather MCP Server","description":"Example of creating MCP server","avatar_url":"https://avatars.githubusercontent.com/u/17516559?v=4","created_at":"2025-03-09T03:36:21.897Z","updated_at":"2025-03-12T10:19:29.135Z","status":"created","author_name":"dsomel21","author_avatar_url":"https://avatars.githubusercontent.com/u/17516559?v=4","tags":"[]","category":"research-and-data","is_featured":false,"sort":1,"url":"https://github.com/dsomel21/weather-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"\",\"language\":\"Python\",\"is_official\":false,\"latest_commit_time\":\"2025-03-08 15:09:48\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]