National Weather Service MCP server

Integrates with the National Weather Service API to provide active weather alerts for US states and detailed forecasts for specific coordinates using official government data sources.
Back to servers
Setup instructions
Provider
Microsoft
Release date
Jun 04, 2025
Language
TypeScript
Stats
2 stars

This MCP server provides weather information using the National Weather Service API, implementing the Model Context Protocol over HTTP. Built with Express.js and Node.js, it offers tools for retrieving weather alerts and forecasts with deployment options for both local development and Azure cloud.

Prerequisites

  • Node.js 22+ (or Node.js 18+)
  • npm (Node Package Manager)

Installation

Local Setup

  1. Clone the repository and install dependencies:

    git clone <your-repo-url>
    cd remote-mcp-webapp-node
    npm install
    
  2. Start the development server:

    npm run dev
    
  3. Access the server at:

Azure Deployment

  1. Ensure you have the required tools:

    • Azure CLI
    • Azure Developer CLI (azd)
    • Active Azure subscription
  2. Deploy using the following commands:

    # Login to Azure
    azd auth login
    
    # Initialize the project
    azd init
    
    # Deploy to Azure
    azd up
    
  3. After deployment, your server will be available at:

    • Health check: https://<your-app>.azurewebsites.net/health
    • MCP capabilities: https://<your-app>.azurewebsites.net/mcp/capabilities
    • Test interface: https://<your-app>.azurewebsites.net/test

Using the MCP Server

Connect with VS Code - Copilot Agent Mode

  1. Add MCP Server from command palette with the URL to your server:

    http://localhost:8000
    

    (or your Azure deployment URL)

  2. List MCP Servers from command palette and start the server

  3. In Copilot chat agent mode, enter a weather-related prompt:

    What's the weather forecast for San Francisco?
    
  4. When prompted to run the tool, click Continue

Connect with MCP Inspector

  1. Install and run MCP Inspector:

    npx @modelcontextprotocol/inspector
    
  2. CTRL+click the URL displayed (typically http://localhost:5173/#resources)

  3. Configure the connection:

    • Set transport type to HTTP
    • Set the URL to your server's endpoint
    • Click Connect
  4. Click List Tools, select a tool, and click Run Tool

Available Weather Tools

get_alerts

Retrieves current weather alerts for any US state.

get_forecast

Provides detailed weather forecasts for any US location.

Testing Interface

The server includes a built-in testing interface accessible at the /test endpoint, allowing you to interactively test the available weather tools.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "national-weather-service" '{"transportType":"http","url":"http://localhost:8000"}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "national-weather-service": {
            "transportType": "http",
            "url": "http://localhost:8000"
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "national-weather-service": {
            "transportType": "http",
            "url": "http://localhost:8000"
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later