SO

Solver

Created 6 months ago

A Model Context Protocol (MCP) server that exposes SAT, SMT and constraint solving capabilities to Large Language Models.

development documentation public MCP constraint solving

What is Solver?

Solves constraint satisfaction and optimization problems .

Documentation

Overview

The MCP Solver integrates SAT, SMT and Constraint Solving with LLMs through the Model Context Protocol, enabling AI models to interactively create, edit, and solve:

  • Constraint models in MiniZinc
  • SAT models in PySAT
  • MaxSAT optimization problems in PySAT
  • SMT formulas in Z3 Python

For a detailed description of the MCP Solver's system architecture and theoretical foundations, see the accompanying research paper: Stefan Szeider, "MCP-Solver: Integrating Language Models with Constraint Programming Systems", arXiv:2501.00539, 2024.

Available Tools

Tool Name Description
clear_model Remove all items from the model
add_item Add new item at a specific index
delete_item Delete item at index
replace_item Replace item at index
get_model Get current model content with numbered items
solve_model Solve the model (with timeout parameter)

System Requirements

  • Python and project manager uv
  • Python 3.11+
  • Mode-specific requirements: MiniZinc, PySAT, Python Z3 (required packages are installed via pip)
  • Operating systems: macOS, Windows, Linux (with appropriate adaptations)

Installation

MCP Solver requires Python 3.11+, the uv package manager, and solver-specific dependencies (MiniZinc, Z3, or PySAT). For detailed installation instructions for Windows, macOS, and Linux, see INSTALL.md.

Available Modes / Solving Backends

The MCP Solver provides four distinct operational modes, each integrating with a different constraint solving backend. Each mode requires specific dependencies and offers unique capabilities for addressing different classes of problems.

MiniZinc Mode

MiniZinc mode provides integration with the MiniZinc constraint modeling language with the following features:

  • Rich constraint expression with global constraints
  • Integration with the Chuffed constraint solver
  • Optimization capabilities
  • Access to solution values via get_solution

Dependencies: Requires the minizinc package

PySAT Mode

PySAT mode allows interaction with the Python SAT solving toolkit with the following features:

  • Propositional constraint modeling using CNF (Conjunctive Normal Form)
  • Access to various SAT solvers (Glucose3, Glucose4, Lingeling, etc.)
  • Cardinality constraints (at_most_k, at_least_k, exactly_k)
  • Support for boolean constraint solving

Dependencies: Requires the python-sat package

MaxSAT Mode

MaxSAT mode provides specialized support for optimization problems with PySAT, featuring:

  • Weighted Conjunctive Normal Form (WCNF) support
  • Integration with the RC2 MaxSAT solver
  • Optimization capabilities with objective tracking
  • Support for both hard and soft constraints

Dependencies: Requires the python-sat package

Z3 Mode

Z3 mode provides access to Z3 SMT (Satisfiability Modulo Theories) solving capabilities with the following features:

  • Rich type system: booleans, integers, reals, bitvectors, arrays
  • Constraint solving with quantifiers
  • Optimization capabilities
  • Template library for common modeling patterns

Dependencies: Requires the z3-solver package

MCP Test Client

The MCP Solver includes an MCP client for development, experimentation, and diagnostic purposes, based on the ReAct agent framework. This client serves as an intermediary between an LLM and the MCP server, facilitating the translation of natural language problem statements into formal constraint programming solutions.

Feedback

You can provide feedback to the author via this form.

Server Config

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

Links & Status

Repository: github.com
Hosted: No
Global: No
Official: Yes

Project Info

Hosted Featured
Created At: May 23, 2025
Updated At: Aug 07, 2025
Author: Stefan Szeider
Category: community
License: MIT License
Tags:
development documentation public