# portcheck MCP server

> Allows AI assistants to diagnose and resolve port conflicts by identifying processes using specific ports and stopping them safely.

- Repository: https://github.com/roystondwork-dev/portcheck
- Page: https://hostedmcp.org/servers/roystondwork-dev/portcheck
- Transport: stdio
- Stars: 2
- License: MIT
- Latest version: 0.14.0

## Install

### Claude Code

```sh
claude mcp add portcheck -- npx -y portcheck-cli
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "portcheck": {
      "command": "npx",
      "args": [
        "-y",
        "portcheck-cli"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "portcheck": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "portcheck-cli"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"portcheck","type":"stdio","command":"npx","args":["-y","portcheck-cli"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "portcheck": {
      "command": "npx",
      "args": [
        "-y",
        "portcheck-cli"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add portcheck -- npx -y portcheck-cli
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.portcheck]
command = "npx"
args = ["-y", "portcheck-cli"]
```

### Gemini CLI

```sh
gemini mcp add -s user portcheck npx -- -y portcheck-cli
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "portcheck": {
      "command": "npx",
      "args": [
        "-y",
        "portcheck-cli"
      ]
    }
  }
}
```

## FAQ

### How can AI assistants use portcheck?

AI assistants like Claude Code, Cursor, and Copilot can use portcheck's MCP tools to check and free ports themselves.

### Is it safe to kill processes with portcheck?

Yes, it performs a graceful SIGTERM followed by a SIGKILL and refuses to touch system processes, PID 1, or your shell.

### Can portcheck find available ports for a new service?

Yes, it can find and verify free ports by actually attempting to bind them.
