MCP Constraint Solver

v1.0.0Developer Toolsstable

An MCP server that enables Large Language Models to interactively create, edit, and solve constraint models using backends like MiniZinc, Z3, PySAT, and Clingo. It bridges natural language with symbolic reasoning for solving complex logical, SAT, SMT

mcp-solvermcpai-integration
Share:
169
Stars
0
Downloads
0
Weekly
0/5

What is MCP Constraint Solver?

MCP Constraint Solver is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server that enables large language models to interactively create, edit, and solve constraint models using backends like minizinc, z3, pysat, and clingo. it bridges natural language with symbolic ...

An MCP server that enables Large Language Models to interactively create, edit, and solve constraint models using backends like MiniZinc, Z3, PySAT, and Clingo. It bridges natural language with symbolic reasoning for solving complex logical, SAT, SMT

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • An MCP server that enables Large Language Models to interact

Use Cases

Solve constraint models (MiniZinc, Z3)
SAT/SMT solving
Logic program synthesis
szeider

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y mcp-solver

Manual Installation

npx -y mcp-solver

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP Constraint Solver

MCP Solver is a Model Context Protocol server that bridges natural language and formal symbolic reasoning by exposing constraint solving, SAT, SMT, and Answer Set Programming capabilities directly to LLMs. It supports multiple backends — MiniZinc for constraint models, Z3 for SMT solving, PySAT for propositional SAT, and Clingo for logic programs — letting AI assistants interactively build and solve complex combinatorial and logical problems. Developers and researchers use it to tackle scheduling, planning, verification, and combinatorial optimization tasks that would be impractical to solve with pure language models alone.

Prerequisites

  • Python 3.10 or later with uv package manager installed
  • At least one solver backend: MiniZinc (for mzn mode), Z3 (pip install z3-solver), PySAT, or Clingo
  • ANTHROPIC_API_KEY environment variable set if using Claude as the driving LLM
  • An MCP-compatible client such as Claude Desktop or a custom MCP host
1

Clone the repository

Clone the mcp-solver repository from GitHub to get the full source code and example problems.

git clone https://github.com/szeider/mcp-solver.git
cd mcp-solver
2

Create a virtual environment and install dependencies

Use uv to create an isolated environment. The [all] extra installs all solver backends at once.

uv venv
source .venv/bin/activate
uv pip install -e ".[all]"
3

Set your API key

MCP Solver uses an LLM to drive the interactive solving loop. Set ANTHROPIC_API_KEY (or your chosen provider's key) in a .env file or as an environment variable.

export ANTHROPIC_API_KEY=sk-ant-...
4

Start the solver for your chosen backend

Each backend has its own entry-point command. Choose the one matching the type of problem you want to solve.

# MiniZinc constraint models
mcp-solver-mzn

# Z3 SMT solving
mcp-solver-z3

# PySAT propositional SAT
mcp-solver-pysat

# Answer Set Programming with Clingo
mcp-solver-asp
5

Configure your MCP client

Add the server to your MCP client configuration. Point to the installed script and pass the desired backend command.

6

Verify with a test problem

Use the built-in test runner to confirm the solver is working correctly before connecting it to your AI client.

uv run run-test mzn --problem tests/n_queens.mzn

MCP Constraint Solver Examples

Client configuration

Add mcp-solver to Claude Desktop using the MiniZinc backend. Adjust the path to your virtual environment and choose the appropriate solver command.

{
  "mcpServers": {
    "mcp-solver": {
      "command": "/path/to/mcp-solver/.venv/bin/mcp-solver-mzn",
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-..."
      }
    }
  }
}

Prompts to try

Ask Claude to define and solve constraint problems interactively using the exposed tools (clear_model, add_item, solve_model, etc.).

- "Solve a 8-queens problem using MiniZinc — place 8 queens on a chessboard so none attack each other"
- "Use Z3 to verify that the formula (x > 0 AND x < 5 AND x = 3) is satisfiable and find a model"
- "Use the ASP backend to find all valid 3-colorings for a small graph with 5 nodes"
- "Schedule 6 tasks across 3 workers with the given precedence constraints using MiniZinc"

Troubleshooting MCP Constraint Solver

Backend solver not found when running mcp-solver-mzn

Ensure MiniZinc is installed and on your PATH. Download it from minizinc.org and confirm with `minizinc --version`. For Z3, run `pip install z3-solver` inside the virtual environment.

LLM API key errors during interactive solving

The solver uses an LLM internally for the interactive loop. Verify ANTHROPIC_API_KEY (or the key for your chosen provider) is exported in the shell or placed in a .env file at the project root.

solve_model times out on large problems

The solve_model tool accepts a timeout parameter in seconds. Pass a higher timeout value when calling it, or simplify/relax the model constraints to reduce search space.

Frequently Asked Questions about MCP Constraint Solver

What is MCP Constraint Solver?

MCP Constraint Solver is a Model Context Protocol (MCP) server that mcp server that enables large language models to interactively create, edit, and solve constraint models using backends like minizinc, z3, pysat, and clingo. it bridges natural language with symbolic reasoning for solving complex logical, sat, smt It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP Constraint Solver?

Install via npm with the command: npx -y mcp-solver. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with MCP Constraint Solver?

MCP Constraint Solver works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP Constraint Solver free to use?

Yes, MCP Constraint Solver is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-solver": { "command": "npx", "args": ["-y", "mcp-solver"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP Constraint Solver?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides