@openephemeris/mcp-server 3.2.11 → 3.2.12

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,104 @@
1
+ import { toolRegistry, initTools } from "../src/tools/index.js";
2
+ import { backendClient } from "../src/backend/client.js";
3
+ const API_KEY = process.env.OPENEPHEMERIS_API_KEY || "";
4
+ const API_URL = process.env.OPENEPHEMERIS_API_URL || "https://api.openephemeris.com";
5
+ // Hardcoded valid inputs matching the MCP Tool Zod Schemas (not the REST API JSON structures)
6
+ const toolFixtures = {
7
+ dev_call: { method: "GET", path: "/health", query: {} },
8
+ dev_list_allowed: {},
9
+ ephemeris_natal_chart: {
10
+ datetime: "1990-04-15T14:30:00Z",
11
+ latitude: 41.87,
12
+ longitude: -87.62,
13
+ house_system: "placidus"
14
+ },
15
+ ephemeris_transits: {
16
+ natal_datetime: "1990-04-15T14:30:00Z",
17
+ natal_latitude: 41.87,
18
+ natal_longitude: -87.62,
19
+ start_date: "2026-03-20",
20
+ end_date: "2026-03-27",
21
+ transiting_planets: ["saturn"]
22
+ },
23
+ ephemeris_moon_phase: { datetime: "2026-03-20T12:00:00Z" },
24
+ ephemeris_next_eclipse: { date: "2026-03-20", eclipse_type: "solar", latitude: 41.87, longitude: -87.62 },
25
+ ephemeris_synastry: {
26
+ person_a_datetime: "1990-04-15T14:30:00Z",
27
+ person_a_latitude: 41.87,
28
+ person_a_longitude: -87.62,
29
+ person_b_datetime: "1992-08-20T10:00:00Z",
30
+ person_b_latitude: 34.05,
31
+ person_b_longitude: -118.24
32
+ },
33
+ ephemeris_relocation: {
34
+ natal_datetime: "1990-04-15T14:30:00Z",
35
+ natal_latitude: 41.87,
36
+ natal_longitude: -87.62,
37
+ relocation_latitude: 51.5,
38
+ relocation_longitude: -0.12
39
+ },
40
+ ephemeris_electional: {
41
+ start_date: "2026-03-20T00:00:00Z",
42
+ end_date: "2026-03-30T00:00:00Z",
43
+ latitude: 41.87,
44
+ longitude: -87.62,
45
+ aspects: ["sun trine moon"]
46
+ },
47
+ human_design_chart: {
48
+ datetime: "1990-04-15T14:30:00Z",
49
+ latitude: 41.87,
50
+ longitude: -87.62
51
+ }
52
+ };
53
+ async function main() {
54
+ if (!API_KEY) {
55
+ console.error("Please set OPENEPHEMERIS_API_KEY");
56
+ process.exit(1);
57
+ }
58
+ console.log(`Starting recursive test loop against: ${API_URL}`);
59
+ await initTools("dev");
60
+ // Use the default singleton imported from `backendClient`
61
+ backendClient.setApiKey(API_KEY);
62
+ const passed = [];
63
+ const failed = [];
64
+ for (const [name, tool] of Object.entries(toolRegistry)) {
65
+ if (name.startsWith("auth_"))
66
+ continue;
67
+ console.log(`\nTesting tool: ${name}`);
68
+ const args = toolFixtures[name];
69
+ if (!args) {
70
+ console.log(` ⏭️ Skipped (no fixture data)`);
71
+ continue;
72
+ }
73
+ try {
74
+ // Just run the tool handler directly
75
+ const parsedArgs = args;
76
+ // Set up the singleton backendClient API key so the imported modules use it
77
+ backendClient.setApiKey(API_KEY);
78
+ const result = await tool.handler(parsedArgs);
79
+ if (result.isError) {
80
+ throw new Error(`Tool responded with isError=true.\n Output: ${JSON.stringify(result.content)}`);
81
+ }
82
+ const snippet = result.content?.[0]?.text?.substring(0, 80).replace(/\n/g, "") || "No content";
83
+ console.log(` ✅ Passed (${snippet}...)`);
84
+ passed.push(name);
85
+ }
86
+ catch (e) {
87
+ let errorMsg = e.message;
88
+ if (e.errors) {
89
+ // Zod validation error on testing inputs
90
+ errorMsg = "Schema Validation Failed: " + JSON.stringify(e.errors.map((err) => `${err.path.join('.')}: ${err.message}`));
91
+ }
92
+ console.log(` ❌ Failed: ${errorMsg}`);
93
+ failed.push({ name, error: errorMsg });
94
+ }
95
+ }
96
+ console.log(`\n${"-".repeat(50)}`);
97
+ console.log(`Results: ${passed.length} passed, ${failed.length} failed`);
98
+ if (failed.length > 0) {
99
+ console.log("Failed tools:");
100
+ failed.forEach(f => console.log(` - ${f.name}: ${f.error}`));
101
+ process.exit(1);
102
+ }
103
+ }
104
+ main().catch(console.log);
@@ -63,7 +63,7 @@ registerTool({
63
63
  },
64
64
  },
65
65
  };
66
- const natalResult = await backendClient.post("/ephemeris/natal", natalBody);
66
+ const natalResult = await backendClient.post("/ephemeris/natal-chart", natalBody);
67
67
  // Extract ecliptic longitudes from natal chart planets
68
68
  const targetDegrees = [];
69
69
  const natalPositionMap = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openephemeris/mcp-server",
3
- "version": "3.2.11",
3
+ "version": "3.2.12",
4
4
  "description": "Model Context Protocol server for the Open Ephemeris astronomical computation API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",