@codeconductorai/harmony-mcp 1.0.28 → 1.0.29

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/README.md CHANGED
@@ -27,12 +27,12 @@ Re-run `node -v` afterwards to confirm before continuing.
27
27
 
28
28
  ## Installation
29
29
 
30
- The server is published as `@codeconductorai/harmony-mcp` and run via `npx`, so no local build step is required. The commands below pin an exact version (`@1.0.28`) rather than a floating tag — this lets `npx` reuse its local cache instead of re-resolving the package from the registry on every agent startup, which otherwise makes MCP initialization noticeably slower (and occasionally hang). Bump the pinned version deliberately when you want to upgrade.
30
+ The server is published as `@codeconductorai/harmony-mcp` and run via `npx`, so no local build step is required. The commands below pin an exact version (`@1.0.29`) rather than a floating tag — this lets `npx` reuse its local cache instead of re-resolving the package from the registry on every agent startup, which otherwise makes MCP initialization noticeably slower (and occasionally hang). Bump the pinned version deliberately when you want to upgrade.
31
31
 
32
32
  ### Claude Code
33
33
 
34
34
  ```bash
35
- claude mcp add harmony -- npx -y @codeconductorai/harmony-mcp@1.0.28
35
+ claude mcp add harmony -- npx -y @codeconductorai/harmony-mcp@1.0.29
36
36
  ```
37
37
 
38
38
  ### Antigravity
@@ -47,7 +47,7 @@ Open **MCP Servers → Manage MCP Servers → View raw config** from the agent p
47
47
  "mcpServers": {
48
48
  "harmony": {
49
49
  "command": "npx",
50
- "args": ["-y", "@codeconductorai/harmony-mcp@1.0.28"]
50
+ "args": ["-y", "@codeconductorai/harmony-mcp@1.0.29"]
51
51
  }
52
52
  }
53
53
  }
@@ -58,7 +58,7 @@ Restart Antigravity (or reload MCP servers) after saving.
58
58
  ### Codex CLI
59
59
 
60
60
  ```bash
61
- codex mcp add harmony -- npx -y @codeconductorai/harmony-mcp@1.0.28
61
+ codex mcp add harmony -- npx -y @codeconductorai/harmony-mcp@1.0.29
62
62
  ```
63
63
 
64
64
  This writes the entry to `~/.codex/config.toml`. To add it by hand instead:
@@ -66,7 +66,7 @@ This writes the entry to `~/.codex/config.toml`. To add it by hand instead:
66
66
  ```toml
67
67
  [mcp_servers.harmony]
68
68
  command = "npx"
69
- args = ["-y", "@codeconductorai/harmony-mcp@1.0.28"]
69
+ args = ["-y", "@codeconductorai/harmony-mcp@1.0.29"]
70
70
  ```
71
71
 
72
72
  ### Aria
@@ -78,7 +78,7 @@ In the Aria Code panel, click the settings icon → **MCP Servers**, then scroll
78
78
  "mcpServers": {
79
79
  "harmony": {
80
80
  "command": "npx",
81
- "args": ["-y", "@codeconductorai/harmony-mcp@1.0.28"]
81
+ "args": ["-y", "@codeconductorai/harmony-mcp@1.0.29"]
82
82
  }
83
83
  }
84
84
  }
@@ -95,7 +95,7 @@ Any client that reads a `command`/`args` style config (e.g. Claude Desktop's `cl
95
95
  "mcpServers": {
96
96
  "harmony": {
97
97
  "command": "npx",
98
- "args": ["-y", "@codeconductorai/harmony-mcp@1.0.28"]
98
+ "args": ["-y", "@codeconductorai/harmony-mcp@1.0.29"]
99
99
  }
100
100
  }
101
101
  }
@@ -159,7 +159,9 @@ Given a natural-language query or exact identifier, returns lightweight symbol c
159
159
 
160
160
  ## Observability (OpenObserve)
161
161
 
