MCP for AI agents

The API is also available as an MCP server (Model Context Protocol), so AI assistants and agents like Claude, ChatGPT or Cursor can call it as a native tool. Add it as a connector with this URL, no API key or sign up needed:

https://api.sunrise-sunset.org/mcp

It is a stateless server (Streamable HTTP transport) with two tools: get_sun_times returns everything the API documents for one day, and get_sun_times_range covers up to 366 consecutive days in a single call. The data and the attribution requirement are the same as the rest of the API.

How to connect

Things to ask once connected

The tools return the same data as our sunrise and sunset API: all the field definitions documented there apply here too.

The service is free, with the same attribution requirement as the API: show a visible link to sunrise-sunset.org wherever you display the data.

Contact

Please contact us for all your API questions.