@cyanheads/astronomy-mcp-server 0.2.3 → 0.2.5

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.
Files changed (58) hide show
  1. package/AGENTS.md +3 -3
  2. package/CLAUDE.md +3 -3
  3. package/Dockerfile +7 -2
  4. package/README.md +32 -7
  5. package/changelog/0.2.x/0.2.4.md +29 -0
  6. package/changelog/0.2.x/0.2.5.md +19 -0
  7. package/changelog/template.md +55 -16
  8. package/dist/config/server-config.js +3 -3
  9. package/dist/config/server-config.js.map +1 -1
  10. package/dist/mcp-server/tools/definitions/find-events.tool.d.ts +10 -0
  11. package/dist/mcp-server/tools/definitions/find-events.tool.d.ts.map +1 -1
  12. package/dist/mcp-server/tools/definitions/find-events.tool.js +15 -0
  13. package/dist/mcp-server/tools/definitions/find-events.tool.js.map +1 -1
  14. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts +2 -2
  15. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js +12 -9
  17. package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.d.ts +10 -0
  19. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js +15 -0
  21. package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts +10 -0
  23. package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/definitions/get-rise-set.tool.js +15 -0
  25. package/dist/mcp-server/tools/definitions/get-rise-set.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts +35 -6
  27. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js +92 -13
  29. package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/get-sky-position.tool.d.ts +10 -0
  31. package/dist/mcp-server/tools/definitions/get-sky-position.tool.d.ts.map +1 -1
  32. package/dist/mcp-server/tools/definitions/get-sky-position.tool.js +15 -0
  33. package/dist/mcp-server/tools/definitions/get-sky-position.tool.js.map +1 -1
  34. package/dist/mcp-server/tools/definitions/list-visible.tool.d.ts +10 -0
  35. package/dist/mcp-server/tools/definitions/list-visible.tool.d.ts.map +1 -1
  36. package/dist/mcp-server/tools/definitions/list-visible.tool.js +15 -0
  37. package/dist/mcp-server/tools/definitions/list-visible.tool.js.map +1 -1
  38. package/dist/services/ephemeris/ephemeris-service.d.ts +8 -1
  39. package/dist/services/ephemeris/ephemeris-service.d.ts.map +1 -1
  40. package/dist/services/ephemeris/ephemeris-service.js +15 -4
  41. package/dist/services/ephemeris/ephemeris-service.js.map +1 -1
  42. package/dist/services/ephemeris/iso-time.d.ts +24 -0
  43. package/dist/services/ephemeris/iso-time.d.ts.map +1 -0
  44. package/dist/services/ephemeris/iso-time.js +67 -0
  45. package/dist/services/ephemeris/iso-time.js.map +1 -0
  46. package/dist/services/horizons/horizons-service.d.ts.map +1 -1
  47. package/dist/services/horizons/horizons-service.js +3 -7
  48. package/dist/services/horizons/horizons-service.js.map +1 -1
  49. package/dist/services/satellite/satellite-service.d.ts +67 -22
  50. package/dist/services/satellite/satellite-service.d.ts.map +1 -1
  51. package/dist/services/satellite/satellite-service.js +218 -82
  52. package/dist/services/satellite/satellite-service.js.map +1 -1
  53. package/dist/services/satellite/types.d.ts +60 -7
  54. package/dist/services/satellite/types.d.ts.map +1 -1
  55. package/dist/services/satellite/types.js +36 -2
  56. package/dist/services/satellite/types.js.map +1 -1
  57. package/package.json +4 -4
  58. package/server.json +11 -5
@@ -1,21 +1,27 @@
1
1
  /**
2
2
  * @fileoverview SatelliteService — gated extension that predicts visible satellite
3
- * passes. Fetches the current TLE from CelesTrak (keyless, cached briefly in
4
- * process per CelesTrak's refetch guidance), propagates with SGP4 via satellite.js
5
- * (offline), and returns above-horizon passes. A pass is "visible" only when the
6
- * satellite is sunlit at peak AND the observer's sky is dark — the ground-darkness
7
- * gate reuses the core sun-altitude logic. A pass already underway when the window
8
- * opens is omitted rather than reported with the query boundary as its rise, and an
9
- * element set that will not propagate to the window is rejected — naming the object
10
- * or the requested instant, whichever the epoch distance implicates — rather than
11
- * yielding no passes. Network-touching code carries its own timeout + retry boundary
12
- * and degrades loudly; it never substitutes core output.
3
+ * passes. Fetches the current GP element set from CelesTrak as OMM JSON (keyless,
4
+ * cached briefly in process per CelesTrak's refetch guidance), propagates it with SGP4
5
+ * via satellite.js (offline), and returns above-horizon passes. One request builder
6
+ * serves both lookups: by catalog number (`CATNR=`) and by name (`NAME=`, a
7
+ * case-insensitive substring match whose single-match response already carries the
8
+ * element set, so resolving a name costs no extra round trip). A pass is "visible"
9
+ * only when the satellite is sunlit at peak AND the observer's sky is dark — the
10
+ * ground-darkness gate reuses the core sun-altitude logic. A pass already underway
11
+ * when the window opens is omitted rather than reported with the query boundary as its
12
+ * rise, and an element set that will not propagate to the window is rejected — naming
13
+ * the object or the requested instant, whichever the epoch distance implicates —
14
+ * rather than yielding no passes. Network-touching code carries its own timeout +
15
+ * retry boundary and degrades loudly; it never substitutes core output. A response
16
+ * that parses but is not an OMM element set is reported apart from an outage — its
17
+ * shape is a property of the record, so retrying it can only fail again.
13
18
  * @module services/satellite/satellite-service
14
19
  */
15
- import { invalidParams, JsonRpcErrorCode, McpError, notFound, serviceUnavailable, } from '@cyanheads/mcp-ts-core/errors';
16
- import { fetchWithTimeout, requestContextService, withRetry } from '@cyanheads/mcp-ts-core/utils';
20
+ import { invalidParams, JsonRpcErrorCode, McpError, notFound, serializationError, serviceUnavailable, } from '@cyanheads/mcp-ts-core/errors';
21
+ import { fetchWithTimeout, withRetry } from '@cyanheads/mcp-ts-core/utils';
17
22
  import { Body, Equator, Horizon, MakeTime, Observer } from 'astronomy-engine';
18
- import { ecfToLookAngles, eciToEcf, gstime, jday, propagate, shadowFraction, sunPos, twoline2satrec, } from 'satellite.js';
23
+ import { ecfToLookAngles, eciToEcf, gstime, jday, json2satrec, propagate, shadowFraction, sunPos, } from 'satellite.js';
24
+ import { OmmResponseSchema, } from './types.js';
19
25
  const DEG = 180 / Math.PI;
20
26
  /**
21
27
  * Opt in to satellite.js's community decay check on every propagation. Reference SGP4
@@ -41,6 +47,34 @@ const MIN_PEAK_ELEVATION = 10;
41
47
  const STEP_SECONDS = 30;
42
48
  /** Ground is "dark enough" for a naked-eye pass when the Sun is below this altitude (civil dusk). */
43
49
  const GROUND_DARK_SUN_ALT = -6;
50
+ /**
51
+ * How many candidates an ambiguous name query offers back. CelesTrak's `NAME=` is a
52
+ * case-insensitive substring match, so an everyday query is routinely five figures deep
53
+ * ("STARLINK" matches over ten thousand objects) — the list exists to let a caller
54
+ * recognize the object it meant, not to enumerate the catalog. Twenty covers a real
55
+ * family (the handful of objects carrying "HUBBLE", a weather-satellite series) while
56
+ * keeping the error small enough to read; past that the answer is to narrow the name,
57
+ * and the match count says so rather than passing a slice off as the whole set.
58
+ */
59
+ const MAX_NAME_CANDIDATES = 20;
60
+ /**
61
+ * Recovery hints, byte-identical to the `recovery` strings the tool declares for the
62
+ * same reasons. The contract entry documents the next move and this is the copy that
63
+ * reaches the wire; a test pins each pair so the two cannot drift apart.
64
+ */
65
+ const TLE_NOT_FOUND_RECOVERY = 'Verify the catalog number at celestrak.org; the object may have decayed or never been catalogued.';
66
+ const NAME_NOT_FOUND_RECOVERY = 'Check the spelling, try a shorter distinctive substring, or look the object up at celestrak.org.';
67
+ const AMBIGUOUS_NAME_RECOVERY = 'Re-call with norad_id set to one of the listed candidates, or supply a longer, more specific name.';
68
+ /**
69
+ * The hint for an ambiguity whose candidate list is a slice rather than the whole match
70
+ * set. Picking from the list is the right first move only when the list is complete;
71
+ * offered against a constellation query it invites a confident pass prediction for an
72
+ * object the caller never asked about, so the truncated case leads with narrowing and
73
+ * makes the list conditional on the wanted object actually appearing in it.
74
+ */
75
+ const AMBIGUOUS_NAME_TRUNCATED_RECOVERY = 'Supply a longer, more specific name — the listed candidates are only the lowest-numbered few of the matches. Use norad_id only if the object you want is among them.';
76
+ const CELESTRAK_UNAVAILABLE_RECOVERY = 'CelesTrak is degraded or timed out; retry in a few minutes.';
77
+ const MALFORMED_ELEMENT_SET_RECOVERY = 'Retrying returns the same record — request a different object, and report the element set to celestrak.org.';
44
78
  export class SatelliteService {
45
79
  baseUrl;
46
80
  timeoutMs;
@@ -51,91 +85,193 @@ export class SatelliteService {
51
85
  this.timeoutMs = timeoutMs;
52
86
  this.cacheTtlMs = cacheTtlMs;
53
87
  }
54
- /** Fetch a current TLE for a NORAD ID, using the in-process TTL cache. */
55
- async fetchTle(noradId, ctx) {
56
- const cached = this.cache.get(noradId);
57
- if (cached && cached.expiresAt > Date.now())
58
- return cached.tle;
59
- const reqCtx = requestContextService.createRequestContext({
60
- operation: 'SatelliteService.fetchTle',
61
- parentContext: { requestId: ctx.requestId, traceId: ctx.traceId },
62
- });
63
- const url = `${this.baseUrl}?CATNR=${noradId}&FORMAT=TLE`;
88
+ /** Fetch the current element set for a NORAD ID, using the in-process TTL cache. */
89
+ async fetchElementSet(noradId, ctx) {
90
+ const cacheKey = `CATNR=${noradId}`;
91
+ const cached = this.fromCache(cacheKey);
92
+ if (cached)
93
+ return cached;
94
+ const records = await this.fetchGpRecords(cacheKey, `NORAD ID ${noradId}`, ctx, () => this.catalogMiss(noradId));
95
+ return this.cacheElementSet(cacheKey, records[0]);
96
+ }
97
+ /**
98
+ * Resolve a satellite name to the one current element set it names. CelesTrak matches
99
+ * `NAME=` as a case-insensitive substring, so a query resolves only when it picks out a
100
+ * single object — either because it matched one, or because exactly one match carries
101
+ * that name outright, which is a request for that object however many longer names
102
+ * contain it. Anything else comes back as candidates to choose from.
103
+ */
104
+ async resolveByName(name, ctx) {
105
+ const query = name.trim();
106
+ const cacheKey = `NAME=${encodeURIComponent(query)}`;
107
+ const cached = this.fromCache(cacheKey);
108
+ if (cached)
109
+ return cached;
110
+ const records = await this.fetchGpRecords(cacheKey, `the name "${query}"`, ctx, () => this.nameMiss(query));
111
+ const single = records.length === 1 ? records[0] : this.exactlyNamed(records, query);
112
+ if (!single)
113
+ throw this.ambiguousName(records, query);
114
+ return this.cacheElementSet(cacheKey, single);
115
+ }
116
+ /** The one record whose `OBJECT_NAME` is the query itself, when exactly one is. */
117
+ exactlyNamed(records, query) {
118
+ const wanted = query.toLowerCase();
119
+ const exact = records.filter((r) => r.OBJECT_NAME.trim().toLowerCase() === wanted);
120
+ return exact.length === 1 ? exact[0] : undefined;
121
+ }
122
+ /** The cached element set for a query, while its TTL holds. */
123
+ fromCache(cacheKey) {
124
+ const entry = this.cache.get(cacheKey);
125
+ return entry && entry.expiresAt > Date.now() ? entry.elements : undefined;
126
+ }
127
+ cacheElementSet(cacheKey, record) {
128
+ const elements = {
129
+ name: record.OBJECT_NAME.trim(),
130
+ noradId: Number(record.NORAD_CAT_ID),
131
+ omm: record,
132
+ };
133
+ this.cache.set(cacheKey, { elements, expiresAt: Date.now() + this.cacheTtlMs });
134
+ return elements;
135
+ }
136
+ /**
137
+ * Run one GP query and return the records it matched. `FORMAT=JSON` rather than
138
+ * `FORMAT=TLE`: the legacy format cannot encode a catalog number above 99999, and
139
+ * CelesTrak refuses to serve such an object as TLE at all, so JSON is the only format
140
+ * covering the whole catalog. `params` is the query fragment selecting the objects
141
+ * (`CATNR=` or `NAME=`); `miss` names an empty result in the caller's own terms, since
142
+ * "no object with that catalog number" and "no object with that name" are different
143
+ * answers with different next moves.
144
+ */
145
+ async fetchGpRecords(params, subject, ctx, miss) {
146
+ const url = `${this.baseUrl}?${params}&FORMAT=JSON`;
64
147
  let text;
65
148
  try {
66
149
  text = await withRetry(async () => {
67
- const response = await fetchWithTimeout(url, this.timeoutMs, reqCtx, {
150
+ const response = await fetchWithTimeout(url, this.timeoutMs, ctx, {
68
151
  signal: ctx.signal,
69
- // CelesTrak answers an uncatalogued object with 404, which is a domain
70
- // outcome here (tle_not_found), not a service failure — log it at debug.
71
- // The thrown status-mapped McpError is unchanged; only severity drops.
152
+ // CelesTrak answers an unmatched query with 404, which is a domain outcome
153
+ // here (a miss), not a service failure — log it at debug. The thrown
154
+ // status-mapped McpError is unchanged; only severity drops.
72
155
  expectedStatuses: [404],
73
156
  });
74
157
  return response.text();
75
158
  }, {
76
- operation: 'SatelliteService.fetchTle',
77
- context: reqCtx,
159
+ operation: 'SatelliteService.fetchGpRecords',
160
+ context: ctx,
78
161
  baseDelayMs: 1000,
79
162
  signal: ctx.signal,
80
163
  });
81
164
  }
82
165
  catch (err) {
83
- // fetchWithTimeout throws a status-mapped McpError on any non-2xx whose
84
- // data carries raw upstream internals (URL, status/body plus the legacy
85
- // statusCode/responseBody aliases). Map it into the typed contract with
86
- // clean data so nothing upstream leaks to the client. CelesTrak answers a
87
- // missing object with 404 → NotFound.
88
- throw this.classifyFetchError(err, noradId);
166
+ /**
167
+ * fetchWithTimeout throws a status-mapped McpError on any non-2xx whose data
168
+ * carries raw upstream internals (URL, status/body plus the legacy
169
+ * statusCode/responseBody aliases). Map it into the typed contract with clean data
170
+ * so nothing upstream leaks to the client. CelesTrak answers an unmatched query
171
+ * with 404 → NotFound; everything else — 5xx, a fetch deadline, a network failure
172
+ * — is an outage. The original rides as `cause` for server-side logs only.
173
+ */
174
+ if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound)
175
+ throw miss();
176
+ throw serviceUnavailable(`Failed to fetch element sets for ${subject} from CelesTrak.`, {
177
+ reason: 'celestrak_unavailable',
178
+ recovery: { hint: CELESTRAK_UNAVAILABLE_RECOVERY },
179
+ }, { cause: err instanceof Error ? err : undefined });
89
180
  }
90
- const tle = this.parseTle(text, noradId);
91
- this.cache.set(noradId, { tle, expiresAt: Date.now() + this.cacheTtlMs });
92
- return tle;
181
+ return this.parseGpRecords(text, subject, miss);
93
182
  }
94
183
  /**
95
- * Map a fetch/transport McpError onto the typed contract with leak-free data.
96
- * A NotFound (CelesTrak's 404 for an uncatalogued object) becomes tle_not_found;
97
- * everything else — 5xx (ServiceUnavailable), a fetch deadline (Timeout), or a
98
- * network failure — becomes celestrak_unavailable. The
99
- * original error rides as `cause` for server-side logs but never reaches the client.
184
+ * Parse a CelesTrak GP response into OMM records. The miss sentinel has to be tested
185
+ * before `JSON.parse`: CelesTrak returns that text under a 200 in some cases, and
186
+ * parsing it would throw a `SyntaxError` where the caller is owed a typed miss.
100
187
  */
101
- classifyFetchError(err, noradId) {
102
- if (err instanceof McpError && err.code === JsonRpcErrorCode.NotFound) {
103
- return notFound(`CelesTrak has no current element set for NORAD ID ${noradId}.`, {
104
- reason: 'tle_not_found',
105
- recovery: {
106
- hint: 'Verify the catalog number at celestrak.org; the object may have decayed or never been catalogued.',
107
- },
108
- });
109
- }
110
- return serviceUnavailable(`Failed to fetch a TLE for NORAD ID ${noradId} from CelesTrak.`, {
111
- reason: 'celestrak_unavailable',
112
- recovery: { hint: 'CelesTrak is degraded or timed out; retry in a few minutes.' },
113
- }, { cause: err instanceof Error ? err : undefined });
114
- }
115
- /** Parse a CelesTrak TLE response (optional name line + the two element lines). */
116
- parseTle(text, noradId) {
188
+ parseGpRecords(text, subject, miss) {
117
189
  const trimmed = text.trim();
118
- if (/No GP data found|Invalid query/i.test(trimmed) || trimmed.length === 0) {
119
- throw notFound(`CelesTrak has no current element set for NORAD ID ${noradId}.`, {
120
- reason: 'tle_not_found',
121
- recovery: {
122
- hint: 'Verify the catalog number at celestrak.org; the object may have decayed or never been catalogued.',
123
- },
124
- });
190
+ if (trimmed.length === 0 || /No GP data found|Invalid query/i.test(trimmed))
191
+ throw miss();
192
+ let parsed;
193
+ try {
194
+ parsed = JSON.parse(trimmed);
125
195
  }
126
- const lines = trimmed.split('\n').map((l) => l.trimEnd());
127
- const line1Index = lines.findIndex((l) => l.startsWith('1 '));
128
- const line2Index = lines.findIndex((l) => l.startsWith('2 '));
129
- const line1 = line1Index === -1 ? undefined : lines[line1Index];
130
- const line2 = line2Index === -1 ? undefined : lines[line2Index];
131
- if (!line1 || !line2) {
132
- throw serviceUnavailable(`CelesTrak returned an unparsable response for NORAD ID ${noradId}.`, {
133
- reason: 'celestrak_unavailable',
134
- recovery: { hint: 'CelesTrak may be degraded; retry in a few minutes.' },
135
- });
196
+ catch {
197
+ throw this.unparsable(subject);
136
198
  }
137
- const nameLine = line1Index > 0 ? lines[line1Index - 1]?.trim() : undefined;
138
- return { ...(nameLine ? { name: nameLine } : {}), line1, line2 };
199
+ const records = OmmResponseSchema.safeParse(parsed);
200
+ /**
201
+ * A body that parsed as JSON but does not carry an OMM element set is a different
202
+ * outcome from one that is not GP data at all: CelesTrak answered, with a record
203
+ * whose shape is a permanent property of that record. Retrying reaches the same
204
+ * record and fails the same way, so it is classified apart from the outage rather
205
+ * than sending the caller into a loop that can only fail again.
206
+ */
207
+ if (!records.success)
208
+ throw this.malformedElementSet(subject, records.error.issues);
209
+ if (records.data.length === 0)
210
+ throw miss();
211
+ return records.data;
212
+ }
213
+ unparsable(subject) {
214
+ return serviceUnavailable(`CelesTrak returned an unparsable response for ${subject}.`, {
215
+ reason: 'celestrak_unavailable',
216
+ recovery: { hint: CELESTRAK_UNAVAILABLE_RECOVERY },
217
+ });
218
+ }
219
+ /**
220
+ * Name the record that failed OMM validation, and the fields that failed it. Each
221
+ * issue path is `[record index, field name]`, and those names are the OMM message's
222
+ * own, so listing them says which part of the record is wrong without putting the
223
+ * validator's vocabulary — issue codes, expected/received types — on the wire. A body
224
+ * whose whole shape is wrong (an object where an array belongs) names no field, and
225
+ * the message stands on the subject alone.
226
+ */
227
+ malformedElementSet(subject, issues) {
228
+ const fields = [...new Set(issues.map(({ path: [, field] }) => field))].filter((field) => typeof field === 'string');
229
+ const named = fields.length > 0 ? ` Fields that did not validate: ${fields.join(', ')}.` : '';
230
+ return serializationError(`CelesTrak returned a GP record for ${subject} that is not a valid OMM element set.${named}`, {
231
+ reason: 'malformed_element_set',
232
+ recovery: { hint: MALFORMED_ELEMENT_SET_RECOVERY },
233
+ });
234
+ }
235
+ catalogMiss(noradId) {
236
+ return notFound(`CelesTrak has no current element set for NORAD ID ${noradId}.`, {
237
+ reason: 'tle_not_found',
238
+ recovery: { hint: TLE_NOT_FOUND_RECOVERY },
239
+ });
240
+ }
241
+ nameMiss(query) {
242
+ return notFound(`No current CelesTrak object has a name containing "${query}".`, {
243
+ reason: 'satellite_name_not_found',
244
+ recovery: { hint: NAME_NOT_FOUND_RECOVERY },
245
+ });
246
+ }
247
+ /**
248
+ * Hand back the objects a name query matched so the caller can name one outright. The
249
+ * total is stated whether or not the list is complete, because a slice presented as the
250
+ * whole set would read as a catalog holding twenty Starlinks. Ordered by catalog
251
+ * number — the order CelesTrak already answers in — so the same query always offers the
252
+ * same candidates. Whether the list is complete also selects the hint: a complete list
253
+ * is something to pick from, a slice is something to narrow past.
254
+ */
255
+ ambiguousName(records, query) {
256
+ const candidates = records
257
+ .map((r) => ({ name: r.OBJECT_NAME.trim(), norad_id: Number(r.NORAD_CAT_ID) }))
258
+ .sort((a, b) => a.norad_id - b.norad_id)
259
+ .slice(0, MAX_NAME_CANDIDATES);
260
+ const truncated = records.length > candidates.length;
261
+ const listing = candidates.map((c) => `${c.name} (${c.norad_id})`).join(', ');
262
+ const preamble = truncated
263
+ ? `"${query}" matches ${records.length} current CelesTrak objects. The ${candidates.length} with the lowest catalog numbers:`
264
+ : `"${query}" matches ${records.length} current CelesTrak objects:`;
265
+ return invalidParams(`${preamble} ${listing}.`, {
266
+ reason: 'ambiguous_satellite_name',
267
+ recovery: {
268
+ hint: truncated ? AMBIGUOUS_NAME_TRUNCATED_RECOVERY : AMBIGUOUS_NAME_RECOVERY,
269
+ },
270
+ match_count: records.length,
271
+ shown: candidates.length,
272
+ truncated,
273
+ candidates,
274
+ });
139
275
  }
140
276
  /**
141
277
  * Predict visible passes over the next `days` from `start`. Steps the orbit with
@@ -147,8 +283,8 @@ export class SatelliteService {
147
283
  * `time_out_of_range`. Without that check either condition reaches the caller as
148
284
  * `passes: []`, which reads identically to "nothing visible tonight".
149
285
  */
150
- predictPasses(tle, noradId, observer, days, start, formatLocal) {
151
- const satrec = twoline2satrec(tle.line1, tle.line2);
286
+ predictPasses(elements, observer, days, start, formatLocal) {
287
+ const satrec = json2satrec(elements.omm);
152
288
  /**
153
289
  * Probe the first instant of the window before scanning it. SGP4 refuses an element
154
290
  * set it can no longer turn into an orbit by answering null, and the scan loop would
@@ -156,7 +292,7 @@ export class SatelliteService {
156
292
  * list. Reject up front instead, naming which of the two causes applies.
157
293
  */
158
294
  if (!propagate(satrec, start, PROPAGATE_OPTIONS)) {
159
- throw this.classifyPropagationFailure(satrec, noradId, start);
295
+ throw this.classifyPropagationFailure(satrec, elements.noradId, start);
160
296
  }
161
297
  const observerGd = {
162
298
  longitude: (observer.longitude * Math.PI) / 180,
@@ -245,7 +381,7 @@ export class SatelliteService {
245
381
  peakElevation = -90;
246
382
  }
247
383
  }
248
- return { noradId, ...(tle.name ? { satelliteName: tle.name } : {}), passes };
384
+ return { noradId: elements.noradId, satelliteName: elements.name, passes };
249
385
  }
250
386
  /**
251
387
  * Name the reason SGP4 refused the first instant of the window. The refusal on its own
@@ -1 +1 @@
1
- {"version":3,"file":"satellite-service.js","sourceRoot":"","sources":["../../../src/services/satellite/satellite-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAA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AAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC7D,OAAO,GAAG,CAAC,QAAQ,GAAG,mBAAmB,CAAC;IAC5C,CAAC;CACF;AAED,+EAA+E;AAE/E,IAAI,QAAsC,CAAC;AAE3C,6FAA6F;AAC7F,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,SAAiB,EAAE,UAAkB;IACzF,QAAQ,GAAG,IAAI,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAClE,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,7 +1,10 @@
1
1
  /**
2
- * @fileoverview Domain types for the satellite-pass extension.
2
+ * @fileoverview Domain types for the satellite-pass extension, including the OMM
3
+ * (Orbit Mean-Elements Message) record CelesTrak serves under `FORMAT=JSON` — the
4
+ * only format that carries the six-digit catalog numbers now in the catalog.
3
5
  * @module services/satellite/types
4
6
  */
7
+ import { z } from '@cyanheads/mcp-ts-core';
5
8
  /** A single visible pass of a satellite over an observer. */
6
9
  export interface SatellitePass {
7
10
  durationSeconds: number;
@@ -21,12 +24,62 @@ export interface SatellitePass {
21
24
  export interface SatellitePassResult {
22
25
  noradId: number;
23
26
  passes: SatellitePass[];
24
- satelliteName?: string;
27
+ satelliteName: string;
25
28
  }
26
- /** A parsed two-line element set plus its display name. */
27
- export interface Tle {
28
- line1: string;
29
- line2: string;
30
- name?: string;
29
+ /**
30
+ * One GP record as CelesTrak serves it under `FORMAT=JSON`. Validated at the network
31
+ * edge because every field here is read straight into the SGP4 initializer — a missing
32
+ * one becomes NaN and surfaces as a plausible-looking but meaningless pass rather than a
33
+ * failure. `OBJECT_ID` and `ELEMENT_SET_NO` take no part in the propagation math but are
34
+ * required by the OMM v3 record the propagator accepts, and CelesTrak supplies both on
35
+ * every GP record. Unknown keys are dropped: nothing downstream reads them.
36
+ */
37
+ export declare const OmmRecordSchema: z.ZodObject<{
38
+ ARG_OF_PERICENTER: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
39
+ BSTAR: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
40
+ ECCENTRICITY: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
41
+ ELEMENT_SET_NO: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
42
+ EPOCH: z.ZodString;
43
+ INCLINATION: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
44
+ MEAN_ANOMALY: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
45
+ MEAN_MOTION: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
46
+ MEAN_MOTION_DDOT: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
47
+ MEAN_MOTION_DOT: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
48
+ NORAD_CAT_ID: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
49
+ OBJECT_ID: z.ZodString;
50
+ OBJECT_NAME: z.ZodString;
51
+ RA_OF_ASC_NODE: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
52
+ }, z.core.$strip>;
53
+ export type OmmRecord = z.infer<typeof OmmRecordSchema>;
54
+ /** A CelesTrak `FORMAT=JSON` response body: an array of GP records, one per match. */
55
+ export declare const OmmResponseSchema: z.ZodArray<z.ZodObject<{
56
+ ARG_OF_PERICENTER: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
57
+ BSTAR: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
58
+ ECCENTRICITY: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
59
+ ELEMENT_SET_NO: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
60
+ EPOCH: z.ZodString;
61
+ INCLINATION: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
62
+ MEAN_ANOMALY: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
63
+ MEAN_MOTION: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
64
+ MEAN_MOTION_DDOT: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
65
+ MEAN_MOTION_DOT: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
66
+ NORAD_CAT_ID: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
67
+ OBJECT_ID: z.ZodString;
68
+ OBJECT_NAME: z.ZodString;
69
+ RA_OF_ASC_NODE: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
70
+ }, z.core.$strip>>;
71
+ /** A current element set for one catalogued object, with its identity resolved. */
72
+ export interface ElementSet {
73
+ name: string;
74
+ noradId: number;
75
+ omm: OmmRecord;
76
+ }
77
+ /**
78
+ * One object a name query matched. Snake-cased because this shape goes straight onto the
79
+ * wire in the ambiguity error's `data`, alongside the tool's other client-facing fields.
80
+ */
81
+ export interface SatelliteCandidate {
82
+ name: string;
83
+ norad_id: number;
31
84
  }
32
85
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/satellite/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,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O,eAAe,CAAC,CAAC;AAExD,sFAAsF;AACtF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;kBAA2B,CAAC;AAE1D,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,SAAS,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -1,6 +1,40 @@
1
1
  /**
2
- * @fileoverview Domain types for the satellite-pass extension.
2
+ * @fileoverview Domain types for the satellite-pass extension, including the OMM
3
+ * (Orbit Mean-Elements Message) record CelesTrak serves under `FORMAT=JSON` — the
4
+ * only format that carries the six-digit catalog numbers now in the catalog.
3
5
  * @module services/satellite/types
4
6
  */
5
- export {};
7
+ import { z } from '@cyanheads/mcp-ts-core';
8
+ /**
9
+ * The OMM spec leaves numeric types open and sources disagree — CelesTrak emits numbers,
10
+ * Space-Track emits strings. The propagator coerces either, so accept both rather than
11
+ * rejecting a well-formed element set over its JSON type.
12
+ */
13
+ const OmmNumber = z.union([z.number(), z.string()]);
14
+ /**
15
+ * One GP record as CelesTrak serves it under `FORMAT=JSON`. Validated at the network
16
+ * edge because every field here is read straight into the SGP4 initializer — a missing
17
+ * one becomes NaN and surfaces as a plausible-looking but meaningless pass rather than a
18
+ * failure. `OBJECT_ID` and `ELEMENT_SET_NO` take no part in the propagation math but are
19
+ * required by the OMM v3 record the propagator accepts, and CelesTrak supplies both on
20
+ * every GP record. Unknown keys are dropped: nothing downstream reads them.
21
+ */
22
+ export const OmmRecordSchema = z.object({
23
+ ARG_OF_PERICENTER: OmmNumber,
24
+ BSTAR: OmmNumber,
25
+ ECCENTRICITY: OmmNumber,
26
+ ELEMENT_SET_NO: OmmNumber,
27
+ EPOCH: z.string(),
28
+ INCLINATION: OmmNumber,
29
+ MEAN_ANOMALY: OmmNumber,
30
+ MEAN_MOTION: OmmNumber,
31
+ MEAN_MOTION_DDOT: OmmNumber,
32
+ MEAN_MOTION_DOT: OmmNumber,
33
+ NORAD_CAT_ID: OmmNumber,
34
+ OBJECT_ID: z.string(),
35
+ OBJECT_NAME: z.string(),
36
+ RA_OF_ASC_NODE: OmmNumber,
37
+ });
38
+ /** A CelesTrak `FORMAT=JSON` response body: an array of GP records, one per match. */
39
+ export const OmmResponseSchema = z.array(OmmRecordSchema);
6
40
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/satellite/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/satellite/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAyB3C;;;;GAIG;AACH,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,iBAAiB,EAAE,SAAS;IAC5B,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,SAAS;IACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;IACvB,WAAW,EAAE,SAAS;IACtB,gBAAgB,EAAE,SAAS;IAC3B,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,cAAc,EAAE,SAAS;CAC1B,CAAC,CAAC;AAIH,sFAAsF;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/astronomy-mcp-server",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "mcpName": "io.github.cyanheads/astronomy-mcp-server",
5
5
  "description": "What's in the sky, computed offline — planet and moon positions, rise/set, phases, eclipses, and seasons for any place and time via MCP. STDIO or Streamable HTTP.",
6
6
  "type": "module",
@@ -86,16 +86,16 @@
86
86
  "access": "public"
87
87
  },
88
88
  "dependencies": {
89
- "@cyanheads/mcp-ts-core": "^0.11.0",
89
+ "@cyanheads/mcp-ts-core": "^0.11.5",
90
90
  "astronomy-engine": "^2.1.19",
91
91
  "pino-pretty": "^13.1.3",
92
92
  "satellite.js": "^7.1.0",
93
93
  "zod": "^4.4.3"
94
94
  },
95
95
  "devDependencies": {
96
- "@biomejs/biome": "2.5.5",
96
+ "@biomejs/biome": "2.5.8",
97
97
  "@socketsecurity/bun-security-scanner": "^1.1.2",
98
- "@types/node": "^26.1.2",
98
+ "@types/node": "^26.2.0",
99
99
  "depcheck": "^1.4.7",
100
100
  "ignore": "^7.0.6",
101
101
  "tsc-alias": "^1.9.1",
package/server.json CHANGED
@@ -6,14 +6,20 @@
6
6
  "url": "https://github.com/cyanheads/astronomy-mcp-server",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.2.3",
9
+ "version": "0.2.5",
10
+ "remotes": [
11
+ {
12
+ "type": "streamable-http",
13
+ "url": "https://astronomy.caseyjhand.com/mcp"
14
+ }
15
+ ],
10
16
  "packages": [
11
17
  {
12
18
  "registryType": "npm",
13
19
  "registryBaseUrl": "https://registry.npmjs.org",
14
20
  "identifier": "@cyanheads/astronomy-mcp-server",
15
21
  "runtimeHint": "bun",
16
- "version": "0.2.3",
22
+ "version": "0.2.5",
17
23
  "packageArguments": [
18
24
  {
19
25
  "type": "positional",
@@ -41,7 +47,7 @@
41
47
  },
42
48
  {
43
49
  "name": "ASTRONOMY_ENABLE_SATELLITES",
44
- "description": "Register the astronomy_get_satellite_passes tool, which predicts visible satellite passes from CelesTrak TLEs propagated with SGP4. Off by default.",
50
+ "description": "Register the astronomy_get_satellite_passes tool, which predicts visible satellite passes from CelesTrak GP element sets propagated with SGP4. Off by default.",
45
51
  "format": "string",
46
52
  "isRequired": false,
47
53
  "default": "false"
@@ -62,7 +68,7 @@
62
68
  "registryBaseUrl": "https://registry.npmjs.org",
63
69
  "identifier": "@cyanheads/astronomy-mcp-server",
64
70
  "runtimeHint": "bun",
65
- "version": "0.2.3",
71
+ "version": "0.2.5",
66
72
  "packageArguments": [
67
73
  {
68
74
  "type": "positional",
@@ -118,7 +124,7 @@
118
124
  },
119
125
  {
120
126
  "name": "ASTRONOMY_ENABLE_SATELLITES",
121
- "description": "Register the astronomy_get_satellite_passes tool, which predicts visible satellite passes from CelesTrak TLEs propagated with SGP4. Off by default.",
127
+ "description": "Register the astronomy_get_satellite_passes tool, which predicts visible satellite passes from CelesTrak GP element sets propagated with SGP4. Off by default.",
122
128
  "format": "string",
123
129
  "isRequired": false,
124
130
  "default": "false"