162
- The server ships its own logs, traces, and metrics over OTLP/HTTP using OpenTelemetry, and forwards the active trace id to every request it makes to the harmony backend (as a W3C `traceparent` header plus a plain `X-Trace-Id` header) so backend-side logs can be correlated with the MCP session that triggered them.
162
+ **Telemetry export is disabled by default.** Set `HARMONY_TELEMETRY_ENABLED=true` in the server's environment to turn it on; otherwise no logs, traces, or metrics are sent and no trace headers are added to backend requests. Local file logging is unaffected.
163
+
164
+ When enabled, the server ships its own logs, traces, and metrics over OTLP/HTTP using OpenTelemetry, and forwards the active trace id to every request it makes to the harmony backend (as a W3C `traceparent` header plus a plain `X-Trace-Id` header) so backend-side logs can be correlated with the MCP session that triggered them.
163
165
 
164
166
  Telemetry is exported to the harmony backend's `/api/v1/otel/{traces,metrics,logs}` endpoints rather than straight to [OpenObserve](https://openobserve.codeconductor.ai/) — the backend forwards it on to OpenObserve using a server-side-only ingestion credential. This package holds no OpenObserve credential of its own: it authenticates to the backend with whichever Bearer session or workspace token it already uses for every other API call, so nothing extra needs to be configured, and a plain `npx` install never needs (or can leak) an ingestion secret. If neither token is available yet (e.g. before `login`/`setup_workspace`), export calls simply fail unauthenticated against the backend and are logged, without affecting normal server operation.
165
167
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeconductorai/harmony-mcp",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -293,6 +293,10 @@ export async function callHarmonySearchEndpoint(endpointPath, args, workspaceId)
293
293
  prompt,
294
294
  file_path: args.file_path,
295
295
  limit: args.limit,
296
+ // context_search returns code by default so the agent need not re-read the files; locate stays coordinates-only
297
+ include_code_snippets: args.include_code_snippets ?? (endpointPath === "context-search" ? true : undefined),
298
+ // context_search answers in the compact LLM format (llm-context-format-guide.md); locate keeps its own format
299
+ response_format: endpointPath === "context-search" ? "compact" : undefined,
296
300
  workspaceMetadata: buildWorkspaceMetadata(workspaceId),
297
301
  };
298
302
 
package/src/telemetry.js CHANGED
@@ -61,13 +61,21 @@ const sdk = new NodeSDK({
61
61
  logRecordProcessors: [new BatchLogRecordProcessor({ exporter: logExporter })],
62
62
  });
63
63
 
64
+ // Export to OpenObserve is opt-in. Without a started SDK the @opentelemetry/api calls below are
65
+ // no-ops, so no logs, metrics, or traces leave the process.
66
+ const TELEMETRY_ENABLED = process.env.HARMONY_TELEMETRY_ENABLED === "true";
67
+
64
68
  let started = false;
