@openephemeris/mcp-server 3.12.0 → 3.13.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/README.md CHANGED
@@ -355,8 +355,8 @@ Generated by `npm run sync:readme` from `config/dev-allowlist.json` and the live
355
355
 
356
356
  - Allowlisted operations: **28**
357
357
  - Methods: `GET=4`, `POST=24`, `PUT=0`, `PATCH=0`, `DELETE=0`
358
- - Registered tools (`OPENEPHEMERIS_PROFILE=dev`): **57**
359
- - Typed tools: `acg_hits`, `acg_power_lines`, `auth_login`, `auth_logout`, `auth_status`, `chart_wheel_on_aspect_click`, `chart_wheel_on_house_click`, `chart_wheel_on_planet_click`, `chart_wheel_recalculate`, `chinese_bazi`, `dev_call`, `dev_list_allowed`, `electional_aspect_search`, `electional_moment_analysis`, `electional_station_tracker`, `ephemeris_angles_points`, `ephemeris_aspect_check`, `ephemeris_bi_wheel`, `ephemeris_chart_wheel`, `ephemeris_composite`, `ephemeris_composite_midpoint`, `ephemeris_dignities`, `ephemeris_electional`, `ephemeris_fixed_stars`, `ephemeris_hermetic_lots`, `ephemeris_house_cusps`, `ephemeris_lunar_return`, `ephemeris_midpoints`, `ephemeris_moon_phase`, `ephemeris_natal_batch`, `ephemeris_natal_chart`, `ephemeris_natal_transits`, `ephemeris_next_eclipse`, `ephemeris_next_lunar_phase`, `ephemeris_overlay`, `ephemeris_planet_position`, `ephemeris_planetary_return`, `ephemeris_progressed_chart`, `ephemeris_relocation`, `ephemeris_retrograde_status`, `ephemeris_solar_return`, `ephemeris_synastry`, `ephemeris_transits`, `explore_natal_chart`, `hd_opposition`, `hd_planetary_return`, `human_design_bodygraph`, `human_design_chart`, `human_design_composite`, `human_design_penta`, `vedic_chart`, `venus_eight_year_star`, `venus_elongations`, `venus_phase`, `venus_star_points`, `venus_star_points_conjunctions`, `venus_stations`
358
+ - Registered tools (`OPENEPHEMERIS_PROFILE=dev`): **64**
359
+ - Typed tools: `acg_hits`, `acg_power_lines`, `auth_login`, `auth_logout`, `auth_status`, `bi_wheel_on_cross_aspect_click`, `bi_wheel_on_planet_click`, `chart_wheel_on_aspect_click`, `chart_wheel_on_house_click`, `chart_wheel_on_planet_click`, `chart_wheel_recalculate`, `chinese_bazi`, `dev_call`, `dev_list_allowed`, `electional_aspect_search`, `electional_moment_analysis`, `electional_station_tracker`, `ephemeris_angles_points`, `ephemeris_aspect_check`, `ephemeris_bi_wheel`, `ephemeris_chart_wheel`, `ephemeris_composite`, `ephemeris_composite_midpoint`, `ephemeris_dignities`, `ephemeris_electional`, `ephemeris_fixed_stars`, `ephemeris_hermetic_lots`, `ephemeris_house_cusps`, `ephemeris_lunar_return`, `ephemeris_midpoints`, `ephemeris_moon_phase`, `ephemeris_natal_batch`, `ephemeris_natal_chart`, `ephemeris_natal_transits`, `ephemeris_next_eclipse`, `ephemeris_next_lunar_phase`, `ephemeris_overlay`, `ephemeris_planet_position`, `ephemeris_planetary_return`, `ephemeris_progressed_chart`, `ephemeris_relocation`, `ephemeris_retrograde_status`, `ephemeris_solar_return`, `ephemeris_synastry`, `ephemeris_transits`, `explore_bi_wheel`, `explore_human_design`, `explore_natal_chart`, `hd_on_center_click`, `hd_on_channel_click`, `hd_on_gate_click`, `hd_opposition`, `hd_planetary_return`, `human_design_bodygraph`, `human_design_chart`, `human_design_composite`, `human_design_penta`, `vedic_chart`, `venus_eight_year_star`, `venus_elongations`, `venus_phase`, `venus_star_points`, `venus_star_points_conjunctions`, `venus_stations`
360
360
  - Generic tools:
