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.
Files changed (2) hide show
  1. package/dist/index.js +11 -2
  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
- const queryBaseUrl = `http://${CUBEAPM_HOST}:${CUBEAPM_QUERY_PORT}`;
10
- const ingestBaseUrl = `http://${CUBEAPM_HOST}:${CUBEAPM_INGEST_PORT}`;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cubeapm-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "MCP server for CubeAPM - Query traces, metrics, and logs from your observability platform using AI assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",