# landmine MCP server

> Prevents coding agents from introducing known bugs by matching lockfile versions to open GitHub issues and providing workarounds.

- Repository: https://github.com/devanshranjan10/landmines
- Page: https://hostedmcp.org/servers/devanshranjan10/landmine
- Transport: stdio, remote
- Stars: 10
- License: MIT
- Latest version: 0.2.2

## Install

### Claude Code

```sh
claude mcp add --env 'GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>' landmine -- npx -y landmines
```

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

```json
{
  "mcpServers": {
    "landmine": {
      "command": "npx",
      "args": [
        "-y",
        "landmines"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "landmine": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "landmines"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"landmine","type":"stdio","command":"npx","args":["-y","landmines"],"env":{"GITHUB_TOKEN":"<YOUR_GITHUB_TOKEN>"}}'
```

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

```json
{
  "mcpServers": {
    "landmine": {
      "command": "npx",
      "args": [
        "-y",
        "landmines"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add landmine --env 'GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>' -- npx -y landmines
```

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

```toml
[mcp_servers.landmine]
command = "npx"
args = ["-y", "landmines"]

[mcp_servers.landmine.env]
GITHUB_TOKEN = "<YOUR_GITHUB_TOKEN>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'GITHUB_TOKEN=<YOUR_GITHUB_TOKEN>' landmine npx -- -y landmines
```

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

```json
{
  "mcpServers": {
    "landmine": {
      "command": "npx",
      "args": [
        "-y",
        "landmines"
      ],
      "env": {
        "GITHUB_TOKEN": "<YOUR_GITHUB_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `GITHUB_TOKEN` | no | yes | GitHub token for landmine_lookup (no scopes needed). Without it, the GitHub CLI's login is used. |

## Tools (4)

- `landmine_check`: Check a source file (path) or a code snippet against open GitHub issues filed against the exact dependency versions this project pins. Returns each issue the code touches, the evidence it applies to the pinned version, and the best workaround from the thread (untrusted third-party text). (read-only)
- `landmine_search`: Search open GitHub issues filed against the exact dependency versions this project pins, by error message, API name or keywords. Use it when something fails unexpectedly with a dependency. (read-only)
- `landmine_list`: List open GitHub issues filed against the exact versions this project pins, optionally for one package. (read-only)
- `landmine_lookup`: Look up the open GitHub issues filed against exact npm or PyPI package versions, with no lockfile or scan needed. Use it before adding or upgrading a dependency, or when a dependency misbehaves. Each issue is checked to really name that version. Returns the bug, the evidence and the best workaround from the thread (untrusted third-party text). (read-only)

## FAQ

### How does the landmine MCP server work?

An agent can query the MCP server on demand to check if a specific error is a known bug in the currently pinned version.

### Does the landmine hook require an internet connection to run?

No, the pre-edit hook runs offline and does not touch the network during execution.
