cf-memory-mcp 3.8.7 → 3.8.9

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.
@@ -155,7 +155,7 @@ const TOOLS_LIST = [
155
155
  file_filter: { type: 'array', items: { type: 'string' }, description: 'Limit to files matching path substrings' },
156
156
  all_projects: { type: 'boolean', description: 'Search across ALL your indexed projects (overrides project_id). Useful for "find X in any of my repos".' },
157
157
  expand_context: { type: 'boolean', description: 'Include file_imports (the file\'s module/imports chunk) with each result. Default: true.' },
158
- exclude_docs: { type: 'boolean', description: 'Filter out markdown/docs from code queries. Default: true (auto-disabled if query mentions docs/readme/tutorial).' }
158
+ exclude_docs: { type: 'boolean', description: 'Filter out markdown/docs from code queries. Default: true (auto-disabled if query mentions docs/readme/tutorial). Response includes docs_filtered_count when chunks were dropped — flip to false to surface them.' }
159
159
  },
160
160
  required: ['query']
161
161
  }
@@ -903,8 +903,17 @@ class CFMemoryMCP {
903
903
 
904
904
  let filesList = [];
905
905
  try {
906
- filesList = JSON.parse(listFilesRes.result.content[0].text);
907
- if (!Array.isArray(filesList)) filesList = [];
906
+ const parsed = JSON.parse(listFilesRes.result.content[0].text);
907
+ if (Array.isArray(parsed)) {
908
+ filesList = parsed;
909
+ } else if (parsed && parsed.error) {
910
+ // Server returned {error, hint} — surface it instead of
911
+ // pretending there are zero indexed files.
912
+ return respond({
913
+ error: parsed.error,
914
+ hint: parsed.hint || `find_stale_files needs a valid project_id; got "${projectIdOrName}"`,
915
+ });
916
+ }
908
917
  } catch (_) {
909
918
  return respond({ error: 'Failed to list indexed files' });
910
919
  }
@@ -984,8 +993,15 @@ class CFMemoryMCP {
984
993
  });
985
994
  let filesList = [];
986
995
  try {
987
- filesList = JSON.parse(listRes.result.content[0].text);
988
- if (!Array.isArray(filesList)) filesList = [];
996
+ const parsed = JSON.parse(listRes.result.content[0].text);
997
+ if (Array.isArray(parsed)) {
998
+ filesList = parsed;
999
+ } else if (parsed && parsed.error) {
1000
+ return respond({
1001
+ error: parsed.error,
1002
+ hint: parsed.hint || `refresh_stale needs a valid project_id; got "${projectIdOrName}"`,
1003
+ });
1004
+ }
989
1005
  } catch (_) {
990
1006
  return respond({ error: 'Failed to list indexed files' });
991
1007
  }
@@ -1084,6 +1100,13 @@ class CFMemoryMCP {
1084
1100
  this.logDebug(`Found ${files.length} files to index.`);
1085
1101
 
1086
1102
  if (files.length === 0) {
1103
+ // Verify the path actually exists so we can tell the user
1104
+ // whether it's "path wrong" or "everything was filtered out".
1105
+ let pathExists = false;
1106
+ try { pathExists = fs.existsSync(resolvedPath); } catch (_) { pathExists = false; }
1107
+ const hint = !pathExists
1108
+ ? `Path "${resolvedPath}" does not exist. Check the project_path argument.`
1109
+ : `Path exists but every file was filtered out. The bridge excludes node_modules, dist, build, .git, *.lock, *.min.js, *.d.ts, .augment, .kiro, .intent, .husky, .claude, and generated/ directories. Pass include_patterns to override, or check that the project actually has source files at this path.`;
1087
1110
  const response = {
1088
1111
  jsonrpc: '2.0',
1089
1112
  id: message.id,
@@ -1097,7 +1120,8 @@ class CFMemoryMCP {
1097
1120
  files_indexed: 0,
1098
1121
  chunks_created: 0,
1099
1122
  status: 'complete',
1100
- message: 'No matching files found in directory'
1123
+ message: 'No matching files found in directory',
1124
+ hint
1101
1125
  }, null, 2)
1102
1126
  }]
1103
1127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-memory-mcp",
3
- "version": "3.8.7",
3
+ "version": "3.8.9",
4
4
  "description": "Cloudflare-hosted MCP server for code indexing, retrieval, and assistant memory with a direct remote MCP endpoint and local stdio bridge.",
5
5
  "main": "bin/cf-memory-mcp.js",
6
6
  "bin": {