memorylens-mcp
Hosted deployment
A hosted deployment is available on Fronteir AI.
Related MCP server: ASPNET Core Debugging MCP Server
Quick Start
npx (any MCP client)
{
"mcpServers": {
"memorylens": {
"type": "stdio",
"command": "npx",
"args": ["-y", "memorylens-mcp"]
}
}
}The npm package ships no server code — it is a launcher that installs the MemoryLens.Mcp .NET
global tool at a matching version and execs it, so the .NET 10 SDK must be on PATH.
Subsequent starts skip the install entirely and work offline.
VS Code / Visual Studio (via dnx)
Add to your MCP settings (.vscode/mcp.json or VS settings):
{
"servers": {
"memorylens": {
"type": "stdio",
"command": "dnx",
"args": ["MemoryLens.Mcp", "--yes"]
}
}
}Claude Code Plugin
claude install gh:MarcelRoozekrans/memorylens-mcp.NET Global Tool
dotnet tool install -g MemoryLens.McpDocker
docker build -t memorylens-mcp .
docker run -i --rm --pid=host --cap-add=SYS_PTRACE \
-v "$PWD:/workspace" -v memorylens-tools:/root/.memorylens memorylens-mcpProfiling from a container needs ptrace and the host PID namespace, and on
Docker Desktop that namespace is the Linux VM rather than your desktop — see
docs/docker.md before choosing this route.
Prerequisites
.NET 10 SDK or later
JetBrains dotMemory CLI (see below for installation options)
dotMemory CLI Installation
MemoryLens MCP automatically downloads and caches the JetBrains dotMemory CLI on first use via the ensure_dotmemory tool — no manual installation required on supported platforms.
Supported Platforms (auto-download)
Platform | Architecture |
Windows | x64, x86, ARM64 |
Linux (glibc) | x64, ARM64, ARM |
Linux (musl) | x64, ARM64 |
macOS | x64 (Intel), ARM64 (Apple Silicon) |
Cache Location
Downloaded binaries are cached at ~/.memorylens/tools/dotmemory/{version}/. Old versions are not auto-removed — delete the directory manually to free disk space.
Unsupported Platforms
Platforms not listed above (e.g. FreeBSD, Linux x86) cannot use auto-download. Set DOTMEMORY_PATH to point to an existing dotMemory CLI executable:
export DOTMEMORY_PATH="/path/to/dotMemory.sh" # Linux/macOS
set DOTMEMORY_PATH=C:\path\to\dotMemory.exe # WindowsFind dotMemory CLI in JetBrains Toolbox:
Linux:
~/.local/share/JetBrains/Toolbox/apps/rider/tools/profiler/dotMemory.shWindows:
%LOCALAPPDATA%\JetBrains\Toolbox\apps\rider\tools\profiler\dotMemory.exe
Manual Fallback Discovery
If auto-download is unavailable, MemoryLens MCP falls back through these discovery modes in order:
DOTMEMORY_PATHenvironment variable — explicit path to the CLI executableSystem PATH — searches for
dotMemory.sh/dotMemory(Linux/macOS) ordotMemory.exe(Windows)Local .NET tool manifest —
dotnet tool install dotnet-dotmemory --localGlobal .NET tool —
dotnet tool install -g dotnet-dotmemory(legacy fallback)
Error Scenarios
Error | Cause | Fix |
| Unsupported OS/arch | Set |
Network/download failure | No internet / NuGet unreachable | Set |
| Read-only filesystem | Set |
| All discovery modes failed | Run |
Available MCP Tools
Tool | Description |
| Downloads and verifies the JetBrains dotMemory CLI tool is available |
| Lists running .NET processes available for profiling. Discovers them from their diagnostic IPC endpoints, so it works before |
| Captures a single memory snapshot of a target process |
| Captures two snapshots with configurable delay and compares them |
| Runs the rule engine against a captured snapshot and returns findings |
| Lists all available analysis rules with their metadata |
Built-in Rules
ID | Severity | Category | Description |
ML001 | critical | leak | Event handler leak detected |
ML002 | critical | leak | Static collection growing unbounded |
ML003 | high | leak | Disposable object not disposed |
ML004 | high | fragmentation | Large Object Heap fragmentation |
ML005 | medium | retention | Object retained longer than expected |
ML006 | medium | allocation | Excessive allocations in hot path |
ML007 | medium | retention | Closure retaining unexpected references |
ML008 | low | allocation | Array/list resizing without capacity hint |
ML009 | low | pattern | Finalizer without Dispose pattern |
ML010 | low | pattern | String interning opportunity |
Configuration
Create a .memorylens.json file in your project root to customize rule behavior:
{
"rules": {
"ML001": { "enabled": true, "severity": "critical" },
"ML002": { "enabled": true, "severity": "critical" },
"ML003": { "enabled": true, "severity": "high" },
"ML004": { "enabled": true, "severity": "high" },
"ML005": { "enabled": true, "severity": "medium" },
"ML006": { "enabled": true, "severity": "medium" },
"ML007": { "enabled": true, "severity": "medium" },
"ML008": { "enabled": true, "severity": "low" },
"ML009": { "enabled": true, "severity": "low" },
"ML010": { "enabled": true, "severity": "low" }
}
}Usage Examples
Single Snapshot
Capture a memory snapshot of a running process to inspect current memory state:
> /memorylens
> Take a snapshot of my running API (PID 12345)Claude will call ensure_dotmemory, then snapshot with the target PID, then analyze the result and present findings ordered by severity.
Before/After Comparison
Detect memory growth by comparing two snapshots taken with a delay:
> /memorylens
> Check if my app has a memory leak — compare before and after processing 1000 requestsClaude will call compare_snapshots with a configurable wait period, then analyze the diff to identify objects that grew between snapshots.
License
Maintenance
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables AI agents to debug .NET applications using netcoredbg. It supports core debugging tasks like setting breakpoints, stepping through code, and inspecting variables or stack traces.Last updated1MIT
- AlicenseAqualityAmaintenanceMCP server that lets AI agents (Claude, Cursor) debug your .NET / ASP.NET Core appLast updated2714MIT
- AlicenseAqualityCmaintenanceMCP server for profiling Java applications via JDK utilities (jcmd, jfr, jps). Enables AI assistants to diagnose performance, analyze threads, and inspect JFR recordings without manual CLI usage.Last updated26878MIT
- AlicenseAqualityBmaintenanceAn MCP server that captures and analyzes function-level profiling data from NetEase Minecraft Bedrock Edition mods via the native Tracy profiler, enabling AI to identify performance hotspots and verify optimizations.Last updated613MIT
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarcelRoozekrans/memorylens-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server