# Sunrise-Sunset MCP

> Sunrise-Sunset gives you precise solar data for any spot on Earth. Use this server to calculate exact sunrise, sunset, and twilight times using latitude/longitude coordinates. It handles daylight length and lets you query past or future dates—essential for planning photography, energy projects, or large outdoor events.

## Overview
- **Category:** scientific-research
- **Price:** Free
- **Tags:** solar-data, astronomy, sunrise, sunset, geospatial

## Description

This server connects your agent to accurate astronomical data using the `get_sunrise_sunset` tool. You use it to calculate exact solar timings for any spot on Earth, just by feeding in latitude and longitude coordinates.

The agent gets specific times for sunrise and sunset at a location. When you run this, you're not just getting two points; you're mapping out the entire day's light cycle. You can check when civil, nautical, or astronomical twilight starts and ends, which is crucial if you're planning anything that relies on detailed light levels before dawn or after dusk.

The tool also tells you the full duration of daylight for any specific date. It calculates the total hours of sun exposure, giving you a hard number for your project plans. You don't have to worry about local offsets either; results automatically adjust based on a timezone ID you specify. This means everything’s pegged correctly to whatever time zone you need it in.

Since this data is so precise, you can run the calculation on any date, whether that was last year or next month—it handles historical and future queries without blinking. You just feed it the coordinates and the date, and the server gives you back all the metrics.

## Tools

### get_sunrise_sunset
Gets the precise sunrise, sunset, and twilight times for any given location using latitude/longitude coordinates.

## Prompt Examples

**Prompt:** 
```
What time is the sunrise in London (51.5074, -0.1278) today?
```

**Response:** 
```
I've checked the solar data for London. Today, the sunrise is at 06:42 AM and the sunset will be at 05:58 PM. Would you like the twilight timings as well?
```

**Prompt:** 
```
Get the sunset and civil twilight times for Paris on December 25th, 2025.
```

**Response:** 
```
For Paris on Christmas Day 2025, the sunset is scheduled for 04:56 PM, with civil twilight ending at 05:34 PM. It will be a short day with a total length of 8 hours and 14 minutes.
```

**Prompt:** 
```
Show me the day length for Los Angeles (34.0522, -118.2437) using the 'America/Los_Angeles' timezone.
```

**Response:** 
```
In Los Angeles today, the total day length is 12 hours and 48 minutes. The sun rises at 06:12 AM and sets at 07:00 PM local time.
```

## Capabilities

### Retrieve core solar timings
The agent gets the specific times for sunrise and sunset at a location.

### Calculate twilight levels
You can check when civil, nautical, or astronomical twilight begins and ends for detailed light planning.

### Determine total daylight hours
The system returns the full duration of daylight for any given day at coordinates.

### Adjust for time zones
Results correctly adjust to a specified timezone ID, so you don't have to worry about local offsets.

### Query historical or future dates
The agent runs the calculation on any date, whether it happened last year or next month.

## Use Cases

### Planning an international film shoot
A filmmaker needs to know the perfect twilight window for Paris, but their team is based in New York. They ask their agent: 'What's the civil twilight end time in Paris on October 15th?' The agent runs `get_sunrise_sunset` and gets the exact timing, letting them schedule equipment rentals precisely.

### Assessing a solar farm site
An energy consultant needs to know the average day length for a desert location over the next quarter. They prompt the agent with multiple coordinates and dates. The agent runs `get_sunrise_sunset` repeatedly, gathering total daylight hours that inform the project's viability.

### Organizing a historical reenactment
A history group needs to know what natural light conditions existed at Gettysburg on July 4th, 1863. They ask their agent for the day length and sunrise/sunset times. The agent runs `get_sunrise_sunset` with coordinates and an old date, giving them accurate timing context.

### Checking optimal viewing windows
A wildlife photographer wants to know when a specific bird species is most visible at a remote coordinate. They ask the agent for twilight data. The agent runs `get_sunrise_sunset` and provides the exact window where light levels are right, saving hours of scouting.

## Benefits

- Plan shoots around the 'golden hour.' Instead of guessing, use `get_sunrise_sunset` to find exact civil and nautical twilight timings for any coordinates.
- Calculate total solar potential. Energy analysts can query day length data over a year or multiple locations to assess power generation without complex modeling.
- Manage outdoor events reliably. You'll know exactly when the light drops below usable levels, letting you reschedule activities using `get_sunrise_sunset`’s precise timing.
- Handle any date, past or future. Whether your event is next week or five years from now, `get_sunrise_sunset` provides accurate results for that specific day's solar cycle.
- Control the output timezone. The tool lets you specify a target timezone ID (`tzid`), so your calculated times match local clocks without any manual conversion.

## How It Works

The bottom line is that you give it a place and a date, and you get all the solar timing data back in one shot.

1. Your AI client calls `get_sunrise_sunset` and provides three required parameters: latitude, longitude, and a specific date.
2. The server uses these coordinates and the date to calculate all necessary astronomical data (sun position, twilight phases, etc.).
3. You get back structured JSON containing the precise sunrise time, sunset time, total day length, and detailed twilight end points.

## Frequently Asked Questions

**Can I get solar data for a specific date in the future?**
Yes! Use the `get_sunrise_sunset` tool and provide the `date` parameter in YYYY-MM-DD format (e.g., '2025-12-25').

**Does the tool support local timezones?**
Yes. By providing a `tzid` (like 'Europe/London' or 'America/New_York'), the tool returns times adjusted for that specific region.

**What is the difference between civil and astronomical twilight in the results?**
The `get_sunrise_sunset` tool returns all phases. Civil twilight is when there is still enough light for outdoor activities, while astronomical twilight marks when the sky is completely dark for astronomical observations.

**How does the Sunrise-Sunset tool handle latitude and longitude inputs?**
The tool accepts standard decimal coordinates for both latitude and longitude. You simply provide these two numbers (e.g., 34.0522, -118.2437) to pinpoint any location on Earth.

**What parameters should I include when calling the get_sunrise_sunset tool?**
You must provide a latitude, longitude, and date for the calculation. The results also respect a timezone ID (`tzid`) if you need specific local formatting.

**Are there any rate limits I should know about when using Sunrise-Sunset?**
While we don't publish hard rate limits, excessive querying may result in temporary throttling. We recommend implementing exponential backoff for high-volume automated calls to ensure stability.

**If the get_sunrise_sunset tool fails, what error codes should I look out for?**
Common errors include invalid coordinates (check lat/lon format) or unsupported dates. Always check the API documentation for specific HTTP status codes and required parameters.

**Does Sunrise-Sunset support historical data beyond just date queries?**
Yes, you can query historical solar data by simply passing a past date to the tool. This allows you to calculate times from any day in the recordable history of the API.