home / mcp / ortools mcp server

ORTools MCP Server

Provides a constraint solving service using Google's OR-Tools for CP-SAT problems accessible to AI models via the MCP interface.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jacck-mcp-ortools": {
      "command": "python",
      "args": [
        "-m",
        "mcp_ortools.server"
      ]
    }
  }
}

You can run an MCP server that leverages Google's OR-Tools constraint solver to model, validate, solve, and analyze constraint problems. This server lets you submit constraint models in JSON, adjust solver parameters, and retrieve optimal or feasible solutions for planning, knapsack, scheduling, and other combinatorial problems, all integrated with supported MCP clients.

How to use

You will connect to the MCP server from your MCP client and perform these practical steps: define your constraint model in JSON, specify variables and domains, create constraints using OR-Tools notation, and optionally set an optimization objective. You send the model to the server, request a solution, and read back the status, variable assignments, and objective value. If a problem has multiple feasible solutions, you can request an optimal solution by enabling the maximize or minimize setting in the objective. Timeouts and solver parameters help you balance speed and accuracy.

How to install

Prerequisites: you need Python and access to install Python packages. You may also install and run an MCP client that communicates with the server.

Step 1: Install the MCP OrtTools server package

pip install git+https://github.com/Jacck/mcp-ortools.git

Configure and run the MCP server locally

Create a local runtime configuration that tells your MCP client how to start the OrtTools MCP server. The server runs as a local process using Python and the module entry point.

{
  "mcpServers": {
    "ortools": {
      "command": "python",
      "args": ["-m", "mcp_ortools.server"]
    }
  }
}

Available tools

submitModel

Submit a constraint model to the MCP server. The model includes variables, constraints, and an optional objective, and the server validates and prepares it for solving.

validateModel

Validate the submitted model to ensure syntax and domain consistency before solving. This helps catch errors early in the workflow.

solveModel

Trigger the solver to find a feasible or optimal solution for the given model using CP-SAT, returning status, objective value, and variable assignments.

retrieveSolutions

Retrieve computed solution details, including variable values and solve time, after a model has been solved.