MCP Z3 Prover
MCP server giving AI clients access to the Z3 SMT solver for constraint solving
- Pricing
- Open source
- Platforms
- CLI, API, Linux
- Runs
- Locally
- Version
- 0.1.0
- Listing updated
- today
Similar MCP servers
About MCP Z3 Prover
MCP Z3 Prover is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
The README describes a Python MCP server that wraps the Z3 solver API, so an AI client can declare integer, real and Boolean variables, add constraints as text expressions, and ask for a satisfying model. Solutions come back as status plus variable values, and an optimize tool handles objective-driven problems.
The workflow is stateful: variables and constraints accumulate in one solver instance until reset_solver clears it, and list_variables shows what has been declared. The README includes an integer factorization example in which the solver finds two odd factors of a given number, which illustrates the constraint syntax.
It suits developers and researchers who want an assistant to formulate and check logical or arithmetic problems rather than guess at answers. It is installed from PyPI and runs over stdio.
Install
Run in a terminal
claude mcp add mcp-z3-prover -- uvx mcp-z3-proverAdd to claude_desktop_config.json
{
"mcpServers": {
"mcp-z3-prover": {
"command": "uvx",
"args": [
"mcp-z3-prover"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-z3-prover": {
"command": "uvx",
"args": [
"mcp-z3-prover"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"mcp-z3-prover": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-z3-prover"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-z3-prover": {
"command": "uvx",
"args": [
"mcp-z3-prover"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp-z3-prover": {
"command": "uvx",
"args": [
"mcp-z3-prover"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
Tools this server provides (11)
Taken from the project documentation; the running server may differ.
- create_bool_var
- Create a Boolean variable
- create_int_var
- Create an Integer variable
- create_real_var
- Create a Real variable
- create_int_constant
- Create an integer constant
- create_real_constant
- Create a real constant
- add_constraint
- Add a constraint to the solver
- solve
- Solve the current problem
- get_model_value
- Get value of a variable from the model
- optimize
- Solve with optimization objective
- reset_solver
- Reset the solver state
- list_variables
- List all created variables
What it does
- Variable declaration tools
- Creates Boolean, integer and real variables and constants for use in a solver session.
- Constraint solving
- Adds constraints as expression strings and checks them with the solve tool.
- Model value retrieval
- Reads the assigned value of a specific variable from the solver model.
- Optimization objective
- Runs the optimize tool to solve with an objective function.
- Session reset and listing
- Clears solver state with reset_solver and lists declared variables with list_variables.
- Stdio transport
- Runs as a local process over stdio and installs with pip.
Good for
- Checking whether a set of arithmetic constraints has a solution
- Finding integer values that satisfy linear or modular conditions
- Letting an AI assistant verify logic puzzles with a solver
- Factoring small integers through constraint formulation
Pricing
Open source
Free and open source, installed from PyPI.
MCP Z3 Prover FAQ
How is the server installed?
The README says to install it with pip install mcp-z3-prover and run it with the mcp-z3-prover command or by importing mcp and calling run.
Which tools does it expose?
The README lists create_bool_var, create_int_var, create_real_var, create_int_constant, create_real_constant, add_constraint, solve, get_model_value, optimize, reset_solver and list_variables.
What license does it use?
The provided content does not state a license.
Is MCP Z3 Prover free?
Yes. MCP Z3 Prover is open source, so you can use and self-host it for free.
How do I add MCP Z3 Prover to Claude Code?
Run this command in your terminal: claude mcp add mcp-z3-prover -- uvx mcp-z3-prover
What are the best alternatives to MCP Z3 Prover?
The closest alternatives to MCP Z3 Prover are NEOMA P-CAM Physical AI & Ising MCP Server, Mathematica MCP, pyeconomics, Learning Model Context Protocol and MCPProxy.
Where this comes from
- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.