361
361
 
362
362
  ### Allowlist Families
package/dist/index.js CHANGED
@@ -7,6 +7,8 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
7
7
  import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
8
8
  import { initTools, toolRegistry, formatToolResponse, modelVisibleTools } from "./tools/index.js";
9
9
  import { CHART_WHEEL_RESOURCE_URI, CHART_WHEEL_MIME_TYPE, getChartWheelBundle, } from "./tools/apps/chart-wheel-app.js";
10
+ import { BODYGRAPH_RESOURCE_URI, BODYGRAPH_MIME_TYPE, getBodygraphBundle, } from "./tools/apps/bodygraph-app.js";
11
+ import { BI_WHEEL_RESOURCE_URI, BI_WHEEL_MIME_TYPE, getBiWheelBundle, } from "./tools/apps/bi-wheel-app.js";
10
12
  function resolveServerVersion() {
11
13
  try {
12
14
  const here = path.dirname(fileURLToPath(import.meta.url));
@@ -96,38 +98,55 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
96
98
  });
97
99
  // List available resources
98
100
  server.setRequestHandler(ListResourcesRequestSchema, async () => {
99
- const bundle = getChartWheelBundle();
100
- if (!bundle)
101
- return { resources: [] };
102
- return {
103
- resources: [
104
- {
105
- uri: CHART_WHEEL_RESOURCE_URI,
106
- name: "Chart Wheel Explorer",
107
- description: "Interactive natal chart wheel with clickable planets, houses, and aspects.",
108
- mimeType: CHART_WHEEL_MIME_TYPE,
109
- },
110
- ],
111
- };
101
+ const resources = [];
102
+ if (getChartWheelBundle()) {
103
+ resources.push({
104
+ uri: CHART_WHEEL_RESOURCE_URI,
105
+ name: "Chart Wheel Explorer",
106
+ description: "Interactive natal chart wheel with clickable planets, houses, and aspects.",
107
+ mimeType: CHART_WHEEL_MIME_TYPE,
108
+ });
109
+ }
110
+ if (getBodygraphBundle()) {
111
+ resources.push({
112
+ uri: BODYGRAPH_RESOURCE_URI,
113
+ name: "Human Design Bodygraph Explorer",
114
+ description: "Interactive Human Design Bodygraph with clickable centers, gates, and channels.",
115
+ mimeType: BODYGRAPH_MIME_TYPE,
116
+ });
117
+ }
118
+ if (getBiWheelBundle()) {
119
+ resources.push({
120
+ uri: BI_WHEEL_RESOURCE_URI,
121
+ name: "Bi-Wheel Explorer",
122
+ description: "Interactive synastry or transit bi-wheel with cross-aspect lines and clickable planets.",
123
+ mimeType: BI_WHEEL_MIME_TYPE,
124
+ });
125
+ }
126
+ return { resources };
112
127
  });
113
128
  // Read resource
114
129
  server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
