Skip to main content
Glama
finnestprogrammer111

Pyramid Solver MCP

Pyramid Solver MCP

CI Deploy to Render

一个用于 4×4 滑动拼图的交互式求解器。它有两种工作模式:

  • 作为 MCP App 在 ChatGPT 内渲染;

  • 作为服务器根目录下的普通浏览器应用。

该项目使用 React 构建小部件,使用官方 Model Context Protocol SDK 构建服务器,并使用自包含的 Vite 构建,可将其作为 MCP UI 资源返回。

MCP 工具

工具

作用

open_pyramid_solver

打开空白交互式求解器。

solve_pyramid

逐行求解提供的 16 个方块位置。使用 0 表示空槽。

求解器提供快速加权 A* 和最优 IDA* 两种模式。

Related MCP server: boxoban-mcp

本地运行

要求:Node.js 20 或更高版本。

npm install
npm run build
npm start

打开 http://localhost:8787 进入浏览器模式。Streamable HTTP MCP 端点为:

http://localhost:8787/mcp

测试

npm test
npm run build
npm run smoke

您可以使用以下命令检查 MCP 服务器:

npx @modelcontextprotocol/inspector@latest

选择 Streamable HTTP 并连接到 http://localhost:8787/mcp。

部署到公共 URL

最快的路径是点击本 README 顶部的 Deploy to Render 按钮:

  1. 登录 Render 并允许其访问此 GitHub 仓库。

  2. 保留 Blueprint 设置并选择 Deploy Blueprint。

  3. 等待服务变为 Live 状态。

  4. 复制生成的 URL,例如 https://pyramid-solver-mcp.onrender.com。

  5. 检查 <your-url>/health 是否返回 {"ok":true}。

包含的 render.yaml 构建 Dockerfile,检查 /health,并且仅在 GitHub CI 通过后部署更改。Render 的免费服务在空闲后可能需要更长时间才能响应。

连接到 ChatGPT

ChatGPT 需要公共 HTTPS MCP 端点。部署后:

  1. 在 ChatGPT 中,打开 设置 → 安全与登录 → 开发者模式 并启用它。

  2. 打开 插件 并选择 + 按钮。

  3. 输入名称,例如 Pyramid Solver 和简短描述。

  4. 将端点设置为完整的 Render URL,以 /mcp 结尾,例如 https://pyramid-solver-mcp.onrender.com/mcp。

  5. 查看发现的工具并完成添加插件。

如果后续部署后工具定义发生变化,请刷新插件,以便 ChatGPT 加载新的元数据。有关当前界面,请参阅 OpenAI 的 Connect your MCP server to ChatGPT 指南。

连接后,尝试 Open the Pyramid Solver 或提供一张棋盘,例如:

1 2 3 4
5 6 7 8
9 10 11 12
13 14 0 15

有用的检查:

  • Open the Pyramid Solver.

  • Solve this board with A*: 1 2 3 4 / 5 6 7 8 / 9 10 11 12 / 13 14 0 15.

  • Solve this board optimally with IDA*: 1 2 3 4 / 5 6 7 8 / 9 10 11 12 / 13 14 0 15.

Docker

docker build -t pyramid-solver-mcp .
docker run --rm -p 8787:8787 pyramid-solver-mcp

项目结构

src/PyramidSolver.jsx  React interface
src/solver.js           A* and IDA* solver engine
src/mcpBridge.js        MCP Apps UI bridge
server.js               Streamable HTTP MCP server
test/solver.test.js     Solver tests

许可证

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables AI agents to solve Rubik's Cube puzzles through systematic manipulation with standard cube notation moves. Features real-time 3D visualization and interactive controls for tracking solving progress.
    4
    34 npm
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables users to load and solve Boxoban puzzles by providing tools to get game state, list valid moves, and take actions.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Standalone browser automation MCP server supporting both BrowserOS and standard Chrome. Enables 16 MCP tools for browser control including navigation, interaction, and content extraction.
    13 npm
    -