关于 Sunrise & Sunset Times
Sunrise & Sunset Times 是面向需要查询任意地点和日期日月数据的 AI 助手与 Agent 的远程 MCP 服务。它返回当地时间,处理极昼和极夜,并支持单日或多日查询,无需 API 密钥。
主要功能
- 01获取日出、日落和曙暮光时间
- 02查询黄金时段、蓝调时段和太阳位置
- 03查看月出、月落、月相和照明比例
- 04查询单日或最多 366 天的日期范围
- 05返回当地 ISO 8601 时间和极昼极夜状态
适用场景
- 01围绕黄金时段安排摄影
- 02比较季节内的日照变化
- 03挑选适合观星的暗夜
- 04查看旅途中的日出和日落时间
MCP 相关
提供只读工具,用于查询每日及日期范围内的日月时间,并通过输出结构描述返回字段。远程 Streamable HTTP 服务无需身份验证。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://api.sunrise-sunset.org/mcpclaude mcp add --transport http org-sunrise-sunset-sun-times https://api.sunrise-sunset.org/mcp{"mcpServers":{"org-sunrise-sunset-sun-times":{"type":"http","url":"https://api.sunrise-sunset.org/mcp"}}}在 Cursor 中打开{"servers":{"org-sunrise-sunset-sun-times":{"type":"http","url":"https://api.sunrise-sunset.org/mcp"}}}在 VS Code 中打开{"mcpServers":{"org-sunrise-sunset-sun-times":{"type":"http","url":"https://api.sunrise-sunset.org/mcp"}}}{"mcpServers":{"org-sunrise-sunset-sun-times":{"serverUrl":"https://api.sunrise-sunset.org/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
2| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| tz | string | 否 | IANA 时区,例如 'Europe/Madrid'。省略后将自动解析坐标所在地的时区(推荐)。 |
| lat | number | 是 | 十进制度数表示的纬度。 |
| lng | number | 是 | 十进制度数表示的经度。 |
| date | string | 否 | 'today'(默认)、'tomorrow' 或 YYYY-MM-DD。相对日期按坐标所在地的时区解析。 |
详细介绍

