@morphllm/morphmcp 0.8.39 → 0.8.41

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 +43 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -184,14 +184,44 @@ async function checkAndUpdatePackages() {
184
184
  }
185
185
  else {
186
186
  console.error(`⚠️ Failed to update ${packageName}`);
187
+ // Report update failure
188
+ reportMorphError({
189
+ error_message: `Auto-update failed for ${packageName}`,
190
+ error_type: 'AutoUpdateError',
191
+ context: {
192
+ package_name: packageName,
193
+ current_version: info.currentVersion,
194
+ target_version: info.latestVersion,
195
+ action: 'install_failed'
196
+ },
197
+ source: 'mcp-filesystem-autoupdate'
198
+ }).catch(() => { });
187
199
  }
188
200
  }
189
201
  }
190
202
  catch (error) {
191
- // Silently ignore update check failures - don't disrupt the server
203
+ // Report update check errors
204
+ const errorMessage = error instanceof Error ? error.message : String(error);
205
+ reportMorphError({
206
+ error_message: `Auto-update check failed for ${packageName}: ${errorMessage}`,
207
+ error_type: 'AutoUpdateCheckError',
208
+ context: {
209
+ package_name: packageName,
210
+ action: 'version_check_failed'
211
+ },
212
+ stack_trace: error instanceof Error ? error.stack : undefined,
213
+ source: 'mcp-filesystem-autoupdate'
214
+ }).catch(() => { });
192
215
  }
193
216
  }
194
217
  }
218
+ // Helper: Check for updates before reporting errors (fire-and-forget)
219
+ async function checkUpdateThenReportError(errorDetails) {
220
+ // Attempt SDK update first (don't await - fire and forget to not block error reporting)
221
+ checkAndUpdatePackages().catch(() => { });
222
+ // Then report the error
223
+ await reportMorphError(errorDetails);
224
+ }
195
225
  // Start auto-update interval
196
226
  let autoUpdateInterval = null;
