Skip to main content
Glama
tonypan2

Minesweeper MCP Server

by tonypan2
README.md
# Minesweeper MCP Server

This is an [Model Context Protocol server](https://github.com/modelcontextprotocol/servers) that allows an MCP client agents to play a game of [Minesweeper](<https://en.wikipedia.org/wiki/Minesweeper_(video_game)>). It is intended to be run alongside the [Minesweeper game server](https://github.com/tonypan2/minesweeper-server).

![Screen capture](static/screen_recording.gif?raw=true)
View the entire video demo at https://youtu.be/CXXMafVtlEQ (16x speedup).

## Getting started

- Follow the [instructions](https://github.com/tonypan2/minesweeper-server) of the game server to start it locally.

* Build the MCP server:

```bash
npm install
npm run build
```

- Configure your MCP client to add the tool. For example, here is how to add the tool to Claude Desktop on Windows's `claude_desktop_config.json` ([locating the file](https://gist.github.com/feveromo/7a340d7795fca1ccd535a5802b976e1f#3-configure-claude-desktop)), assuming you cloned the repo at `C:\path\to\repo\minesweeper-mcp-server`:

```JSON
{
  "mcpServers": {
    "mcp-server": {
      "command": "node",
      "args": ["C:\\path\\to\\repo\\minesweeper-mcp-server\\build\\index.js"],
      "env": {
        "DEBUG": "*"
      }
    }
  }
}

```

- Claude Desktop : Restart Claude Desktop to let it pick up the tools. Be sure to quit from the tray menu icon, not from the app (which simply hides the window). If you click the Tools icon, it should show the new tools:

  ![Screenshot of Claude Desktop homepage](static/claude_home.png?raw=true)

  ![Screenshot of new tools](static/claude_tools.png?raw=true)

## Example prompt

```
Start a new game of Minesweeper. Try your best to keep playing until you have flagged all mines. Remember that the coordinates are 0-indexed.
```

## Example interaction

The actual conversation is very long. Here are some snippets:

## Game start

![Game starts](static/game-start.png)

## Placing flag at the wrong place

![Claude places flag at the wrong place](static/wrong-flag.png)

## Giving up after several attempts

![Claude gives up](static/gave-up.png)

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: click interacts with cells, flag marks them, unflag removes marks, and start_game initiates play. There is no overlap or ambiguity between these actions in the Minesweeper context.

Naming Consistency5/5

All tool names follow a consistent verb-based pattern (click, flag, start_game, unflag) with clear, descriptive actions. The naming is uniform and predictable throughout the set.

Tool Count5/5

Four tools are well-scoped for a Minesweeper server, covering essential gameplay actions (click, flag, unflag) and game initialization (start_game). This count is appropriate and each tool earns its place without being excessive or insufficient.

Completeness5/5

The tool set provides complete coverage for basic Minesweeper operations: starting a game, interacting with cells (clicking and flagging), and managing flags (unflagging). There are no obvious gaps for the core gameplay loop.

Maintenance

ActivityInactive
ResponsivenessNo issues