Sunrise & Sunset Times MCP server
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
Sunrise & Sunset Times MCP server
A free, remote MCP server that gives AI assistants and agents accurate sun and moon times for any place on Earth and any date: sunrise, sunset, twilight, golden hour, blue hour, solar position, moonrise, moonset and moon phase. By Sunrise-Sunset.org.
https://api.sunrise-sunset.org/mcpNo API key, no sign up. Add the URL to your client and ask.
Remote. Nothing to install or run: Streamable HTTP, no authentication.
Local time. Times come back in ISO 8601 in the time zone of the place.
Polar day and night handled. Each day says whether it is normal, midnight sun or polar night, and events that do not happen are
null, never a made-up time.
Contents
Related MCP server: chuk-mcp-celestial
Connect it
Claude (claude.ai, desktop and mobile apps): Settings → Connectors → Add custom connector, and paste the URL above.
Claude Code:
claude mcp add --transport http sunrise-sunset https://api.sunrise-sunset.org/mcpChatGPT: Settings → Apps & Connectors → Advanced settings → Developer mode, then add the URL as a custom connector.
Codex:
codex mcp add sunrise-sunset --url https://api.sunrise-sunset.org/mcpCursor: add this to ~/.cursor/mcp.json, or to .cursor/mcp.json inside a
project (same as mcp.json):
{ "mcpServers": { "sunrise-sunset": { "url": "https://api.sunrise-sunset.org/mcp" } } }VS Code (GitHub Copilot agent mode): add this to .vscode/mcp.json (same as
configs/vscode-mcp.json):
{ "servers": { "sunrise-sunset": { "type": "http", "url": "https://api.sunrise-sunset.org/mcp" } } }Any other MCP client works too: it is a standard remote server over Streamable HTTP with no authentication. More details in the setup guide.
Tools
Both tools are read-only and return the same per-day object.
get_sun_times
One place, one day.
Parameter | Required | Description |
| yes | Latitude in decimal degrees, -90 to 90. |
| yes | Longitude in decimal degrees, -180 to 180. |
| no |
|
| no | IANA time zone such as |
get_sun_times_range
One place, up to 366 consecutive days in a single call: calendars, trips, or comparing seasons without one call per day.
Parameter | Required | Description |
| As above. | |
| yes | First day, |
| yes | Last day, inclusive, |
A range can return fewer days than requested: calendar days that never existed
in that time zone are left out (Samoa skipped 30 December 2011 when it moved
across the date line). Match each entry by its date field.
What each day contains
sunrise, sunset, solar_noon, day_length (seconds), sun_status
(normal, midnight_sun or polar_night), civil, nautical and astronomical
twilight, dawn, dusk, first_light, last_light, golden_hour and
blue_hour (morning and evening), the sun's azimuth at sunrise and sunset and
its altitude at noon, moonrise, moonset, moon_phase and
moon_illumination. Both tools declare an outputSchema, so clients and
agents know every field and type in advance.
Things to ask
"When is golden hour in San Francisco tomorrow?"
"How much daylight does Seattle lose during November?"
"Give me sunrise and sunset in Tromsø for every day of December 2026."
"Which nights this month will be darkest for stargazing in Moab, Utah?"
Example result
get_sun_times for Lisbon on 24 December 2026 (shortened):
{
"date": "2026-12-24",
"tzid": "Europe/Lisbon",
"utc_offset": "+00:00",
"lat": 38.72,
"lng": -9.14,
"sunrise": "2026-12-24T07:52:21+00:00",
"sunset": "2026-12-24T17:19:57+00:00",
"solar_noon": "2026-12-24T12:36:08+00:00",
"day_length": 34056,
"sun_status": "normal",
"dawn": "2026-12-24T07:22:27+00:00",
"dusk": "2026-12-24T17:49:51+00:00",
"golden_hour": {
"morning": { "begin": "2026-12-24T07:33:53+00:00", "end": "2026-12-24T08:34:15+00:00" },
"evening": { "begin": "2026-12-24T16:38:04+00:00", "end": "2026-12-24T17:38:25+00:00" }
},
"moonrise": "2026-12-24T17:48:33+00:00",
"moonset": "2026-12-24T08:29:49+00:00",
"moon_phase": "Full Moon",
"moon_illumination": 99.61
}Try it with curl
The server speaks JSON-RPC 2.0 over POST:
curl -s https://api.sunrise-sunset.org/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_sun_times","arguments":{"lat":38.72,"lng":-9.14,"date":"2026-12-24"}}}'Prefer plain HTTP? The same data is available as a REST API: see sunrise-sunset-org/api.
Limits and attribution
Free for reasonable use. For many days at one place, use
get_sun_times_rangeinstead of one call per day. A client that calls the server in a tight loop may get HTTP 429 for a short while.Attribution is required wherever people see the data: a link to sunrise-sunset.org, or a mention of Sunrise-Sunset.org when there is no screen. Details in the API repository.
Is the server down? Check the status page.
Questions and problems
Open an issue. Include the client you use, what you asked and what came back.
Changes to the server are announced as releases of the API repository: click Watch → Custom → Releases there to get them.
License
The files in this repository (configuration and examples) are under the MIT License. The data the server returns has its own terms: free to use with the attribution described above. See the API documentation.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Discover the magic of day and night with our Sunrise & Sunset API. Get accurate sunrise, sunset,
Elevation-corrected sun, moon, twilight, solar and tide data for any point on Earth
Read-only astronomy calculations: sun, moon, planets, eclipses, twilight and star positions.
Swiss Ephemeris for AI agents: exact natal charts, transits, synastry and birth-place resolution
Related MCP Servers
- AlicenseAqualityBmaintenanceCalculate the altitude, rise, and set times of celestial objects (Sun, Moon, planets, stars, and deep-space objects) for any location on Earth.21531 PyPIMIT
- AlicenseAqualityFmaintenanceProvides authoritative astronomical data including moon phases, solar eclipses, and sun/moon rise and set times using the US Navy API or offline Skyfield calculations. It enables users to query Earth's seasons and celestial events for any location and date.81Apache 2.0
- AlicenseAqualityDmaintenanceEnables timezone conversion, astronomical calculations, and date utilities through natural language, supporting sunrise/sunset, moon phases, business days, and more.913 npm1ISC
- AlicenseAqualityCmaintenanceProvides deterministic computation of magnetic declination and sky positions (sun, moon, planets) for any location and time, enabling agents to get accurate ephemeris and geomagnetic data without hallucination.2149 PyPIMIT