cubeapm-mcp 1.0.0 → 1.0.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 +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,11 +3,20 @@ 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
5
|
// Configuration from environment variables
|
|
6
|
+
// CUBEAPM_URL takes precedence - use full URL like https://prod-cube.example.com
|
|
7
|
+
// Falls back to building URL from CUBEAPM_HOST + ports for backward compatibility
|
|
8
|
+
const CUBEAPM_URL = process.env.CUBEAPM_URL;
|
|
6
9
|
const CUBEAPM_HOST = process.env.CUBEAPM_HOST || "localhost";
|
|
7
10
|
const CUBEAPM_QUERY_PORT = process.env.CUBEAPM_QUERY_PORT || "3140";
|
|
8
11
|
const CUBEAPM_INGEST_PORT = process.env.CUBEAPM_INGEST_PORT || "3130";
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
// If CUBEAPM_URL is provided, use it directly (removes trailing slash if present)
|
|
13
|
+
// Otherwise build from host:port
|
|
14
|
+
const queryBaseUrl = CUBEAPM_URL
|
|
15
|
+
? CUBEAPM_URL.replace(/\/$/, '')
|
|
16
|
+
: `http://${CUBEAPM_HOST}:${CUBEAPM_QUERY_PORT}`;
|
|
17
|
+
const ingestBaseUrl = CUBEAPM_URL
|
|
18
|
+
? CUBEAPM_URL.replace(/\/$/, '')
|
|
19
|
+
: `http://${CUBEAPM_HOST}:${CUBEAPM_INGEST_PORT}`;
|
|
11
20
|
// Create the MCP server
|
|
12
21
|
const server = new McpServer({
|
|
13
22
|
name: "cubeapm-mcp",
|
package/package.json
CHANGED