MCP Server logo

MCP Server

by @memlab

Lets AI coding assistants inspect JavaScript heap snapshots, trace retained objects, and investigate memory leaks with MemLab.

Install MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "memlab-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "-p",
        "@memlab/mcp-server",
        "memlab-mcp"
      ],
      "env": {
        "NODE_OPTIONS": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

@memlab/mcp-server connects AI coding assistants to MemLab's JavaScript heap analysis workflow. It lets agents load heap snapshots, identify retained objects and memory leaks, and investigate memory optimization opportunities through natural-language interaction. Use it when debugging browser, Node.js, Electron, or Hermes memory behavior, or when adding leak checks to development workflows. The server runs through the MCP stdio interface with npx and can be installed directly or through the MemLab plugin for Claude Code and Codex.

Use cases

  • Analyze a .heapsnapshot file for retained objects
  • Trace the references keeping a suspected leak alive
  • Investigate memory growth after a browser interaction
  • Find leaks in a Puppeteer-based web scenario
  • Add memory leak checks to tests and CI

Key features

  • MCP access to MemLab heap analysis
  • Heap snapshot loading and investigation
  • Retainer trace inspection
  • Browser memory leak detection
  • Support for Chromium, Node.js, Electron, and Hermes snapshots
  • MemLab agent skills for leak testing and snapshot capture

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 1h ago via OSV.dev · @memlab/mcp-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars5.1kStargazers on the source repository.
Last commitTodayMost recent push to the default branch.

How MCP Server works

What @memlab/mcp-server does

@memlab/mcp-server exposes MemLab's heap-analysis capabilities to AI coding assistants through the Model Context Protocol. Agents can work with JavaScript heap snapshots to determine what occupies memory, find objects that remain reachable unexpectedly, inspect retaining references, and investigate objects that grow during an interaction.

The server is intended for memory debugging rather than general application development. It is useful when an agent needs to reason about a .heapsnapshot file, diagnose a suspected browser leak, or turn an observed memory problem into a regression test. MemLab's surrounding tooling supports snapshots from Chromium-based browsers, Node.js, Electron, and Hermes.

How it works

The MCP process is launched with the memlab-mcp executable from the @memlab/mcp-server package. An MCP-compatible coding agent starts that process and communicates with it over standard input and output. The agent can then ask MemLab to inspect heap data and guide an investigation conversationally.

A typical investigation begins with a heap snapshot. MemLab can examine the heap graph, identify objects associated with leaks or memory growth, and show a retainer trace: the chain of references that keeps an object reachable from a garbage-collection root. That trace helps locate the reference that should have been released. A particular heap object can also be investigated by its object identifier.

For web applications, MemLab can run an end-to-end scenario using Puppeteer, compare snapshots around an interaction, and report grouped leaks. The underlying MemLab framework also supports custom leak detectors, memory analyses, and Node.js memory assertions. Code that has readable function, property, and variable names produces more useful traces than heavily minified code.

Setup and configuration

The package can be run without a global installation through npx:

Terminal
npx -y -p @memlab/mcp-server memlab-mcp

Claude Code and Codex can add the server directly with their MCP commands. Their documented setup also sets NODE_OPTIONS=--max-old-space-size=8192, which gives the MemLab process an 8 GB Node.js heap limit for memory-intensive analysis:

Terminal
claude mcp add memlab -e NODE_OPTIONS=--max-old-space-size=8192 -- npx -y -p @memlab/mcp-server memlab-mcp
codex mcp add memlab --env NODE_OPTIONS=--max-old-space-size=8192 -- npx -y -p @memlab/mcp-server memlab-mcp

Claude Code and Codex can instead install the MemLab plugin, which bundles this MCP server with four agent skills for heap analysis, web leak detection, snapshot capture, and memory-test creation. Cursor and other agents can add the same stdio command to their MCP configuration using the format required by the client.

Tools and capabilities

  • Load and inspect JavaScript heap snapshots.
  • Investigate objects that consume or continue to accumulate memory.
  • Find memory leaks and examine retainer traces.
  • Analyze snapshots captured from Chromium, Hermes, Node.js, Electron, or MemLab.
  • Support browser leak investigations based on Puppeteer interaction scenarios.
  • Help coding agents create memory leak regression tests and explore optimization opportunities through the associated MemLab skills.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Server

@memlab/mcp-server is an MCP server that connects AI coding assistants to MemLab for JavaScript heap snapshot analysis. Its main tools load snapshots, identify memory leaks, inspect retained-object reference chains, and investigate memory optimization opportunities across browser, Node.js, Electron, and Hermes workloads.

Install it through npx with `npx -y -p @memlab/mcp-server memlab-mcp`, then add that stdio command to your MCP client's configuration. Claude Code and Codex also provide documented `mcp add` commands, optionally setting `NODE_OPTIONS` to increase the Node.js heap limit.

Yes, Cursor is named as a supported AI coding assistant. Add the `memlab-mcp` npx command to Cursor's MCP configuration using its standard server configuration format.

Yes, it can investigate JavaScript heap snapshots from Node.js programs. MemLab's supported snapshot sources also include Chromium-based browsers, Electron, Hermes, and snapshots produced by MemLab.

Yes, it supports web leak investigations built around Puppeteer scenarios. MemLab can compare heap snapshots around an interaction, group similar leaks, and provide retainer traces that show why leaked objects remain reachable.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/memlab-mcp-server?style=directory)](https://allmcps.com/mcp/memlab-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/memlab-mcp-server"><img src="https://allmcps.com/api/badge/memlab-mcp-server?style=directory" alt="MCP Server on AllMCPs" /></a>