日出与日落时间 MCP 服务
一个免费的远程 MCP 服务,为 AI 助手和 Agent 提供地球上任意地点、任意日期的准确日月时间:日出、日落、曙暮光、黄金时段、蓝调时段、太阳位置、月出、月落和月相。由 Sunrise-Sunset.org 提供。
https://api.sunrise-sunset.org/mcp
- 无需 API 密钥,无需注册。 将 URL 添加到客户端,然后提出问题即可。
- 远程服务。 无需安装或运行任何内容:使用 Streamable HTTP,无需身份验证。
- 当地时间。 返回的时间采用该地点时区的 ISO 8601 格式。
- 正确处理极昼和极夜。 每天都会标明是正常、极昼还是极夜;不会发生的事件会显示为
null,绝不会编造时间。
目录
连接
Claude(claude.ai、桌面应用和移动应用):依次选择 Settings → Connectors → Add custom connector,然后粘贴上方的 URL。
Claude Code:
claude mcp add --transport http sunrise-sunset https://api.sunrise-sunset.org/mcp
ChatGPT: 依次选择 Settings → Apps & Connectors → Advanced settings → Developer mode, 然后将 URL 添加为自定义连接器。
Codex:
codex mcp add sunrise-sunset --url https://api.sunrise-sunset.org/mcp
Cursor: 将以下内容添加到 ~/.cursor/mcp.json,或添加到项目中的
.cursor/mcp.json(与 mcp.json 相同):
{ "mcpServers": { "sunrise-sunset": { "url": "https://api.sunrise-sunset.org/mcp" } } }
VS Code(GitHub Copilot Agent 模式):将以下内容添加到 .vscode/mcp.json(与
configs/vscode-mcp.json 相同):
{ "servers": { "sunrise-sunset": { "type": "http", "url": "https://api.sunrise-sunset.org/mcp" } } }
其他任何 MCP 客户端也可以使用:这是一个通过 Streamable HTTP 提供的标准远程服务, 无需身份验证。更多详情请参阅设置指南。
工具
这两个工具均为只读,并返回相同的每日对象。
get_sun_times
一个地点,一天。
| 参数 | 必填 | 描述 |
|---|---|---|
lat | 是 | 十进制度数表示的纬度,范围为 -90 到 90。 |
lng | 是 | 十进制度数表示的经度,范围为 -180 到 180。 |
date | 否 | today(默认)、tomorrow 或 YYYY-MM-DD。相对日期使用该地点的当地日期。 |
tz | 否 | IANA 时区,例如 Europe/Madrid。省略时将使用坐标对应的时区(推荐)。 |
get_sun_times_range
一个地点,单次调用最多可查询连续 366 天:适用于日历、旅行, 或比较不同季节,无需每天单独调用一次。
| 参数 | 必填 | 描述 |
|---|---|---|
lat、lng、tz | 同上。 | |
date_start | 是 | 开始日期,YYYY-MM-DD。 |
date_end | 是 | 结束日期(含当天),YYYY-MM-DD。 |
返回的日期范围可能少于请求的天数:该时区中从未存在过的日历日期会被略去
(萨摩亚在跨越国际日期变更线时跳过了 2011 年 12 月 30 日)。请根据每个条目的
date 字段进行匹配。
每天包含的内容
sunrise、sunset、solar_noon、day_length(秒)、sun_status
(normal、midnight_sun 或 polar_night)、民用、航海和天文曙暮光、
dawn、dusk、first_light、last_light、golden_hour 和
blue_hour(上午和傍晚)、日出和日落时的太阳方位角、正午时的太阳高度角、
moonrise、moonset、moon_phase 和
moon_illumination。这两个工具都会声明 outputSchema,让客户端和
Agent 提前了解每个字段及其类型。
可以询问的问题
- “旧金山明天的黄金时段是什么时候?”
- “西雅图 11 月的日照时间会减少多少?”
- “列出特罗姆瑟 2026 年 12 月每天的日出和日落时间。”
- “犹他州摩押本月哪些夜晚最适合观星?”
结果示例
2026 年 12 月 24 日里斯本的 get_sun_times(简略版):
{
"date": "2026-12-24",
"tzid": "Europe/Lisbon",
"utc_offset": "+00:00",
"lat": 38.72,
"lng": -9.14,
"sunrise": "2026-12-24T07:52:21+00:00",
"sunset": "2026-12-24T17:19:57+00:00",
"solar_noon": "2026-12-24T12:36:08+00:00",
"day_length": 34056,
"sun_status": "normal",
"dawn": "2026-12-24T07:22:27+00:00",
"dusk": "2026-12-24T17:49:51+00:00",
"golden_hour": {
"morning": { "begin": "2026-12-24T07:33:53+00:00", "end": "2026-12-24T08:34:15+00:00" },
"evening": { "begin": "2026-12-24T16:38:04+00:00", "end": "2026-12-24T17:38:25+00:00" }
},
"moonrise": "2026-12-24T17:48:33+00:00",
"moonset": "2026-12-24T08:29:49+00:00",
"moon_phase": "Full Moon",
"moon_illumination": 99.61
}
使用 curl 试用
该服务通过 POST 传输 JSON-RPC 2.0:
curl -s https://api.sunrise-sunset.org/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_sun_times","arguments":{"lat":38.72,"lng":-9.14,"date":"2026-12-24"}}}'
更喜欢使用纯 HTTP?同一数据也可通过 REST API 获取:请参阅 sunrise-sunset-org/api。
使用限制和署名要求
- 可免费合理使用。若要查询同一地点多天的数据,请使用
get_sun_times_range,而不是每天调用一次。客户端若在短时间内连续调用 服务,可能会暂时收到 HTTP 429 错误。 - 必须在用户能看到数据的所有地方注明来源:添加指向 sunrise-sunset.org 的链接;如果没有屏幕,则提及 Sunrise-Sunset.org。详情请见 API 仓库。
- 服务是否宕机?请查看状态页面。
问题与故障
请提交问题,并说明 你使用的客户端、提出的问题以及收到的回复。
服务器变更会通过 API 仓库的版本发布公布: 点击其中的 Watch → Custom → Releases 即可接收通知。
许可证
本仓库中的文件(配置和示例)采用 MIT License。服务器返回的数据适用其自身条款:按照上述说明注明来源后即可免费使用。请参阅 API 文档。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。