1MCP
Runs many MCP servers behind one local runtime and hands each client a filtered view of them
Explore JavaScript heap snapshots to find memory leaks with Meta's MemLab analysis engine
Official · Meta TypeScript Local · stdio Developer tools
71 popularity score ★ 5.1k ↓ 3.3k/wk
Opens the app, which asks before it adds the server.
claude mcp add memlab -- npx -y -p @memlab/mcp-server memlab-mcp{
"mcpServers": {
"memlab": {
"command": "npx",
"args": [
"-y",
"-p",
"@memlab/mcp-server",
"memlab-mcp"
]
}
}
}{
"mcpServers": {
"memlab": {
"command": "npx",
"args": [
"-y",
"-p",
"@memlab/mcp-server",
"memlab-mcp"
]
}
}
}{
"servers": {
"memlab": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"-p",
"@memlab/mcp-server",
"memlab-mcp"
]
}
}
}[mcp_servers.memlab]
command = "npx"
args = ["-y", "-p", "@memlab/mcp-server", "memlab-mcp"]gemini mcp add --scope user memlab npx -- -y -p @memlab/mcp-server memlab-mcpOpens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
git clone https://github.com/meta/memlab.git
cd memlab
npm install
npm run buildclaude mcp add memlab -- node --max-old-space-size=8192 '<ABSOLUTE_PATH_TO_CLONE>/packages/mcp-server/dist/index.js'{
"mcpServers": {
"memlab": {
"command": "node",
"args": [
"--max-old-space-size=8192",
"<ABSOLUTE_PATH_TO_CLONE>/packages/mcp-server/dist/index.js"
]
}
}
}{
"mcpServers": {
"memlab": {
"command": "node",
"args": [
"--max-old-space-size=8192",
"<ABSOLUTE_PATH_TO_CLONE>/packages/mcp-server/dist/index.js"
]
}
}
}{
"servers": {
"memlab": {
"type": "stdio",
"command": "node",
"args": [
"--max-old-space-size=8192",
"<ABSOLUTE_PATH_TO_CLONE>/packages/mcp-server/dist/index.js"
]
}
}
}[mcp_servers.memlab]
command = "node"
args = ["--max-old-space-size=8192", "<ABSOLUTE_PATH_TO_CLONE>/packages/mcp-server/dist/index.js"]gemini mcp add --scope user memlab node -- --max-old-space-size=8192 '<ABSOLUTE_PATH_TO_CLONE>/packages/mcp-server/dist/index.js'NODE_OPTIONS |
Optional: Set --max-old-space-size=8192 or higher here so large snapshots load when it runs as memlab-mcp. |
|---|---|
MEMLAB_DISABLE_CODE_TOOLS |
Optional: 1 removes every tool that runs caller-supplied JavaScript for the whole session. |
MEMLAB_TOOLSETS |
Optional: Comma-separated tool groups to expose, such as core or growth. Unset exposes all. |
MEMLAB_ANALYSIS_TIMEOUT_MS |
Optional: Wall-clock budget per tool call in ms. 0 or less turns it off. |
MEMLAB_REPEAT_NOTES |
Optional: 1 prints the standing notes on every call instead of once. |
This is the MCP side of MemLab, the JavaScript memory toolkit from Meta. Point it at a .heapsnapshot file saved from Chrome DevTools or from Node.js and it parses the file, works out the dominator tree and retained sizes, then keeps the whole graph in memory. After that an assistant can keep asking questions about the same capture without paying for the parse again, which matters because a big load can take minutes.
The everyday tools do what you would otherwise click through in DevTools: class histograms, the largest retainers, retainer paths back to a GC root, detached DOM, duplicated strings, closures and globals. Most of the package goes further than that. A whole group of tools works on a ladder, meaning a series of snapshots taken while one interaction repeats. They fit the growth per cycle and try to tell a real leak from a working set that levels off. Others check that a fix worked, or separate memory held by dev tooling from what production would keep.
The package in version 2.313.0 registers 160 tools. That count comes from the index that the memlab_tools call prints, and the README only says about 150. Because that many tools crowd a client, MEMLAB_TOOLSETS can limit the server to named groups such as core or growth, and more groups can be switched on mid-session. memlab_capture can now take fresh snapshots of a live page and its workers from a Chrome you started with remote debugging on.
Thirteen tools run JavaScript supplied by the caller or read from a run directory, memlab_eval and memlab_for_each among them, and the makers warn that this code has the full rights of the server process.
| Runtime | Node.js 18+ |
|---|---|
| Runs on | macOS, Windows, Linux |
| Also |
|
Node.js 18 or later. Give the server a large heap: NODE_OPTIONS=--max-old-space-size=8192 or more when it runs as memlab-mcp or from dist/index.js. When started by the memlab plugin or memlab-cli, set MEMLAB_MAX_OLD_SPACE_MB instead, since those pass their own flag. Claude Code users can install it as a plugin with claude plugin marketplace add meta/memlab and then claude plugin install memlab@memlab. Codex users run codex plugin marketplace add meta/memlab and then codex plugin add memlab@memlab. Gzipped snapshots are unpacked with the gzip program.
Snapshot loads are refused above max_file_size_mb (900 MB by default); around 850 MB is the largest size the docs report as reliable at an 8 GB heap limit, and larger captures need both limits raised. Every resident snapshot adds its full graph to memory. A light load skips retained sizes, so tools that need dominators or retainer paths return an error on it. The manifold:// paths and bare snapshot names fetch from Meta's internal Manifold storage through a manifold command, which outside users will not have. It analyses saved snapshots only; it does not drive a browser or capture snapshots itself.
Suits JavaScript and Node.js developers chasing a leak or heap bloat who can take heap snapshots and want an assistant to walk retainer paths, histograms and growth across a series of captures. It runs locally, needs no account and comes from the MemLab team at Meta. Expect to give it several GB of RAM for big captures. If you want only read-only tools, start it with MEMLAB_DISABLE_CODE_TOOLS=1 and keep the file-writing tools on manual approval, or pick a server without code execution.
42 only read, 6 change things, 12 can delete or overwrite. A ? marks an optional parameter.
memlab_toolsmemlab_load_snapshotfile_path: stringalias?: stringkeep_previous?: booleanrepeat_notes?: booleanquiet?: booleansuppress_suggestions?: booleanmax_file_size_mb?: numbermax_nodes?: numbermax_edges?: numberforce?: booleanforce_reload?: booleanlight?: booleanasync?: booleanmemlab_snapshot_headermemlab_snapshotsmemlab_batch deletesmemlab_start_job deletesmemlab_job_statusmemlab_server_statusmemlab_snapshot_summarymemlab_quick_diagnosismemlab_app_heapmemlab_memory_partitionmemlab_largest_objectsmemlab_get_nodememlab_find_nodes_by_classmemlab_get_referencesmemlab_get_referrersmemlab_retainer_tracememlab_dominator_chainmemlab_dominator_subtreememlab_detached_dommemlab_duplicated_stringsmemlab_stale_collectionsmemlab_global_variablesmemlab_search_nodesmemlab_query_objectsmemlab_retained_bymemlab_class_histogrammemlab_object_shapememlab_closure_inspectionmemlab_aggregatememlab_cache_inventorymemlab_react_ownersmemlab_event_registrymemlab_field_release_impactmemlab_diff_snapshotsmemlab_sequence_analysismemlab_ladder changesmemlab_leak_reportmemlab_rate_modelmemlab_verify_fixmemlab_dev_artifactsmemlab_analysis_battery deletesmemlab_battery_statusmemlab_prune_run deletesmemlab_capture changesmemlab_realm_summarymemlab_anonymize_snapshot changesmemlab_finding_index changesmemlab_metric changesmemlab_probes changesmemlab_reportsmemlab_eval deletesmemlab_eval_across deletesmemlab_for_each deletesmemlab_hypothesis deletesmemlab_ladder_probe deletesmemlab_replicate deletesmemlab_judges deletesmemlab_ab_compare deletes