MCPInstall
testing-mcp logo

testing-mcp

by beyondszine beyondszine/testing-mcp

A test repository for MCP functionality

READMEmain

NestJS Weather API Project

This is a NestJS application that provides weather data for global locations, including both US and international locations like India.

Description

This repository contains a NestJS application with a weather API that uses multiple data sources:

  • National Weather Service (NWS) API for US locations
  • OpenWeatherMap API for global locations (including India)

Installation

$ npm install

Configuration

  1. Copy the .env.example file to .env:

    cp .env.example .env
    
  2. Get an API key from OpenWeatherMap and add it to the .env file:

    OPENWEATHER_API_KEY=your_api_key_here
    

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

API Endpoints

Get Weather Forecast

GET /weather/forecast?latitude=<lat>&longitude=<lon>

Example:

  • For New York (US): /weather/forecast?latitude=40.7128&longitude=-74.0060
  • For Delhi (India): /weather/forecast?latitude=28.6139&longitude=77.2090

Get Weather Alerts

GET /weather/alerts?latitude=<lat>&longitude=<lon>

Note: Weather alerts are currently only available for US locations.

Features

  • Basic NestJS application structure
  • Weather API with support for global locations
  • Automatic detection of US vs. international locations
  • Environment-based configuration
  • TypeScript configuration

Getting Started

  1. Clone the repository
  2. Install dependencies with npm install
  3. Configure your .env file with your OpenWeatherMap API key
  4. Run the application with npm run start:dev
  5. Access the API at http://localhost:3000/weather/forecast?latitude=28.6139&longitude=77.2090 (example for Delhi, India)

License

This project is MIT licensed.