[Sunrise-Sunset.org]
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.
- No 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
Connect it
Claude (claude.ai, desktop and mobile apps): Settings → Connectors → Add
custom connector, and paste the URL above.
Claude Code:
ChatGPT: Settings → Apps & Connectors → Advanced settings → Developer mode,
then add the URL as a custom connector.
Codex:
Cursor: add this to ~/.cursor/mcp.json, or to .cursor/mcp.json inside a
project (same as mcp.json):
VS Code (GitHub Copilot agent mode): add this to .vscode/mcp.json (same as
configs/vscode-mcp.json):
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.
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.
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):
Try it with curl
The server speaks JSON-RPC 2.0 over POST:
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_range instead 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.