@pipeworx/mcp-celestrak 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +156 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# mcp-celestrak
|
|
2
|
+
|
|
3
|
+
CelesTrak MCP — satellite orbital elements (TLE / GP data) for any tracked object.
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 770+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"celestrak": {
|
|
20
|
+
"url": "https://gateway.pipeworx.io/celestrak/mcp"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or connect to the full Pipeworx gateway for access to all 770+ data sources:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"pipeworx": {
|
|
32
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Using with ask_pipeworx
|
|
39
|
+
|
|
40
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
ask_pipeworx({ question: "your question about Celestrak data" })
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
47
|
+
|
|
48
|
+
## More
|
|
49
|
+
|
|
50
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
51
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-celestrak",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CelesTrak MCP — satellite orbital elements (TLE / GP data) for any tracked object.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "celestrak"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-celestrak"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.7.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/celestrak",
|
|
4
|
+
"title": "Celestrak",
|
|
5
|
+
"description": "CelesTrak MCP — satellite orbital elements (TLE / GP data) for any tracked object.",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/celestrak",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-celestrak",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/celestrak/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
interface McpToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface McpToolExport {
|
|
12
|
+
tools: McpToolDefinition[];
|
|
13
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
+
meter?: { credits: number };
|
|
15
|
+
cost?: Record<string, unknown>;
|
|
16
|
+
provider?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* CelesTrak MCP — satellite orbital elements (TLE / GP data) for any tracked object.
|
|
21
|
+
*
|
|
22
|
+
* Keyless. CelesTrak is run by a single maintainer; we send a polite User-Agent and keep
|
|
23
|
+
* usage light. This is the ORBITAL CATALOG (general-perturbations element sets), distinct
|
|
24
|
+
* from live position tracking.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const BASE = 'https://celestrak.org/NORAD/elements/gp.php';
|
|
29
|
+
const UA = 'pipeworx/1.0 (+https://pipeworx.io)';
|
|
30
|
+
|
|
31
|
+
type Gp = Record<string, unknown>;
|
|
32
|
+
|
|
33
|
+
const mapGp = (o: Gp) => ({
|
|
34
|
+
name: o.OBJECT_NAME,
|
|
35
|
+
object_id: o.OBJECT_ID,
|
|
36
|
+
norad_id: o.NORAD_CAT_ID,
|
|
37
|
+
epoch: o.EPOCH,
|
|
38
|
+
mean_motion_rev_per_day: o.MEAN_MOTION,
|
|
39
|
+
eccentricity: o.ECCENTRICITY,
|
|
40
|
+
inclination_deg: o.INCLINATION,
|
|
41
|
+
raan_deg: o.RA_OF_ASC_NODE,
|
|
42
|
+
arg_perigee_deg: o.ARG_OF_PERICENTER,
|
|
43
|
+
mean_anomaly_deg: o.MEAN_ANOMALY,
|
|
44
|
+
period_minutes: o.MEAN_MOTION ? Math.round(1440 / (o.MEAN_MOTION as number)) : null,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const tools: McpToolExport['tools'] = [
|
|
48
|
+
{
|
|
49
|
+
name: 'get_satellite',
|
|
50
|
+
description:
|
|
51
|
+
'Get satellite orbital elements (TLE / GP data) for a single object by NORAD catalog ID. ' +
|
|
52
|
+
'Returns orbital parameters: inclination, eccentricity, mean motion, RAAN, argument of perigee, ' +
|
|
53
|
+
'epoch, and derived orbital period in minutes. norad_id 25544 = ISS, 20580 = Hubble. ' +
|
|
54
|
+
'This is the orbital catalog, not live position tracking.',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
norad_id: { type: 'number', description: 'NORAD catalog ID, e.g. 25544 (ISS) or 20580 (Hubble).' },
|
|
59
|
+
},
|
|
60
|
+
required: ['norad_id'],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'search_by_name',
|
|
65
|
+
description:
|
|
66
|
+
'Search the satellite catalog by name substring and return matching orbital elements (TLE / GP data). ' +
|
|
67
|
+
'e.g. "STARLINK", "NOAA", "GPS". Returns up to 50 matches with orbital parameters ' +
|
|
68
|
+
'(inclination, eccentricity, period). Catalog/orbital data, not live tracking.',
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
name: { type: 'string', description: 'Satellite name substring, e.g. "STARLINK" or "NOAA".' },
|
|
73
|
+
},
|
|
74
|
+
required: ['name'],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'get_group',
|
|
79
|
+
description:
|
|
80
|
+
'List orbital elements (TLE / GP data) for an entire CelesTrak group — e.g. the Starlink, GPS, ' +
|
|
81
|
+
'or weather satellite catalog. Groups: "stations", "starlink", "gps-ops", "weather", "science", ' +
|
|
82
|
+
'"geo", "active". Returns up to 100 satellites with orbital parameters (inclination, eccentricity, period). ' +
|
|
83
|
+
'Catalog/orbital data, not live tracking.',
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
group: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
description: 'A CelesTrak group, e.g. "stations", "starlink", "gps-ops", "weather", "science", "geo", "active".',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
required: ['group'],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
async function celestrakGet(query: string): Promise<unknown[] | { error: string; message: string }> {
|
|
98
|
+
let res: Response;
|
|
99
|
+
try {
|
|
100
|
+
res = await fetch(`${BASE}?${query}&FORMAT=json`, { headers: { 'User-Agent': UA } });
|
|
101
|
+
} catch (e) {
|
|
102
|
+
return { error: 'not_found_or_error', message: e instanceof Error ? e.message : 'request failed' };
|
|
103
|
+
}
|
|
104
|
+
const body = await res.text();
|
|
105
|
+
if (!res.ok) return { error: 'not_found_or_error', message: body.trim() || 'no data' };
|
|
106
|
+
let data: unknown;
|
|
107
|
+
try {
|
|
108
|
+
data = JSON.parse(body);
|
|
109
|
+
} catch {
|
|
110
|
+
return { error: 'not_found_or_error', message: body.trim() || 'no data' };
|
|
111
|
+
}
|
|
112
|
+
if (!Array.isArray(data) || data.length === 0) {
|
|
113
|
+
return { error: 'not_found_or_error', message: body.trim() || 'no data' };
|
|
114
|
+
}
|
|
115
|
+
return data;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
119
|
+
switch (name) {
|
|
120
|
+
case 'get_satellite': {
|
|
121
|
+
const norad = reqNum(args, 'norad_id', '25544 (ISS)');
|
|
122
|
+
const data = await celestrakGet(`CATNR=${norad}`);
|
|
123
|
+
if (!Array.isArray(data)) return data;
|
|
124
|
+
return mapGp(data[0] as Gp);
|
|
125
|
+
}
|
|
126
|
+
case 'search_by_name': {
|
|
127
|
+
const q = reqStr(args, 'name', '"STARLINK"');
|
|
128
|
+
const data = await celestrakGet(`NAME=${encodeURIComponent(q)}`);
|
|
129
|
+
if (!Array.isArray(data)) return data;
|
|
130
|
+
return { count: data.length, satellites: data.slice(0, 50).map((o) => mapGp(o as Gp)) };
|
|
131
|
+
}
|
|
132
|
+
case 'get_group': {
|
|
133
|
+
const group = reqStr(args, 'group', '"starlink"');
|
|
134
|
+
const data = await celestrakGet(`GROUP=${encodeURIComponent(group)}`);
|
|
135
|
+
if (!Array.isArray(data)) return data;
|
|
136
|
+
return { group, count: data.length, satellites: data.slice(0, 100).map((o) => mapGp(o as Gp)) };
|
|
137
|
+
}
|
|
138
|
+
default:
|
|
139
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function reqStr(args: Record<string, unknown>, key: string, example: string): string {
|
|
144
|
+
const v = args[key];
|
|
145
|
+
if (typeof v !== 'string' || !v.trim()) throw new Error(`Required argument "${key}" is missing. Pass a string like ${example}.`);
|
|
146
|
+
return v;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function reqNum(args: Record<string, unknown>, key: string, example: string): number {
|
|
150
|
+
const v = args[key];
|
|
151
|
+
const n = typeof v === 'string' ? Number(v) : v;
|
|
152
|
+
if (typeof n !== 'number' || !Number.isFinite(n)) throw new Error(`Required argument "${key}" is missing. Pass a number like ${example}.`);
|
|
153
|
+
return n;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|