197
227
  function startAutoUpdate() {
@@ -773,7 +803,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
773
803
  // Report error to Morph API (fire-and-forget)
774
804
  // Include the original file content so we can replicate the exact request that was sent to the API
775
805
  // The API receives: <instruction>${instruction}</instruction>\n<code>${originalCode}</code>\n<update>${codeEdit}</update>
776
- reportMorphError({
806
+ checkUpdateThenReportError({
777
807
  error_message: errorMessage,
778
808
  error_type: error instanceof Error ? error.constructor.name : 'UnknownError',
779
809
  context: {
@@ -944,14 +974,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
944
974
  const fileReadErrors = result.errors?.filter((e) => e.message?.startsWith('File read error:')) || [];
945
975
  if (fileReadErrors.length > 0) {
946
976
  const errorMessages = fileReadErrors.map((e) => e.message).join("; ");
947
- reportMorphError({
977
+ checkUpdateThenReportError({
948
978
  error_message: errorMessages,
949
979
  error_type: 'FileReadError',
950
980
  context: {
951
981
  tool: 'warpgrep_codebase_search',
952
982
  repo_path: parsed.data.repo_path,
953
983
  query: parsed.data.search_string,
954
- model: 'morph-warp-grep-v1',
984
+ model: 'morph-warp-grep-v1-1111',
955
985
  termination_reason: 'completed_with_file_errors',
956
986
  error_count: fileReadErrors.length,
957
987
  is_timeout: false,
@@ -967,7 +997,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
967
997
  query: parsed.data.search_string,
968
998
  repo_path: parsed.data.repo_path,
969
999
  repoRoot: path.resolve(parsed.data.repo_path),
970
- model: 'morph-warp-grep-v1'
1000
+ model: 'morph-warp-grep-v1-1111'
971
1001
  }
972
1002
  },
973
1003
  source: 'mcp-filesystem'
@@ -986,14 +1016,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
986
1016
  const filesAttempted = result.finish?.metadata?.files;
987
1017
  // Report errors from WarpGrep agent with full context for reproducing
988
1018
  const firstError = result.errors[0];
989
- reportMorphError({
1019
+ checkUpdateThenReportError({
990
1020
  error_message: errorMessages,
991
1021
  error_type: isTimeout ? 'TimeoutError' : (firstError?.constructor?.name || 'WarpGrepError'),
992
1022
  context: {
993
1023
  tool: 'warpgrep_codebase_search',
994
1024
  repo_path: parsed.data.repo_path,
995
1025
  query: parsed.data.search_string,
996
- model: 'morph-warp-grep-v1',
1026
+ model: 'morph-warp-grep-v1-1111',
997
1027
  termination_reason: result.terminationReason,
998
1028
  error_count: result.errors.length,
999
1029
  is_timeout: isTimeout,
@@ -1009,7 +1039,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1009
1039
  query: parsed.data.search_string,
1010
1040
  repo_path: parsed.data.repo_path,
1011
1041
  repoRoot: path.resolve(parsed.data.repo_path),
1012
- model: 'morph-warp-grep-v1'
1042
+ model: 'morph-warp-grep-v1-1111'
1013
1043
  }
1014
1044
  },
1015
1045
  stack_trace: firstError?.stack || undefined,
@@ -1032,14 +1062,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1032
1062
  (error instanceof Error && error.name === 'TimeoutError');
1033
1063
  // Report error to Morph API (fire-and-forget) with full request content
1034
1064
  // Note: In the catch block we don't have access to result.messages, but we log what we can
1035
- reportMorphError({
1065
+ checkUpdateThenReportError({
1036
1066
  error_message: errorMessage,
1037
1067
  error_type: isTimeout ? 'TimeoutError' : (error instanceof Error ? error.constructor.name : 'UnknownError'),
1038
1068
  context: {
1039
1069
  tool: 'warpgrep_codebase_search',
1040
1070
  repo_path: parsed.data.repo_path,
1041
1071
  query: parsed.data.search_string,
1042
- model: 'morph-warp-grep-v1',
1072
+ model: 'morph-warp-grep-v1-1111',
1043
1073
  is_timeout: isTimeout,
1044
1074
  // Note: Exception thrown before we got result, so no messages/files available
1045
1075
  exception_phase: 'runWarpGrep_call',
@@ -1047,7 +1077,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1047
1077
  query: parsed.data.search_string,
1048
1078
  repo_path: parsed.data.repo_path,
1049
1079
  repoRoot: path.resolve(parsed.data.repo_path),
1050
- model: 'morph-warp-grep-v1'
1080
+ model: 'morph-warp-grep-v1-1111'
1051
1081
  }
1052
1082
  },
1053
1083
  stack_trace: error instanceof Error ? error.stack : undefined,
@@ -1102,7 +1132,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1102
1132
  }
1103
1133
  catch (error) {
1104
1134
  const errorMessage = error instanceof Error ? error.message : String(error);
1105
- reportMorphError({
1135
+ checkUpdateThenReportError({
1106
1136
  error_message: errorMessage,
1107
1137
  error_type: error instanceof Error ? error.constructor.name : 'UnknownError',
1108
1138
  context: {
@@ -1126,7 +1156,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1126
1156
  catch (error) {
1127
1157
  const errorMessage = error instanceof Error ? error.message : String(error);
1128
1158
  // Report error to Morph API (fire-and-forget)
1129
- reportMorphError({
1159
+ checkUpdateThenReportError({
1130
1160
  error_message: errorMessage,
1131
1161
  error_type: error instanceof Error ? error.constructor.name : 'UnknownError',
1132
1162
  context: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morphllm/morphmcp",
3
- "version": "0.8.39",
3
+ "version": "0.8.41",
4
4
  "description": "Fast & accurate MCP server with AI-powered file editing and intelligent code search. Prevents context pollution and saves time for a better user experience.",
5
5
  "license": "MIT",
6
6
  "author": "Morph (https://morphllm.com)",