Pyramid Solver MCP
Pyramid Solver MCP
An interactive solver for the 4×4 sliding puzzle. It works in two modes:
as an MCP App rendered inside ChatGPT;
as a regular browser app at the server root.
The project uses React for the widget, the official Model Context Protocol SDK for the server, and a self-contained Vite build that can be returned as an MCP UI resource.
MCP tools
Tool | What it does |
| Opens the blank interactive solver. |
| Solves 16 tile positions supplied row by row. Use |
The solver offers fast Weighted A* and optimal IDA* modes.
Run locally
Requirements: Node.js 20 or newer.
npm install
npm run build
npm startOpen http://localhost:8787 for browser mode. The Streamable HTTP MCP endpoint is:
http://localhost:8787/mcpTest
npm test
npm run build
npm run smokeYou can inspect the MCP server with:
npx @modelcontextprotocol/inspector@latestChoose Streamable HTTP and connect to http://localhost:8787/mcp.
Deploy to a public URL
The quickest path is the Deploy to Render button at the top of this README:
Sign in to Render and allow it to access this GitHub repository.
Keep the Blueprint settings and choose Deploy Blueprint.
Wait for the service to become Live.
Copy the generated URL, such as
https://pyramid-solver-mcp.onrender.com.Check that
<your-url>/healthreturns{"ok":true}.
The included render.yaml builds the Dockerfile, checks /health, and deploys changes only after GitHub CI passes. Render's free service can take longer to answer after being idle.
Connect it to ChatGPT
ChatGPT requires a public HTTPS MCP endpoint. After deployment:
In ChatGPT, open Settings → Security and login → Developer mode and enable it.
Open Plugins and select the + button.
Enter a name such as
Pyramid Solverand a short description.Set the endpoint to your complete Render URL ending in
/mcp, for examplehttps://pyramid-solver-mcp.onrender.com/mcp.Review the discovered tools and finish adding the plugin.
If tool definitions change after a later deployment, refresh the plugin so ChatGPT loads the new metadata. See OpenAI's Connect your MCP server to ChatGPT guide for the current interface.
Once connected, try Open the Pyramid Solver or provide a board such as:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 0 15Useful checks:
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-mcpProject structure
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 testsLicense
MIT