65
- try {
66
- sdk.start();
67
- started = true;
68
- log(`[telemetry] OpenTelemetry started — exporting via backend proxy at ${OTLP_BASE}`);
69
- } catch (err) {
70
- log(`[telemetry] Failed to start OpenTelemetry SDK: ${err?.message || err}`);
69
+ if (TELEMETRY_ENABLED) {
70
+ try {
71
+ sdk.start();
72
+ started = true;
73
+ log(`[telemetry] OpenTelemetry started — exporting via backend proxy at ${OTLP_BASE}`);
74
+ } catch (err) {
75
+ log(`[telemetry] Failed to start OpenTelemetry SDK: ${err?.message || err}`);
76
+ }
77
+ } else {
78
+ log("[telemetry] OpenTelemetry export disabled (set HARMONY_TELEMETRY_ENABLED=true to enable)");
71
79
  }
72
80
 
73
81
  export async function shutdownTelemetry() {
@@ -123,12 +131,12 @@ export async function tracedFetch(url, options = {}) {
123
131
  const traceId = getActiveTraceId();
124
132
  span.setAttribute("http.request.method", method);
125
133
  span.setAttribute("url.full", url);
126
- log(`[telemetry] trace id ${traceId} for ${method} ${path}`);
134
+ if (traceId) log(`[telemetry] trace id ${traceId} for ${method} ${path}`);
127
135
  const startedAt = Date.now();
128
136
  try {
129
137
  const response = await fetch(url, { ...options, headers: injectTraceHeaders(options.headers || {}) });
130
138
  span.setAttribute("http.response.status_code", response.status);
131
- log(`[telemetry] trace id ${traceId} for ${method} ${path} -> ${response.status}` +
139
+ if (traceId) log(`[telemetry] trace id ${traceId} for ${method} ${path} -> ${response.status}` +
132
140
  (response.ok ? "" : " (backend X-Trace-Id: " + (response.headers.get("x-trace-id") || "none") + ")"));
133
141
  if (!response.ok) {
134
142
  span.setStatus({ code: SpanStatusCode.ERROR, message: `HTTP ${response.status}` });
@@ -139,7 +147,7 @@ export async function tracedFetch(url, options = {}) {
139
147
  span.recordException(error);
140
148
  span.setStatus({ code: SpanStatusCode.ERROR, message: error?.message });
141
149
  backendRequestErrors.add(1, { "url.path": path });
142
- log(`[telemetry] trace id ${traceId} for ${method} ${path} -> request error: ${error?.message}`);
150
+ if (traceId) log(`[telemetry] trace id ${traceId} for ${method} ${path} -> request error: ${error?.message}`);
143
151
  throw error;
144
152
  } finally {
145
153
  backendRequestDuration.record(Date.now() - startedAt, { "url.path": path });
@@ -70,12 +70,16 @@ export const TOOLS = [
70
70
  },
71
71
  {
72
72
  name: "context_search",
73
+ _meta: { "anthropic/alwaysLoad": true },
73
74
  description:
74
75
  "PREFERRED FIRST CHOICE for any code discovery/comprehension need — Harmony's newest and best-ranked " +
75
76
  "search endpoint. Given a natural language query or exact identifier, returns ranked matching symbols " +
76
- "as structural facts and precise file:line locations — file path, symbol kind/decorators/name, and an " +
77
- "exact line range per symbol — deliberately WITHOUT embedded source code, the same way graphify's " +
78
- "query/explain primitives work. Try this BEFORE locate; only fall back to locate if context_search's " +
77
+ "in a compact format: one root with relative paths; verbatim code (exact=\"true\", safe to use for an " +
78
+ "Edit) for the top hits, limited to the members that match the question; the remaining hits as one line " +
79
+ "each with member signatures and line ranges; other members named so you can tell what was left out; " +
80
+ "flow questions answered as a one-line-per-step trace. Code marked exact=\"false\" has collapsed or cut " +
81
+ "lines, named in the block. The answer usually needs no follow-up file reads — read a file only for " +
82
+ "lines it names as not shown, or before editing. Try this BEFORE locate; only fall back to locate if context_search's " +
79
83
  "result is empty, insufficient, or you specifically need its line-number-only anchors for a targeted " +
80
84
  "edit. Treat context_search as the always-on default " +
81
85
  "entry point for every new discovery/comprehension need that comes up during a task — call it again " +
@@ -100,6 +104,12 @@ export const TOOLS = [
100
104
  type: "number",
101
105
  description: "Optional maximum number of results to return; the backend applies its own default if omitted.",
102
106
  },
107
+ include_code_snippets: {
108
+ type: "boolean",
109
+ description:
110
+ "Optional, default true. Each returned symbol (and each step of a traced flow) includes its source " +
111
+ "excerpt (method or class body, capped at 50 lines). Set false to get file paths and line numbers only.",
112
+ },
103
113
  workspaceId: WORKSPACE_ID_PROPERTY,
104
114
  },
105
115
  required: ["prompt"],