@pipeworx/mcp-meteors 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 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,34 @@
1
+ # mcp-meteors
2
+
3
+ Meteors MCP — NASA fireball, near-Earth asteroid, and close approach data
4
+
5
+ Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+
12
+ ## Quick Start
13
+
14
+ Add to your MCP client config:
15
+
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "meteors": {
20
+ "url": "https://gateway.pipeworx.io/meteors/mcp"
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Or use the CLI:
27
+
28
+ ```bash
29
+ npx pipeworx use meteors
30
+ ```
31
+
32
+ ## License
33
+
34
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-meteors",
3
+ "version": "0.1.0",
4
+ "description": "Meteors MCP — NASA fireball, near-Earth asteroid, and close approach data",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "meteors"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-meteors"
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/meteors",
4
+ "title": "meteors",
5
+ "description": "Meteors MCP — NASA fireball, near-Earth asteroid, and close approach data",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/meteors",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-meteors",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/meteors/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,227 @@
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
+ }
15
+
16
+ /**
17
+ * Meteors MCP — NASA fireball, near-Earth asteroid, and close approach data
18
+ *
19
+ * Sources:
20
+ * - NASA/JPL Fireball API: https://ssd-api.jpl.nasa.gov/fireball.api
21
+ * - NASA/JPL Close Approach Data: https://ssd-api.jpl.nasa.gov/cad.api
22
+ * - NASA NeoWs (Near Earth Object Web Service): https://api.nasa.gov/neo/rest/v1/feed
23
+ *
24
+ * Tools:
25
+ * - get_fireballs: Recent bolide/fireball events with energy, velocity, and location
26
+ * - get_close_approaches: Near-Earth asteroid close approaches within 0.05 AU
27
+ * - get_neo_feed: Near-Earth objects for a date range (uses NASA DEMO_KEY)
28
+ */
29
+
30
+
31
+ const JPL_BASE = 'https://ssd-api.jpl.nasa.gov';
32
+ const NEO_BASE = 'https://api.nasa.gov/neo/rest/v1';
33
+
34
+ type RawFireballData = {
35
+ signature: { source: string; version: string };
36
+ count: string;
37
+ fields: string[];
38
+ data: (string | null)[][];
39
+ };
40
+
41
+ type RawCadData = {
42
+ signature: { source: string; version: string };
43
+ count: string;
44
+ fields: string[];
45
+ data: string[][];
46
+ };
47
+
48
+ type RawNeoFeed = {
49
+ element_count: number;
50
+ near_earth_objects: Record<
51
+ string,
52
+ Array<{
53
+ id: string;
54
+ name: string;
55
+ nasa_jpl_url: string;
56
+ estimated_diameter: {
57
+ kilometers: { estimated_diameter_min: number; estimated_diameter_max: number };
58
+ };
59
+ is_potentially_hazardous_asteroid: boolean;
60
+ close_approach_data: Array<{
61
+ close_approach_date: string;
62
+ relative_velocity: { kilometers_per_hour: string };
63
+ miss_distance: { astronomical: string; kilometers: string };
64
+ orbiting_body: string;
65
+ }>;
66
+ }>
67
+ >;
68
+ };
69
+
70
+ const tools: McpToolExport['tools'] = [
71
+ {
72
+ name: 'get_fireballs',
73
+ description:
74
+ 'Get recent bolide and fireball events recorded by US government sensors. Returns impact energy, radiated energy, velocity, altitude, and geographic location for each event.',
75
+ inputSchema: {
76
+ type: 'object',
77
+ properties: {
78
+ limit: {
79
+ type: 'number',
80
+ description: 'Maximum number of fireball events to return (default 10, max 100).',
81
+ },
82
+ },
83
+ required: [],
84
+ },
85
+ },
86
+ {
87
+ name: 'get_close_approaches',
88
+ description:
89
+ 'Get near-Earth asteroid close approach events within 0.05 AU of Earth. Returns object name, approach date, miss distance, relative velocity, and diameter estimates.',
90
+ inputSchema: {
91
+ type: 'object',
92
+ properties: {
93
+ limit: {
94
+ type: 'number',
95
+ description: 'Maximum number of close approach records to return (default 10, max 50).',
96
+ },
97
+ },
98
+ required: [],
99
+ },
100
+ },
101
+ {
102
+ name: 'get_neo_feed',
103
+ description:
104
+ 'Get Near-Earth Objects (NEOs) passing by Earth for a given date range using the NASA NeoWs API. Returns asteroid names, sizes, velocities, miss distances, and hazard status.',
105
+ inputSchema: {
106
+ type: 'object',
107
+ properties: {
108
+ start_date: {
109
+ type: 'string',
110
+ description: 'Start date in YYYY-MM-DD format (e.g. "2025-01-01").',
111
+ },
112
+ end_date: {
113
+ type: 'string',
114
+ description:
115
+ 'End date in YYYY-MM-DD format. Maximum 7-day range from start_date (e.g. "2025-01-07").',
116
+ },
117
+ },
118
+ required: ['start_date', 'end_date'],
119
+ },
120
+ },
121
+ ];
122
+
123
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
124
+ switch (name) {
125
+ case 'get_fireballs':
126
+ return getFireballs((args.limit as number | undefined) ?? 10);
127
+ case 'get_close_approaches':
128
+ return getCloseApproaches((args.limit as number | undefined) ?? 10);
129
+ case 'get_neo_feed':
130
+ return getNeoFeed(args.start_date as string, args.end_date as string);
131
+ default:
132
+ throw new Error(`Unknown tool: ${name}`);
133
+ }
134
+ }
135
+
136
+ async function getFireballs(limit: number) {
137
+ const params = new URLSearchParams({ limit: String(Math.min(limit, 100)) });
138
+ const res = await fetch(`${JPL_BASE}/fireball.api?${params}`);
139
+ if (!res.ok) throw new Error(`JPL Fireball API error: ${res.status}`);
140
+ const data = (await res.json()) as RawFireballData;
141
+
142
+ const fields = data.fields;
143
+ return {
144
+ count: parseInt(data.count, 10),
145
+ fireballs: data.data.map((row) => {
146
+ const obj: Record<string, string | null> = {};
147
+ fields.forEach((f, i) => { obj[f] = row[i]; });
148
+ return {
149
+ date: obj['date'],
150
+ energy_GJ: obj['energy'] ? parseFloat(obj['energy']) : null,
151
+ radiated_energy_J: obj['impact-e'] ? parseFloat(obj['impact-e']) : null,
152
+ latitude: obj['lat'] ? parseFloat(obj['lat']) : null,
153
+ latitude_dir: obj['lat-dir'],
154
+ longitude: obj['lon'] ? parseFloat(obj['lon']) : null,
155
+ longitude_dir: obj['lon-dir'],
156
+ altitude_km: obj['alt'] ? parseFloat(obj['alt']) : null,
157
+ velocity_km_s: obj['vel'] ? parseFloat(obj['vel']) : null,
158
+ };
159
+ }),
160
+ };
161
+ }
162
+
163
+ async function getCloseApproaches(limit: number) {
164
+ const params = new URLSearchParams({
165
+ limit: String(Math.min(limit, 50)),
166
+ 'dist-max': '0.05',
167
+ });
168
+ const res = await fetch(`${JPL_BASE}/cad.api?${params}`);
169
+ if (!res.ok) throw new Error(`JPL CAD API error: ${res.status}`);
170
+ const data = (await res.json()) as RawCadData;
171
+
172
+ const fields = data.fields;
173
+ return {
174
+ count: parseInt(data.count, 10),
175
+ close_approaches: data.data.map((row) => {
176
+ const obj: Record<string, string> = {};
177
+ fields.forEach((f, i) => { obj[f] = row[i]; });
178
+ return {
179
+ designation: obj['des'],
180
+ orbit_id: obj['orbit_id'],
181
+ jd_time: obj['jd'],
182
+ date: obj['cd'],
183
+ distance_au: obj['dist'] ? parseFloat(obj['dist']) : null,
184
+ distance_min_au: obj['dist_min'] ? parseFloat(obj['dist_min']) : null,
185
+ velocity_rel_km_s: obj['v_rel'] ? parseFloat(obj['v_rel']) : null,
186
+ velocity_inf_km_s: obj['v_inf'] ? parseFloat(obj['v_inf']) : null,
187
+ h_magnitude: obj['h'] ? parseFloat(obj['h']) : null,
188
+ };
189
+ }),
190
+ };
191
+ }
192
+
193
+ async function getNeoFeed(startDate: string, endDate: string) {
194
+ const params = new URLSearchParams({
195
+ start_date: startDate,
196
+ end_date: endDate,
197
+ api_key: 'DEMO_KEY',
198
+ });
199
+ const res = await fetch(`${NEO_BASE}/feed?${params}`);
200
+ if (!res.ok) throw new Error(`NASA NeoWs API error: ${res.status}`);
201
+ const data = (await res.json()) as RawNeoFeed;
202
+
203
+ const objects = Object.entries(data.near_earth_objects).flatMap(([date, neos]) =>
204
+ neos.map((neo) => ({
205
+ date,
206
+ id: neo.id,
207
+ name: neo.name,
208
+ potentially_hazardous: neo.is_potentially_hazardous_asteroid,
209
+ diameter_km_min: neo.estimated_diameter.kilometers.estimated_diameter_min,
210
+ diameter_km_max: neo.estimated_diameter.kilometers.estimated_diameter_max,
211
+ close_approaches: neo.close_approach_data.map((ca) => ({
212
+ date: ca.close_approach_date,
213
+ velocity_km_h: parseFloat(ca.relative_velocity.kilometers_per_hour),
214
+ miss_distance_au: parseFloat(ca.miss_distance.astronomical),
215
+ miss_distance_km: parseFloat(ca.miss_distance.kilometers),
216
+ orbiting_body: ca.orbiting_body,
217
+ })),
218
+ })),
219
+ );
220
+
221
+ return {
222
+ element_count: data.element_count,
223
+ near_earth_objects: objects,
224
+ };
225
+ }
226
+
227
+ export default { tools, callTool, meter: { credits: 5 } } 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
+ }