115
- if (request.params.uri !== CHART_WHEEL_RESOURCE_URI) {
116
- throw new Error(`Unknown resource: ${request.params.uri}`);
130
+ const uri = request.params.uri;
131
+ if (uri === CHART_WHEEL_RESOURCE_URI) {
132
+ const bundle = getChartWheelBundle();
133
+ if (!bundle)
134
+ throw new Error("Chart Wheel UI bundle not found. Run `npm run build:ui` to build it.");
135
+ return { contents: [{ uri: CHART_WHEEL_RESOURCE_URI, mimeType: CHART_WHEEL_MIME_TYPE, text: bundle }] };
117
136
  }
118
- const bundle = getChartWheelBundle();
119
- if (!bundle) {
120
- throw new Error("Chart Wheel UI bundle not found. Run `npm run build:ui` to build it.");
137
+ if (uri === BODYGRAPH_RESOURCE_URI) {
138
+ const bundle = getBodygraphBundle();
139
+ if (!bundle)
140
+ throw new Error("Bodygraph UI bundle not found. Run `npm run build:ui` to build it.");
141
+ return { contents: [{ uri: BODYGRAPH_RESOURCE_URI, mimeType: BODYGRAPH_MIME_TYPE, text: bundle }] };
121
142
  }
122
- return {
123
- contents: [
124
- {
125
- uri: CHART_WHEEL_RESOURCE_URI,
126
- mimeType: CHART_WHEEL_MIME_TYPE,
127
- text: bundle,
128
- },
129
- ],
130
- };
143
+ if (uri === BI_WHEEL_RESOURCE_URI) {
144
+ const bundle = getBiWheelBundle();
145
+ if (!bundle)
146
+ throw new Error("Bi-Wheel UI bundle not found. Run `npm run build:ui` to build it.");
147
+ return { contents: [{ uri: BI_WHEEL_RESOURCE_URI, mimeType: BI_WHEEL_MIME_TYPE, text: bundle }] };
148
+ }
149
+ throw new Error(`Unknown resource: ${uri}`);
131
150
  });
132
151
  // Handle tool calls
133
152
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
@@ -25,6 +25,8 @@ import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema
25
25
  import { initTools, toolRegistry, formatToolResponse, modelVisibleTools } from "./tools/index.js";
26
26
  import { BackendClient, runWithClient } from "./backend/client.js";
27
27
  import { CHART_WHEEL_RESOURCE_URI, CHART_WHEEL_MIME_TYPE, getChartWheelBundle, } from "./tools/apps/chart-wheel-app.js";
28
+ import { BODYGRAPH_RESOURCE_URI, BODYGRAPH_MIME_TYPE, getBodygraphBundle, } from "./tools/apps/bodygraph-app.js";
29
+ import { BI_WHEEL_RESOURCE_URI, BI_WHEEL_MIME_TYPE, getBiWheelBundle, } from "./tools/apps/bi-wheel-app.js";
28
30
  // ---------------------------------------------------------------------------
29
31
  // Helpers
30
32
  // ---------------------------------------------------------------------------
@@ -243,37 +245,54 @@ function createMcpServer() {
243
245
  });
244
246
  // --- Resource handlers ---
245
247
  server.setRequestHandler(ListResourcesRequestSchema, async () => {
246
- const bundle = getChartWheelBundle();
247
- if (!bundle)
248
- return { resources: [] };
249
- return {
250
- resources: [
251
- {
252
- uri: CHART_WHEEL_RESOURCE_URI,
253
- name: "Chart Wheel Explorer",
254
- description: "Interactive natal chart wheel with clickable planets, houses, and aspects.",
255
- mimeType: CHART_WHEEL_MIME_TYPE,
256
- },
257
- ],
258
- };
248
+ const resources = [];
249
+ if (getChartWheelBundle()) {
250
+ resources.push({
251
+ uri: CHART_WHEEL_RESOURCE_URI,
252
+ name: "Chart Wheel Explorer",
253
+ description: "Interactive natal chart wheel with clickable planets, houses, and aspects.",
254
+ mimeType: CHART_WHEEL_MIME_TYPE,
255
+ });
256
+ }
257
+ if (getBodygraphBundle()) {
258
+ resources.push({
259
+ uri: BODYGRAPH_RESOURCE_URI,
260
+ name: "Human Design Bodygraph Explorer",
261
+ description: "Interactive Human Design Bodygraph with clickable centers, gates, and channels.",
262
+ mimeType: BODYGRAPH_MIME_TYPE,
263
+ });
264
+ }
265
+ if (getBiWheelBundle()) {
266
+ resources.push({
267
+ uri: BI_WHEEL_RESOURCE_URI,
268
+ name: "Bi-Wheel Explorer",
269
+ description: "Interactive synastry or transit bi-wheel with cross-aspect lines and clickable planets.",
270
+ mimeType: BI_WHEEL_MIME_TYPE,
271
+ });
272
+ }
273
+ return { resources };
259
274
  });
