Minesweeper MCP Server
A Model Context Protocol (MCP) server that provides Minesweeper game functionality. Users can create custom-sized Minesweeper boards and play the classic game through AI assistants.
Features
- Custom Board Sizes: Create Minesweeper boards of any size (up to 50x50)
- Flexible Mine Count: Set any number of mines (within reasonable limits)
- Multiple Games: Manage multiple concurrent game boards
- Visual Display: ASCII art representation of the game board
- Game State Tracking: Win/loss detection and timing
- Cell Operations: Reveal cells, flag/unflag suspected mines
Installation
- Clone or download this repository
- Install dependencies:
- Build the TypeScript code:
- Start the server:
Available Tools
create_board
Create a new Minesweeper board with custom dimensions and mine count.
Parameters:
id
(string): Unique identifier for the boardwidth
(number): Number of columns (1-50)height
(number): Number of rows (1-50)mineCount
(number): Number of mines to place
Example:
reveal_cell
Reveal a cell on the board. If it's a mine, the game ends. If it's empty, adjacent cells may be automatically revealed.
Parameters:
boardId
(string): ID of the boardx
(number): Column coordinate (0-based)y
(number): Row coordinate (0-based)
Example:
flag_cell
Flag or unflag a cell as a suspected mine.
Parameters:
boardId
(string): ID of the boardx
(number): Column coordinate (0-based)y
(number): Row coordinate (0-based)
Example:
get_board
Display the current state of a board.
Parameters:
boardId
(string): ID of the board to display
list_boards
List all active game boards with their status.
Parameters: None
delete_board
Delete a game board.
Parameters:
boardId
(string): ID of the board to delete
Game Symbols
.
= Hidden cellF
= Flagged cell*
= Mine (revealed when game ends)1-8
= Number of neighboring mines
Example Game Flow
- Create a board:
- Start revealing cells:
- Flag suspected mines:
- Check board status:
- Continue until you win or hit a mine!
Game Rules
- Objective: Reveal all cells that don't contain mines
- Winning: Reveal all non-mine cells
- Losing: Reveal a cell containing a mine
- Numbers: Show count of mines in the 8 adjacent cells
- Flagging: Mark cells you suspect contain mines (prevents accidental revelation)
- Auto-reveal: When you reveal an empty cell (0 neighbors), all adjacent cells are automatically revealed
Development
Project Structure
Scripts
npm run build
- Compile TypeScript to JavaScriptnpm run dev
- Watch mode for developmentnpm start
- Run the compiled server
Integration with AI Assistants
This MCP server can be integrated with AI assistants that support the Model Context Protocol, such as Claude Desktop. The AI can help you:
- Create boards with optimal mine distributions
- Suggest strategic moves
- Analyze board patterns
- Track multiple games simultaneously
License
MIT License - feel free to use and modify as needed!
This server cannot be installed
Provides Minesweeper game functionality through the Model Context Protocol, allowing users to create and play custom-sized minesweeper boards through AI assistants.
Related MCP Servers
- AsecurityAlicenseAqualityThis server implements the Model Context Protocol to facilitate meaningful interaction and understanding development between humans and AI through structured tools and progressive interaction patterns.Last updated -1322TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server implementation that allows AI models to interact with and manage Spinnaker deployments, pipelines, and applications through a standardized interface.Last updated -14TypeScriptMIT License
- -securityFlicense-qualityAn MCP server that enables AI agents like Claude to play Minesweeper through natural language interaction, connecting to a separate Minesweeper game server.Last updated -80JavaScript
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants to perform advanced web scraping, crawling, searching, and data extraction through the Firecrawl API.Last updated -21,717MIT License