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
- In Claude (claude.ai or the apps): Settings → Connectors → Add custom connector, and paste the URL above.
- In Claude Code, from the terminal:
claude mcp add --transport http sunrise-sunset https://api.sunrise-sunset.org/mcp - In ChatGPT: Settings → Apps & Connectors → Advanced settings → Developer mode, then add the URL as a custom connector.
- Any other MCP-compatible client works too: it is a standard remote MCP server over Streamable HTTP, with no authentication.
Things to ask once connected
- “When is golden hour in Paris tomorrow?”
- “How much daylight does Oslo lose during November?”
- “Which nights this month will be darkest for stargazing in Tenerife?”
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.