mcp-solver

MCP.Pizza Chef: szeider

Six tools sit behind that request. One picks a solving engine and loads its modelling instructions, four drive a live Python workspace where the assistant writes and tests a real program, and the last submits that program once it passes a syntax check. You get the answer and the working program that produced it. Nothing here needs a paid account; the OpenRouter key mentioned in the readme applies only to the separate command-line runner. Version 4 is not published yet, so installing means cloning the project.

Coding
Data

Use This MCP server To

Work out a staff rota that satisfies everyone's stated constraints Plan seating where certain guests must not sit together Find the fewest boxes needed to pack an order list Check whether a set of rules can all hold at once Build a timetable that respects every room and staffing limit

README

MCP Solver

License: MIT Python Version

An MCP server for constraint solving (SAT, MaxSAT, SMT, CP, ASP, DP). It turns the connected LLM host into a solver-writing agent: the host gets a Python kernel preloaded with a real solver library, modeling instructions for the chosen backend, and a submission gate. The host encodes the problem, runs and verifies it against the real solver, and submits the final program — the outcome is the solution plus the verified solver program that produced it.

Version 4 is a complete re-architecture. Both the MCP interface and the solving engine changed; the design from the SAT 2025 paper (v3) lives on unchanged on the v3 branch. See From v3 to v4 below.

The MCP server

mcp-solver-serve runs over stdio and works with any MCP host: Claude Desktop, Claude Code, Cursor, or your own client. The host LLM does the solving itself — the server is a solver toolkit; it runs no LLM and needs no API key:

  • select_backend(solver) sets up a persistent IPython kernel with the backend's solver library and helper functions, and returns the modeling instructions for that backend. Calling it again recycles the kernel for the next problem.
  • Kernel tools (python_exec, python_reset, python_status, python_interrupt) let the host write, run, and verify a real solver program; bare python_exec calls are routed to the solving kernel automatically.
  • submit_code(code) is the finish line: the final self-contained program is syntax-checked and, on success, stored and linked back as an MCP resource (mcp-solver://submissions/{id}), with the verdict as structured content.
  • Resources: mcp-solver://guide (backend selection and workflow) and mcp-solver://template/{solver} (the full modeling instructions, browsable without selecting).
  • Statistics (optional): set MCP_SOLVER_STATS=/path/to/stats.jsonl in the server's env to log one JSON line per solving episode — tool-call counts, execution failures, submissions, wall time. Host tokens are invisible to the server by protocol design; tool usage is the comparable metric across hosts. (submit_code results also carry a compact stats snapshot as structured content; the CLI path reports tokens and actual OpenRouter cost via --stats-json.)

Claude Desktop configuration (once the PyPI name transfer completes — see Installation):

{
  "mcpServers": {
    "mcp-solver": {
      "command": "uvx",
      "args": ["--from", "mcp-solver[agent]", "mcp-solver-serve"]
    }
  }
}

From a checkout (the working setup today, and the development path always):

{
  "mcpServers": {
    "mcp-solver": {
      "command": "uv",
      "args": ["run", "--project", "/path/to/mcp-solver", "mcp-solver-serve"]
    }
  }
}

The server needs no API key — the model doing the solving belongs to the host. An OpenRouter key is required only for the command-line path below, which brings its own agent.

mcp-solver FAQ

Do I have to pay for anything?
Not for the assistant side, which uses the model you already have. The paid OpenRouter account in the readme is only for the separate command-line runner, which brings its own model along.
How many tools does it add?
Six. One chooses the solving engine, four run and reset a live Python workspace, and one submits the finished program.
Can I use this to plan a timetable or rota?
Yes, that is exactly what it is for, along with seating plans, packing, routing and anything else you can state as a list of rules.
Which apps does it work in?
Any assistant that starts a local helper, including Claude Desktop, Claude Code and Cursor.
How hard is the setup?
Harder than most listings here. Version 4 is not on the usual package index yet, so you clone the project by hand and need Python 3.13 and the uv tool already installed.
Does it run code on my computer?
Yes. Your assistant writes Python and runs it in a workspace on your own machine, and the command-line runner also drops the finished program and a run log into the folder you started it from.
Is the answer just a guess from the model?
No. The program is executed against a genuine solver library and checked before submission, so you can read the reasoning rather than trust it.