MCP Constraint Solver
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
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
Maintainer
Works with
Installation
NPM
npx -y mcp-solverManual Installation
npx -y mcp-solverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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-solverCreate 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]"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-...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-aspConfigure your MCP client
Add the server to your MCP client configuration. Point to the installed script and pass the desired backend command.
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.mznMCP 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.
MCP Constraint Solver Alternatives — Similar Developer Tools Servers
Looking for alternatives to MCP Constraint Solver? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up MCP Constraint Solver in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.