mcp-sun-info-server

noir4y/mcp-sun-info-server

3.2

If you are the rightful owner of mcp-sun-info-server 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.

A JSON-RPC API server designed to provide sunrise and sunset times for specified locations and dates in Japan Standard Time (JST), compatible with Model Context Protocol (MCP).

Tools
3
Resources
0
Prompts
0

Date Sun Info Server

A JSON-RPC API server that returns sunrise and sunset times in Coordinated Universal Time (UTC) for a specified latitude, longitude, and date. Designed as a Model Context Protocol (MCP) compatible tool server.

Features

  • Calculate sunrise and sunset times for any location
  • Detect polar night and polar day
  • Display times in UTC
  • JSON-RPC 2.0 compliant
  • Easy to run with Docker

Tech Stack

  • PHP 8.4
  • Apache HTTP Server
  • Docker & Docker Compose
  • JSON-RPC 2.0

API Overview

Endpoint

  • POST / (http://localhost/)

Request format (JSON-RPC 2.0)

Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "arguments": {
      "latitude": 51.5074,
      "longitude": -0.1278,
      "date": "2025-07-14"
    }
  }
}

Supported methods

  • initialize: Returns server information and capabilities
  • tools/list: Returns a list of available tools (API features)
  • tools/call: Calculates and returns sunrise and sunset times

Parameters

  • latitude: Latitude (range: -90 to 90)
  • longitude: Longitude (range: -180 to 180)
  • date: Date in YYYY-MM-DD format (defaults to the current date)

Development and Run

Prerequisites

  • Docker
  • Docker Compose

How to run

  1. Clone the repository

    git clone <repository-url>
    cd mcp
    
  2. Start with Docker

    docker compose up --build
    
  3. Once the server is running, use the API by sending a POST request to http://localhost/