Satellite Tracking MCP服务器
卫星跟踪MCP服务器
服务介绍
卫星跟踪MCP服务器
这是一个使用N2YO API提供卫星跟踪数据访问的模型上下文协议(MCP)服务器。
功能
此MCP服务器提供了以下功能:
工具
- get_satellite_position: 通过NORAD ID获取卫星的实时位置
- get_satellite_tle: 通过NORAD ID获取卫星的两行轨道数据(TLE)
- predict_visual_passes: 预测卫星在某地点可见的过境情况
- predict_radio_passes: 预测卫星在某地点无线电频率的过境情况
- get_satellites_above: 获取当前位于指定地点上方的所有卫星
- search_satellites: 按名称或类别搜索卫星
资源
- satellite://{norad_id}: 通过NORAD ID获取关于特定卫星的信息
- satellites://category/{category_id}: 列出属于特定类别的所有卫星
- satellites://above/{lat}/{lon}/{radius}: 列出位于指定地点上方的所有卫星
安装
前提条件
- Node.js 18 或更高版本
- 一个N2YO API密钥(可从N2YO API服务获得)
设置步骤
- 克隆此仓库或下载源代码
- 安装依赖项:
bash
cd satellite-tracking-server
npm install
- 构建服务器:
bash
npm run build
配置
该服务器需要N2YO API密钥才能运行。您可以通过环境变量N2YO_API_KEY来提供这个密钥。
MCP设置配置
要将此服务器与Claude一起使用,请将其添加到您的MCP设置配置文件中:
对于Claude桌面应用程序 (macOS)
编辑~/Library/Application Support/Claude/claude_desktop_config.json:
json
{
"mcpServers": {
"satellite-tracking": {
"command": "node",
"args": ["/path/to/satellite-tracking-server/build/index.js"],
"env": {
"N2YO_API_KEY": "your-api-key-here"
},
"disabled": false,
"autoApprove": []
}
}
}
对于Claude VSCode扩展
编辑~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json:
json
{
"mcpServers": {
"satellite-tracking": {
"command": "node",
"args": ["/path/to/satellite-tracking-server/build/index.js"],
"env": {
"N2YO_API_KEY": "your-api-key-here"
},
"disabled": false,
"autoApprove": []
}
}
}
使用示例
一旦服务器配置完成并运行,您可以使用Claude访问卫星跟踪数据:
获取卫星位置
<use_mcp_tool>
<server_name>satellite-tracking</server_name>
<tool_name>get_satellite_position</tool_name>
{
"norad_id": 25544,
"observer_lat": 40.7128,
"observer_lng": -74.0060
}
</use_mcp_tool>
获取卫星TLE数据
<use_mcp_tool>
<server_name>satellite-tracking</server_name>
<tool_name>get_satellite_tle</tool_name>
{
"norad_id": 25544
}
</use_mcp_tool>
预测视觉过境
<use_mcp_tool>
<server_name>satellite-tracking</server_name>
<tool_name>predict_visual_passes</tool_name>
{
"norad_id": 25544,
"observer_lat": 40.7128,
"observer_lng": -74.0060,
"days": 7
}
</use_mcp_tool>
搜索卫星
<use_mcp_tool>
<server_name>satellite-tracking</server_name>
<tool_name>search_satellites</tool_name>
{
"query": "ISS"
}
</use_mcp_tool>
获取位于某地之上的卫星
<use_mcp_tool>
<server_name>satellite-tracking</server_name>
<tool_name>get_satellites_above</tool_name>
{
"observer_lat": 40.7128,
"observer_lng": -74.0060,
"search_radius": 45
}
</use_mcp_tool>
访问卫星资源
<access_mcp_resource>
<server_name>satellite-tracking</server_name>
satellite://25544
</access_mcp_resource>
卫星类别
服务器支持以下卫星类别:
| 类别ID | 描述 || ----------- | ------------ |
| 0 | 全部 |
| 1 | 业余 |
| 2 | 立方星 |
| 3 | 教育 |
| 4 | 工程 |
| 5 | 伽利略 |
| 6 | GLO-OPS |
| 7 | GPS-OPS |
| 8 | 军事 |
| 9 | 雷达 |
| 10 | 资源 |
| 11 | SARSAT |
| 12 | 科学 |
| 13 | TDRSS |
| 14 | 气象 |
| 15 | XM/Sirius |
| 16 | Iridium-NEXT |
| 17 | Globalstar |
| 18 | Intelsat |
| 19 | SES |
| 20 | Telesat |
| 21 | Orbcomm |
| 22 | 戈里佐恩特 |
| 23 | 彩虹 |
| 24 | 摩尔尼亚 |
| 25 | DMC |
| 26 | Argos |
| 27 | Planet |
| 28 | Spire |
| 29 | Starlink |
| 30 | OneWeb |
API 密钥限制
N2YO API 的使用限制基于您的订阅计划。免费层级允许:
- 每小时 1,000 次请求
- 所有端点的基本功能
在使用服务器时请注意这些限制,以避免超出配额。
故障排除
- API 密钥错误:确保您的 N2YO API 密钥有效,并且已在环境变量中正确设置。
- 速率限制:如果您遇到速率限制错误,服务器将自动以指数退避方式重试,但您可能需要等待一段时间才能进行额外的请求。
- 未找到数据:某些卫星可能没有实时跟踪数据可用,特别是较旧或不活跃的卫星。
许可证
本项目根据 ISC 许可证获得许可。