# MCP Z3 Prover

> MCP Z3 Prover is an open-source MCP server for developer tools. MCP server giving AI clients access to the Z3 SMT solver for constraint solving. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Linux, macOS, Windows
- **Repository:** https://github.com/daedalus/mcp-z3-prover
- **MCP Registry name:** io.github.daedalus/mcp-z3-prover
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp-z3-prover -- uvx mcp-z3-prover
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-z3-prover": {
      "command": "uvx",
      "args": [
        "mcp-z3-prover"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-z3-prover": {
      "command": "uvx",
      "args": [
        "mcp-z3-prover"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp-z3-prover": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-z3-prover"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-z3-prover": {
      "command": "uvx",
      "args": [
        "mcp-z3-prover"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-z3-prover": {
      "command": "uvx",
      "args": [
        "mcp-z3-prover"
      ]
    }
  }
}
```

## Tools

- `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

## 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.

## Alternatives

- [NEOMA P-CAM Physical AI & Ising MCP Server](https://ai-powered.com/mcp/neoma-p-cam-physical-ai-and-ising-mcp-server): NEOMA P-CAM Physical AI & Ising MCP Server is a freemium MCP server for developer tools.
- [Mathematica MCP](https://ai-powered.com/mcp/mathematica-mcp): Mathematica MCP is an open-source MCP server for developer tools.
- [pyeconomics](https://ai-powered.com/mcp/pyeconomics): pyeconomics is an open-source MCP server for finance and payments.
- [Learning Model Context Protocol](https://ai-powered.com/mcp/learning-model-context-protocol): Learning Model Context Protocol is an open-source MCP server for ai models and llm tooling.
- [MCPProxy](https://ai-powered.com/mcp/mcpproxy): MCPProxy is an open-source MCP server for developer tools.
- [python-sdk](https://ai-powered.com/mcp/python-sdk): python-sdk is an open-source MCP server for developer tools.
- [Algenta MCP Server](https://ai-powered.com/mcp/algenta-mcp-server): Algenta MCP Server is a freemium MCP server for developer tools.
- [MCP Server Commands](https://ai-powered.com/mcp/mcp-server-commands): MCP Server Commands is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/mcp-z3-prover
