cf-memory-mcp 3.9.3 → 3.9.4

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.
@@ -1818,8 +1818,18 @@ class CFMemoryMCP {
1818
1818
  }
1819
1819
  if (!resolvedFull) return false;
1820
1820
 
1821
- const fullContent = fs.readFileSync(resolvedFull, 'utf8');
1821
+ // Guard against blowing memory on huge files (binary blobs, big
1822
+ // SQL dumps, etc). 10MB is plenty for any source file the
1823
+ // chunker would handle. Above that, fall through to the
1824
+ // server's chunk-reconstruction path which is already truncated.
1822
1825
  const stat = fs.statSync(resolvedFull);
1826
+ const MAX_LOCAL_READ_BYTES = 10 * 1024 * 1024;
1827
+ if (stat.size > MAX_LOCAL_READ_BYTES) {
1828
+ _mcpTrace('GFC_LOCAL_SKIP', `file too large (${stat.size}b > ${MAX_LOCAL_READ_BYTES}b): ${resolvedFull}`);
1829
+ return false;
1830
+ }
1831
+
1832
+ const fullContent = fs.readFileSync(resolvedFull, 'utf8');
1823
1833
  const truncated = fullContent.length > maxChars;
1824
1834
  const content = truncated ? fullContent.slice(0, maxChars) + '\n... [truncated]' : fullContent;
1825
1835
  const totalLines = fullContent.split('\n').length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-memory-mcp",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
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": {