@energyatit/mcp-server 0.3.0 → 0.3.1
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/dist/index.js +10 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
const VERSION = "0.3.
|
|
5
|
+
const VERSION = "0.3.1";
|
|
6
6
|
// ─── Config ────────────────────────────────────────────────────────────────
|
|
7
7
|
const BASE_URL = (process.env.ENERGYATIT_BASE_URL ??
|
|
8
8
|
process.env.ENERGYATIT_URL ??
|
|
@@ -36,6 +36,8 @@ const DEMO_PATH_MAP = {
|
|
|
36
36
|
"/api/v1/dr/events": "/api/v1/demo/dr/events",
|
|
37
37
|
"/api/v1/integrations/status": "/api/v1/demo/integrations/status",
|
|
38
38
|
"/api/v1/carbon": "/api/v1/demo/carbon",
|
|
39
|
+
"/api/v1/carbon/verify": "/api/v1/demo/carbon/verify",
|
|
40
|
+
"/api/v1/carbon/certificate": "/api/v1/demo/carbon/certificate",
|
|
39
41
|
};
|
|
40
42
|
// These paths are already public on the server — no rewrite needed, no auth needed.
|
|
41
43
|
const PUBLIC_PATHS = [
|
|
@@ -506,7 +508,13 @@ server.tool("create_procurement", "Create an energy procurement request", {
|
|
|
506
508
|
region: z.string().optional().describe("Region"),
|
|
507
509
|
}, async (params) => {
|
|
508
510
|
try {
|
|
509
|
-
|
|
511
|
+
// Map MCP params to server API format
|
|
512
|
+
const body = {
|
|
513
|
+
region: params.region ?? "UAE",
|
|
514
|
+
requiredMw: Math.round(params.volume_kwh / 1000) / 1000, // kWh → MW
|
|
515
|
+
workloadType: params.type === "ppa" ? "ai_training" : params.type === "rec" ? "general_compute" : "inference",
|
|
516
|
+
};
|
|
517
|
+
return text(await apiPost("/api/v1/procurement", body));
|
|
510
518
|
}
|
|
511
519
|
catch (e) {
|
|
512
520
|
return errorResult(e);
|