Sunrise & Sunset Times

Sunrise, sunset, twilight, golden hour, blue hour and moon times for any coordinates and date, in local time. Free remote MCP server, no API key.

เอกสาร

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.
  • In Codex, from the terminal:
    codex mcp add sunrise-sunset --url https://api.sunrise-sunset.org/mcp
    
  • In Cursor, add it to ~/.cursor/mcp.json (or .cursor/mcp.json inside a project):
    { "mcpServers": { "sunrise-sunset": { "url": "https://api.sunrise-sunset.org/mcp" } } }
    
  • 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: credit sunrise-sunset.org wherever people can see where the data comes from (details).

Contact

Please contact us for all your API questions.