@openephemeris/mcp-server 3.2.10 → 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);
|
package/dist/src/tools/dev.js
CHANGED
|
@@ -54,7 +54,7 @@ registerTool({
|
|
|
54
54
|
" POST /predictive/returns/lunar — Lunar return chart\n" +
|
|
55
55
|
" POST /comparative/synastry — Two-person synastry chart\n" +
|
|
56
56
|
" POST /comparative/composite — Composite (midpoint) chart\n" +
|
|
57
|
-
" POST /human-design/chart — Full HD
|
|
57
|
+
" POST /human-design/chart — Full HD chart (body: {birth_datetime_utc: '1990-04-15T19:30:00Z'}) — lat/lon optional\n" +
|
|
58
58
|
" POST /time/julian-day — Convert date to JD (body: {year: 1987, month: 7, day: 15, hour: 14, minute: 1})\n" +
|
|
59
59
|
" GET /ephemeris/moon/phase — Current/queried moon phase\n" +
|
|
60
60
|
" GET /ephemeris/moon/void-of-course — Next void-of-course period\n" +
|
|
@@ -14,7 +14,7 @@ function ensureTimezone(dt) {
|
|
|
14
14
|
}
|
|
15
15
|
registerTool({
|
|
16
16
|
name: "human_design_chart",
|
|
17
|
-
description: "Calculate a full Human Design
|
|
17
|
+
description: "Calculate a full Human Design I Ching hexagram chart from birth data. Returns the person's Type " +
|
|
18
18
|
"(Generator, Manifesting Generator, Projector, Manifestor, Reflector), Strategy, Authority, " +
|
|
19
19
|
"Profile (e.g. 1/3, 2/4), defined and undefined Centers, activated Gates and Channels, " +
|
|
20
20
|
"Incarnation Cross, and both Personality (conscious) and Design (unconscious) planetary positions.\n\n" +
|
|
@@ -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 = {};
|