Skip to content

Conversation

@vibegui
Copy link

@vibegui vibegui commented Dec 23, 2025

Summary by cubic

Add a new HyperDX MCP server to query observability data (logs, metrics, traces) with time-series charts and grouped insights. This adds tools for log search, log details, and chart data using a Bearer API key.

  • New Features

    • New hyperdx MCP package wired with @decocms/runtime and exposed at /mcp.
    • Tools: SEARCH_LOGS, GET_LOG_DETAILS, QUERY_CHART_DATA with strict Zod input/output schemas, backed by HyperDX charts/series API.
    • API key is read from the connection’s Bearer Token; clear errors if missing.
    • Dev/build scripts and tsconfig added; workspace entry included in root package.json.
  • Migration

    • Set the Token in the MCP connection settings to your HyperDX API key (Bearer prefix optional).

Written for commit 545ae98. Summary will update on new commits.

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

🚀 Preview Deployments Ready!

⚠️ No preview URLs were generated. Check the workflow logs for details.


Deployed from commit: 5b15226

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 13 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="hyperdx/app.json">

<violation number="1" location="hyperdx/app.json:7">
P1: Missing `connection` field. All other app.json files in this project include a `connection` configuration specifying either `{&quot;type&quot;: &quot;HTTP&quot;, &quot;url&quot;: &quot;...&quot;}` or `{&quot;type&quot;: &quot;BINDING&quot;}`. Without this field, the MCP may not be able to establish a connection.</violation>
</file>

<file name="hyperdx/server/tools/hyperdx.ts">

<violation number="1" location="hyperdx/server/tools/hyperdx.ts:58">
P2: Debug `console.log` statements should be removed before production. The rest of the HyperDX codebase (main.ts, client.ts) doesn&#39;t use console.log for logging.</violation>
</file>

<file name="hyperdx/server/lib/client.ts">

<violation number="1" location="hyperdx/server/lib/client.ts:22">
P2: Consider using the shared `makeApiRequest` utility from `@decocms/mcps-shared/tools/utils/api-client` instead of implementing custom fetch logic. This provides consistent error handling across the codebase (see `perplexity/server/lib/perplexity-client.ts` for reference).</violation>
</file>

<file name="hyperdx/server/lib/env.ts">

<violation number="1" location="hyperdx/server/lib/env.ts:18">
P2: Logging API key length (`apiKey.length`) could leak sensitive information about the token format. These debug console.log statements should be removed before production or gated behind a debug/development environment check.</violation>
</file>

<file name="hyperdx/package.json">

<violation number="1" location="hyperdx/package.json:23">
P2: Version inconsistency: `@types/node@^25.0.3` differs significantly from other packages in the monorepo which use `^22.0.0`. Consider aligning with the existing version to maintain type consistency across the project.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@@ -0,0 +1,9 @@
{
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Missing connection field. All other app.json files in this project include a connection configuration specifying either {"type": "HTTP", "url": "..."} or {"type": "BINDING"}. Without this field, the MCP may not be able to establish a connection.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At hyperdx/app.json, line 7:

<comment>Missing `connection` field. All other app.json files in this project include a `connection` configuration specifying either `{&quot;type&quot;: &quot;HTTP&quot;, &quot;url&quot;: &quot;...&quot;}` or `{&quot;type&quot;: &quot;BINDING&quot;}`. Without this field, the MCP may not be able to establish a connection.</comment>

<file context>
@@ -0,0 +1,9 @@
+  &quot;friendlyName&quot;: &quot;HyperDX&quot;,
+  &quot;description&quot;: &quot;Query observability data from HyperDX. Search logs, metrics, and traces with time series charts and pattern analysis.&quot;,
+  &quot;icon&quot;: &quot;https://hyperdx.io/Icon-192.png&quot;,
+  &quot;unlisted&quot;: true
+}
+
</file context>
Fix with Cubic

@@ -0,0 +1,238 @@
/**
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Debug console.log statements should be removed before production. The rest of the HyperDX codebase (main.ts, client.ts) doesn't use console.log for logging.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At hyperdx/server/tools/hyperdx.ts, line 58:

<comment>Debug `console.log` statements should be removed before production. The rest of the HyperDX codebase (main.ts, client.ts) doesn&#39;t use console.log for logging.</comment>

<file context>
@@ -0,0 +1,238 @@
+      total: z.number(),
+    }),
+    execute: async ({ context }) =&gt; {
+      console.log(&quot;[SEARCH_LOGS] Query:&quot;, context.query);
+
+      const apiKey = getHyperDXApiKey(env);
</file context>
Fix with Cubic

): Promise<any> {
const url = `${HYPERDX_API}/charts/series`;

const response = await fetch(url, {
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Consider using the shared makeApiRequest utility from @decocms/mcps-shared/tools/utils/api-client instead of implementing custom fetch logic. This provides consistent error handling across the codebase (see perplexity/server/lib/perplexity-client.ts for reference).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At hyperdx/server/lib/client.ts, line 22:

<comment>Consider using the shared `makeApiRequest` utility from `@decocms/mcps-shared/tools/utils/api-client` instead of implementing custom fetch logic. This provides consistent error handling across the codebase (see `perplexity/server/lib/perplexity-client.ts` for reference).</comment>

<file context>
@@ -0,0 +1,42 @@
+): Promise&lt;any&gt; {
+  const url = `${HYPERDX_API}/charts/series`;
+
+  const response = await fetch(url, {
+    method: &quot;POST&quot;,
+    headers: {
</file context>
Fix with Cubic

? authorization.slice(7)
: authorization;

console.log("[HyperDX] API key length:", apiKey.length);
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Logging API key length (apiKey.length) could leak sensitive information about the token format. These debug console.log statements should be removed before production or gated behind a debug/development environment check.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At hyperdx/server/lib/env.ts, line 18:

<comment>Logging API key length (`apiKey.length`) could leak sensitive information about the token format. These debug console.log statements should be removed before production or gated behind a debug/development environment check.</comment>

<file context>
@@ -0,0 +1,20 @@
+    ? authorization.slice(7)
+    : authorization;
+
+  console.log(&quot;[HyperDX] API key length:&quot;, apiKey.length);
+  return apiKey;
+};
</file context>
Fix with Cubic

"devDependencies": {
"@cloudflare/workers-types": "^4.20251014.0",
"@modelcontextprotocol/sdk": "1.20.2",
"@types/node": "^25.0.3",
Copy link

@cubic-dev-ai cubic-dev-ai bot Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Version inconsistency: @types/node@^25.0.3 differs significantly from other packages in the monorepo which use ^22.0.0. Consider aligning with the existing version to maintain type consistency across the project.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At hyperdx/package.json, line 23:

<comment>Version inconsistency: `@types/node@^25.0.3` differs significantly from other packages in the monorepo which use `^22.0.0`. Consider aligning with the existing version to maintain type consistency across the project.</comment>

<file context>
@@ -0,0 +1,31 @@
+  &quot;devDependencies&quot;: {
+    &quot;@cloudflare/workers-types&quot;: &quot;^4.20251014.0&quot;,
+    &quot;@modelcontextprotocol/sdk&quot;: &quot;1.20.2&quot;,
+    &quot;@types/node&quot;: &quot;^25.0.3&quot;,
+    &quot;bun-types&quot;: &quot;^1.3.5&quot;,
+    &quot;deco-cli&quot;: &quot;^0.28.0&quot;,
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants