Show HN: 我构建了一个 MCP 服务器,让 Claude 能够玩扫雷游戏
该项目构建了一个 [Model Context Protocol server],允许 MCP 客户端代理玩扫雷游戏。它与 [Minesweeper game server] 配合使用。文章提供了启动服务器的指南,包括安装、构建和配置 [Claude Desktop] 的步骤,并展示了示例 Prompt 和交互过程。用户可以通过配置 [Claude Desktop] 的 `claude_desktop_config.json` 文件来添加该工具,从而让 [Claude] 能够玩扫雷游戏。
这是一个 Model Context Protocol server,它允许 MCP 客户端代理玩 Minesweeper 游戏。 它旨在与 Minesweeper game server 一起运行。
入门指南
-
按照游戏服务器的 instructions 在本地启动它。
-
构建 MCP 服务器:
npm install
npm run build
- 配置你的 MCP 客户端以添加该工具。 例如,以下是如何在 Windows 上的
claude_desktop_config.json
中将该工具添加到 Claude Desktop(locating the file),假设你已将 repo 克隆到C:\path\to\repo\minesweeper-mcp-server
:
{
"mcpServers": {
"mcp-server": {
"command": "node",
"args": ["C:\\path\\to\\repo\\minesweeper-mcp-server\\build\\index.js"],
"env": {
"DEBUG": "*"
}
}
}
}
- Claude Desktop:重新启动 Claude Desktop,使其获取工具。 确保从托盘菜单图标退出,而不是从应用程序(这只会隐藏窗口)。 如果你点击“工具”图标,它应该会显示新工具:
示例 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.
示例交互
实际对话非常长。 以下是一些片段:
游戏开始
在错误的位置放置旗帜
几次尝试后放弃
关于
一个用于玩扫雷游戏的 MCP 服务器。