260
275
  server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
261
- if (request.params.uri !== CHART_WHEEL_RESOURCE_URI) {
262
- throw new Error(`Unknown resource: ${request.params.uri}`);
276
+ const uri = request.params.uri;
277
+ if (uri === CHART_WHEEL_RESOURCE_URI) {
278
+ const bundle = getChartWheelBundle();
279
+ if (!bundle)
280
+ throw new Error("Chart Wheel UI bundle not found. Run `npm run build:ui` to build it.");
281
+ return { contents: [{ uri: CHART_WHEEL_RESOURCE_URI, mimeType: CHART_WHEEL_MIME_TYPE, text: bundle }] };
263
282
  }
264
- const bundle = getChartWheelBundle();
265
- if (!bundle) {
266
- throw new Error("Chart Wheel UI bundle not found. Run `npm run build:ui` to build it.");
283
+ if (uri === BODYGRAPH_RESOURCE_URI) {
284
+ const bundle = getBodygraphBundle();
285
+ if (!bundle)
286
+ throw new Error("Bodygraph UI bundle not found. Run `npm run build:ui` to build it.");
287
+ return { contents: [{ uri: BODYGRAPH_RESOURCE_URI, mimeType: BODYGRAPH_MIME_TYPE, text: bundle }] };
267
288
  }
268
- return {
269
- contents: [
270
- {
271
- uri: CHART_WHEEL_RESOURCE_URI,
272
- mimeType: CHART_WHEEL_MIME_TYPE,
273
- text: bundle,
274
- },
275
- ],
276
- };
289
+ if (uri === BI_WHEEL_RESOURCE_URI) {
290
+ const bundle = getBiWheelBundle();
291
+ if (!bundle)
292
+ throw new Error("Bi-Wheel UI bundle not found. Run `npm run build:ui` to build it.");
293
+ return { contents: [{ uri: BI_WHEEL_RESOURCE_URI, mimeType: BI_WHEEL_MIME_TYPE, text: bundle }] };
294
+ }
295
+ throw new Error(`Unknown resource: ${uri}`);
277
296
  });
278
297
  return server;
279
298
  }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * bi-wheel-app.ts — MCP App tool registration for the Bi-Wheel Explorer.
3
+ *
4
+ * Registers 3 tools:
5
+ * • explore_bi_wheel — primary entry point: fetches two charts, computes
6
+ * cross-aspects, returns data + UI resource [model]
7
+ * • bi_wheel_on_cross_aspect_click — cross-aspect click handler [app-only]
8
+ * • bi_wheel_on_planet_click — planet click handler (inner or outer wheel) [app-only]
9
+ *
10
+ * Modes:
11
+ * synastry — fetch two natal charts in parallel (person1 inner, person2 outer)
12
+ * transit — fetch one natal chart (inner) + one transit chart (outer)
13
+ *
14
+ * Cross-aspects are computed client-side (UI) AND server-side (for summary/fallback).
15
+ * The payload cross_aspects array is capped at 30 tightest-orb aspects.
16
+ */
17
+ export declare const BI_WHEEL_RESOURCE_URI = "ui://openephemeris/bi-wheel";
18
+ export declare const BI_WHEEL_MIME_TYPE = "text/html;profile=mcp-app";
19
+ /** Read the pre-built HTML bundle. Returns null if not yet built. */
20
+ export declare function getBiWheelBundle(): string | null;
21
+ export declare function clearBiWheelBundleCache(): void;
22
+ interface PlanetPoint {
23
+ name: string;
24
+ longitude: number;
25
+ speed?: number;
26
+ }
27
+ interface CrossAspect {
28
+ planet1: string;
29
+ wheel1: "inner" | "outer";
30
+ planet2: string;
31
+ wheel2: "inner" | "outer";
32
+ type: string;
33
+ angle: number;
34
+ orb: number;
35
+ applying: boolean;
36
+ }
37
+ export declare function computeCrossAspects(planets1: PlanetPoint[], planets2: PlanetPoint[]): CrossAspect[];
38
+ export {};