AS

azure-samples/remote-mcp-webapp-node

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

5 stars 5 forks 品質 46 トレンド 13

A Model Context Protocol (MCP) server built with Express.js and Node.js that provides weather information using the National Weather Service API.

概要

A Model Context Protocol (MCP) server built with Express.js and Node.js that provides weather information using the National Weather Service API. Ready for deployment to Azure App Service with Azure Developer CLI (azd). - : Fast, unopinionated web framework for Node.js - : Full support for JSON-RPC 2.0 MCP protocol - : HTTP-based communication for web connectivity - : - get_alerts: Get weather alerts for any US state - get_forecast: Get detailed weather forecast for any location - : Pre-configured for Azure App Service deployment - : Built-in HTML interface for testing - : Real-time weather data from official US government source - (or Node.js 18+) - (Node Package Manager) 3. : - Server: http://localhost:8000 - Health Check: http://localhost:8000/health - Test Interface: http://localhost:8000/test 1. from command palette and add the URL to your running server's HTTP endpoint: 2. from command palette and start the server 3.

README

以下は原文 README の抜粋です。原文を見る。

Node.js MCP Weather Server with Azure Deployment

A Model Context Protocol (MCP) server built with Express.js and Node.js that provides weather information using the National Weather Service API. Ready for deployment to Azure App Service with Azure Developer CLI (azd).

🌟 Features

  • Express.js Framework: Fast, unopinionated web framework for Node.js
  • MCP Protocol Compliance: Full support for JSON-RPC 2.0 MCP protocol
  • HTTP Transport: HTTP-based communication for web connectivity
  • Weather Tools:
    • get_alerts: Get weather alerts for any US state
    • get_forecast: Get detailed weather forecast for any location
  • Azure Ready: Pre-configured for Azure App Service deployment
  • Web Test Interface: Built-in HTML interface for testing
  • National Weather Service API: Real-time weather data from official US government source

💻 Local Development

Prerequisites

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

Setup & Run

  1. Clone and install dependencies:

    git clone 
    cd remote-mcp-webapp-node
    npm install
    
  2. Start the development server:

    npm run dev
    
  3. Access the server:

🔌 Connect to the Local MCP Server

Using VS Code - Copilot Agent Mode

  1. Add MCP Server from command palette and add the URL to your running server’s HTTP endpoint:
    http://localhost:8000
    
  2. List MCP Servers from command palette and start the server
  3. In Copilot chat agent mode, enter a prompt to trigger the tool:
    What's the weather forecast for San Francisco?
    
  4. When prompted to run the tool, consent by clicking Continue

Using MCP Inspector

  1. In a new terminal window, install and run MCP Inspector:
    npx @modelcontextprotocol/inspector
    
  2. CTRL+click the URL displayed by the app (e.g. http://localhost:5173/#resources)
  3. Set the transport type to HTTP
  4. Set the URL to your running server’s HTTP endpoint and Connect:
    http://localhost:8000
    
  5. List Tools, click on a tool, and Run Tool

🚀 Quick Deploy to Azure

Prerequisites

Deploy in 3 Commands

# 1. Login to Azure
azd auth login

# 2. Initialize the project
azd init

# 3. Deploy to Azure
azd up

After deployment, your MCP server will be available at:

  • Health Check: https://.azurewebsites.net/health
  • MCP Capabilities: https://.azurewebsites.net/mcp/capabilities
  • Test Interface: https://.azurewebsites.net/test

🔌 Connect to the Remote MCP Server

GitHub で README 全文を見る

インストール

npx @modelcontextprotocol/inspector
MCP 初心者?mcpskill.org のガイドから始めましょう →