loading…
Search for a command to run...
loading…
Enables solving constraint satisfaction problems, mathematical equations, and logic puzzles using the Z3 SMT solver through natural language.
Enables solving constraint satisfaction problems, mathematical equations, and logic puzzles using the Z3 SMT solver through natural language.
A Model Context Protocol (MCP) server that provides SMT (Satisfiability Modulo Theories) solving capabilities using the Z3 theorem prover. This server allows Claude and other MCP clients to solve complex constraint satisfaction problems, mathematical equations, logic puzzles, and optimization problems.
git clone <repository-url>
cd z3-mcp-server
uv sync
Or with pip:
pip install z3-solver mcp
chmod +x src/z3_mcp_server/main.py
Add the server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"z3-solver": {
"command": "uv",
"args": ["--directory", "/path/to/z3-mcp-server", "run", "main.py"],
"env": {}
}
}
}
Once configured, you can ask Claude to solve various types of problems:
Age Problems:
"Joey is 20 years younger than Becky. In two years, Becky will be twice as old as Joey. How old are they?"
Algebra:
"Find integers x and y such that 2x + 3y = 17 and both are positive."
Logic Puzzles:
"Three people have ages 21, 22, and 23. Alice is not 21, and Bob is older than Alice. What are their ages?"
Optimization:
"A farmer has 100 feet of fencing. What rectangular dimensions maximize the enclosed area?"
solve_smt_lib2Solves constraint problems specified in SMT-LIB2 format.
Parameters:
problem (string): The constraint problem in SMT-LIB2 syntaxReturns:
sat + model if satisfiableunsat if no solution existsunknown if solver cannot determineExample SMT-LIB2 Input:
(declare-const x Int)
(declare-const y Int)
(assert (= (+ x y) 10))
(assert (= (* x y) 21))
(check-sat)
(get-model)
(declare-const name Type) - Declare a variable(assert condition) - Add a constraint(check-sat) - Check if constraints are satisfiable(get-model) - Get variable assignments (if sat)Int - IntegersReal - Real numbersBool - Boolean values+, -, *, /, mod=, <, >, <=, >=and, or, notdistinct (all different)Currently supports:
Planned:
Run the server directly in the Inspector:
npx @modelcontextprotocol/inspector src/z3_mcp_server/main.py uv --directory /path/to/z3-mcp-server run main.py
Contributions are welcome! Please:
Выполни в терминале:
claude mcp add z3-solver-mcp-server -- npx Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development