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 henry@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
initialize
Returns server information and a list of available features.
tools/list
Returns a list of available tools (API functions).
tools/call
Calculates and returns sunrise and sunset times.
Date Sun Info Server
指定した緯度・経度・日付から、その地点の日の出・日の入時刻(日本時間)を取得できるJSON-RPC APIサーバーです。Model Context Protocol (MCP) 対応のツールサーバーとして設計されています。
機能
- 任意の地点の日の出・日の入時刻を計算
- 極夜・白夜の判定
- 日本時間(JST)での時刻表示
- JSON-RPC 2.0 プロトコル対応
- Docker環境での簡単な実行
技術スタック
- PHP 8.4
- Apache HTTP Server
- Docker & Docker Compose
- JSON-RPC 2.0 プロトコル
API概要
エンドポイント
POST /
(http://localhost/
)
リクエスト形式(JSON-RPC 2.0)
例
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"arguments": {
"latitude": 35.6895,
"longitude": 139.6917,
"date": "2025-07-14"
}
}
}
サポートメソッド
initialize
: サーバー情報・機能一覧を返すtools/list
: 利用可能なツール(API機能)の一覧を返すtools/call
: 日の出・日の入時刻を計算して返す
パラメータ
latitude
: 緯度(-90〜90の範囲)longitude
: 経度(-180〜180の範囲)date
: 日付(YYYY-MM-DD形式、省略時は現在の日付)
開発・実行方法
前提条件
- Docker
- Docker Compose
起動手順
-
リポジトリをクローン
git clone <repository-url> cd mcp
-
Docker環境で起動
docker compose up --build
-
サーバーが起動したら、
http://localhost/
にPOSTリクエストでAPIを利用