@context-engine-bridge/context-engine-mcp-bridge 0.0.43 → 0.0.45

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/package.json +1 -1
  2. package/src/mcpServer.js +20 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@context-engine-bridge/context-engine-mcp-bridge",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "Context Engine MCP bridge (http/stdio proxy combining indexer + memory servers)",
5
5
  "bin": {
6
6
  "ctxce": "bin/ctxce.js",
package/src/mcpServer.js CHANGED
@@ -187,7 +187,8 @@ async function _enrichWithLsp(result, lspConn, workspace) {
187
187
  }
188
188
  const target = _lspTarget(parsed);
189
189
  if (!parsed.ok && !target.ok) return result;
190
- parsed._lsp_status = await _resolveLspStatus(parsed, target, lspConn, workspace);
190
+ const dest = target !== parsed ? target : parsed;
191
+ dest._lsp_status = await _resolveLspStatus(dest, target, lspConn, workspace);
191
192
  textBlock.text = JSON.stringify(parsed);
192
193
  return result;
193
194
  } catch (err) {
@@ -1076,14 +1077,22 @@ async function createBridgeServer(options) {
1076
1077
  tool.inputSchema = { ...tool.inputSchema, properties: { ...tool.inputSchema.properties, include_lsp: lspProp } };
1077
1078
  }
1078
1079
  if (tool.outputSchema) {
1079
- tool.outputSchema = {
1080
- ...tool.outputSchema,
1081
- properties: {
1082
- ...(tool.outputSchema.properties || {}),
1083
- _lsp_status: { type: "string" },
1084
- _lsp: { type: "object" },
1085
- },
1086
- };
1080
+ const lspFields = { _lsp_status: { type: "string" }, _lsp: { type: "object" } };
1081
+ const resultProp = tool.outputSchema.properties?.result;
1082
+ if (resultProp && resultProp.properties) {
1083
+ tool.outputSchema = {
1084
+ ...tool.outputSchema,
1085
+ properties: {
1086
+ ...tool.outputSchema.properties,
1087
+ result: { ...resultProp, properties: { ...resultProp.properties, ...lspFields } },
1088
+ },
1089
+ };
1090
+ } else {
1091
+ tool.outputSchema = {
1092
+ ...tool.outputSchema,
1093
+ properties: { ...(tool.outputSchema.properties || {}), ...lspFields },
1094
+ };
1095
+ }
1087
1096
  }
1088
1097
  }
1089
1098
 
@@ -1312,7 +1321,8 @@ async function createBridgeServer(options) {
1312
1321
  const tb = Array.isArray(result?.content) && result.content.find(c => c.type === "text");
1313
1322
  if (tb?.text) {
1314
1323
  const p = JSON.parse(tb.text);
1315
- p._lsp_status = "not_available";
1324
+ const d = _lspTarget(p);
1325
+ (d !== p ? d : p)._lsp_status = "not_available";
1316
1326
  tb.text = JSON.stringify(p);
1317
1327
  }
1318
1328
  } catch (e) { debugLog("[ctxce] LSP not_available inject failed: " + String(e)); }