Skip to main content
Glama
paolino

mcp-memory-server

by paolino
README.md
# MCP Memory Server

[![CI](https://github.com/paolino/mcp-memory-server/actions/workflows/CI.yaml/badge.svg)](https://github.com/paolino/mcp-memory-server/actions/workflows/CI.yaml)

MCP server for memory management with process inspection and cleanup tools.

**[Documentation](https://paolino.github.io/mcp-memory-server/)**

## Tools

| Tool | Description |
|------|-------------|
| `list_memory_usage` | System memory summary (like `free -h`) |
| `list_top_processes` | Top N memory consumers with details |
| `find_stale_processes` | Find sleeping/idle processes by age, state, name pattern |
| `kill_processes` | Kill PIDs with safety checks |

## Installation

### Claude Code

Add to `~/.config/claude-code/mcp.json`:

```json
{
  "mcpServers": {
    "mcp-memory": {
      "command": "nix",
      "args": ["run", "github:paolino/mcp-memory-server", "--refresh"]
    }
  }
}
```

The `--refresh` flag ensures you always get the latest version. Remove it to use the cached version for faster startup.

### From source

```bash
git clone https://github.com/paolino/mcp-memory-server
cd mcp-memory-server
nix develop
just install
just run
```

## Usage Examples

### Show memory usage

Ask Claude: "Show me current memory usage"

### Find stale GHC processes

Ask Claude: "Find old GHC or cabal processes using more than 100MB"

This calls `find_stale_processes` with:
- `name_pattern`: `"ghc|cabal"`
- `min_memory_mb`: `100`

### Kill processes

Ask Claude: "Kill these PIDs: 1234, 5678"

Safety checks:
- Refuses PID 0/1
- Refuses root-owned processes (unless running as root)
- Optional name confirmation to prevent killing wrong process
- Default SIGTERM, SIGKILL only when explicit

## Development

```bash
nix develop
just test       # Run tests
just run        # Start server
just format     # Format code
just lint       # Lint code
```

## License

MIT

TDQS

A3.8/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a distinct purpose: memory usage overview, top processes, process grouping, stale process detection, and process termination. Even the two listing tools are clearly differentiated by their focus on top consumers versus name-based aggregation, with descriptions reinforcing this.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (list_*, find_*, kill_*). There are no mixed conventions or vague verbs, making the API predictable and easy to navigate.

Tool Count5/5

With 5 tools, the server is well-scoped for its purpose. It provides a comprehensive set for memory monitoring and process management without unnecessary bloat, and each tool earns its place.

Completeness4/5

The tool surface covers the core lifecycle: memory overview, process listing, grouping, stale detection, and killing. A minor gap is the lack of a tool to retrieve detailed information about a single process by PID, but this does not critically impede the server's primary functionality.

Maintenance

ActivityInactive
ResponsivenessNo issues