ims-mcp

GuyKh/ims-mcp

3.2

If you are the rightful owner of ims-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The IMS MCP Server provides access to weather data from the Israeli Meteorological Service using the Model Context Protocol.

Tools
7
Resources
0
Prompts
0

IMS MCP Server

A Model Context Protocol (MCP) server for accessing weather data from the Israeli Meteorological Service (IMS).

Features

  • Get location information for weather monitoring stations
  • Fetch weather forecast data for specific locations
  • Retrieve current weather alerts
  • Access current weather analysis
  • Get wind direction mappings
  • Retrieve weather condition code descriptions
  • Access comprehensive city portal information

Installation

Using UV (Recommended)

# Clone the repository
git clone <repository-url>
cd ims-mcp-server

# Install using UV
uv pip install -e .

Using pip

pip install -e .

Usage

Running the Server

The server runs as an HTTP server with StreamableHttp transport:

# Run the server directly
python -m ims_mcp.server

# Or using uvicorn directly
uvicorn ims_mcp.server:app --host 0.0.0.0 --port 8000

# Or using the installed script
ims-mcp-server

Docker

# Build the image
docker build -t ims-mcp-server .

# Run the container
docker run -p 8000:8000 ims-mcp-server

Server Endpoints

  • POST / - Main MCP endpoint for all JSON-RPC communication
  • GET /health - Health check endpoint
  • GET /info - Server information and available endpoints

Connecting to the Server

The server uses StreamableHttp transport for MCP communication:

  1. MCP Endpoint: Send all MCP messages via POST to http://localhost:8000/
  2. Content-Type: application/json
  3. Protocol: JSON-RPC 2.0

Example MCP client configuration:

{
  "name": "ims-weather",
  "type": "http",
  "url": "http://localhost:8000/"
}

Example Usage

# Initialize connection
curl -X POST http://localhost:8000/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}}'

# List available tools
curl -X POST http://localhost:8000/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {}}'

# Call a tool
curl -X POST http://localhost:8000/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "get_location_info", "arguments": {"language": "en"}}}'

Available Tools

get_location_info

Get information about available weather monitoring locations in Israel.

Parameters:

  • language (optional): Language code ("he" for Hebrew, "en" for English, default: "he")

get_forecast_data

Get weather forecast data for a specific location.

Parameters:

  • location_id: Location ID from locations_info
  • language (optional): Language code (default: "he")

get_ims_alerts

Get current weather alerts from IMS.

Parameters:

  • language (optional): Language code (default: "he")

get_weather_analysis

Get current weather analysis for a specific location.

Parameters:

  • location_id: Location ID for current weather analysis
  • language (optional): Language code (default: "he")

get_wind_directions

Get wind direction codes and their azimuth mappings.

Parameters:

  • language (optional): Language code (default: "he")

get_weather_codes

Get weather condition codes and their full descriptions.

Parameters:

  • language (optional): Language code (default: "he")

get_city_portal

Get comprehensive location information including weather data.

Parameters:

  • location_id: Location ID for full location information
  • language (optional): Language code (default: "he")

API Endpoints

The server interacts with the following IMS API endpoints:

  • https://ims.gov.il/{language}/locations_info - Location information
  • https://ims.gov.il/{language}/forecast_data/{location_id} - Forecast data
  • https://ims.gov.il/{language}/ims_alerts - Weather alerts
  • https://ims.gov.il/{language}/now_analysis/{location_id} - Current weather analysis
  • https://ims.gov.il/{language}/wind_directions - Wind direction mappings
  • https://ims.gov.il/{language}/weather_codes - Weather condition codes
  • https://ims.gov.il/{language}/city_portal/{location_id} - Full location information

Development

Installing Development Dependencies

uv pip install -e ".[dev]"

Running Tests

pytest

Code Formatting

black src/
isort src/

Type Checking

mypy src/

License

MIT License