-
Notifications
You must be signed in to change notification settings - Fork 0
Add initial HyperDX MCP implementation #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🚀 Preview Deployments Ready!Deployed from commit: |
95c6e13 to
5b8c070
Compare
There was a problem hiding this 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 `{"type": "HTTP", "url": "..."}` or `{"type": "BINDING"}`. 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'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 @@ | |||
| { | |||
There was a problem hiding this comment.
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 `{"type": "HTTP", "url": "..."}` or `{"type": "BINDING"}`. Without this field, the MCP may not be able to establish a connection.</comment>
<file context>
@@ -0,0 +1,9 @@
+ "friendlyName": "HyperDX",
+ "description": "Query observability data from HyperDX. Search logs, metrics, and traces with time series charts and pattern analysis.",
+ "icon": "https://hyperdx.io/Icon-192.png",
+ "unlisted": true
+}
+
</file context>
| @@ -0,0 +1,238 @@ | |||
| /** | |||
There was a problem hiding this comment.
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't use console.log for logging.</comment>
<file context>
@@ -0,0 +1,238 @@
+ total: z.number(),
+ }),
+ execute: async ({ context }) => {
+ console.log("[SEARCH_LOGS] Query:", context.query);
+
+ const apiKey = getHyperDXApiKey(env);
</file context>
| ): Promise<any> { | ||
| const url = `${HYPERDX_API}/charts/series`; | ||
|
|
||
| const response = await fetch(url, { |
There was a problem hiding this comment.
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<any> {
+ const url = `${HYPERDX_API}/charts/series`;
+
+ const response = await fetch(url, {
+ method: "POST",
+ headers: {
</file context>
| ? authorization.slice(7) | ||
| : authorization; | ||
|
|
||
| console.log("[HyperDX] API key length:", apiKey.length); |
There was a problem hiding this comment.
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("[HyperDX] API key length:", apiKey.length);
+ return apiKey;
+};
</file context>
| "devDependencies": { | ||
| "@cloudflare/workers-types": "^4.20251014.0", | ||
| "@modelcontextprotocol/sdk": "1.20.2", | ||
| "@types/node": "^25.0.3", |
There was a problem hiding this comment.
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 @@
+ "devDependencies": {
+ "@cloudflare/workers-types": "^4.20251014.0",
+ "@modelcontextprotocol/sdk": "1.20.2",
+ "@types/node": "^25.0.3",
+ "bun-types": "^1.3.5",
+ "deco-cli": "^0.28.0",
</file context>
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
Migration
Written for commit 545ae98. Summary will update on new commits.