MCP-ORTools
Provides integration with Google OR-Tools for solving constraint satisfaction and optimization problems through a modeling approach using JSON-based model specification.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP-ORToolsSolve a knapsack problem: values [3,1,2,1], weights [2,2,1,1], capacity 2"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-ORTools
A Model Context Protocol (MCP) server implementation using Google OR-Tools for constraint solving. Designed for use with Large Language Models through standardized constraint model specification.
Overview
MCP-ORTools integrates Google's OR-Tools constraint programming solver with Large Language Models through the Model Context Protocol, enabling AI models to:
Submit and validate constraint models
Set model parameters
Solve constraint satisfaction and optimization problems
Retrieve and analyze solutions
Related MCP server: MCP Optimizer
Installation
Install the package:
pip install git+https://github.com/Jacck/mcp-ortools.gitConfigure Claude Desktop Create the configuration file at
%APPDATA%\Claude\claude_desktop_config.json(Windows) or~/Library/Application Support/Claude/claude_desktop_config.json(macOS):
{
"mcpServers": {
"ortools": {
"command": "python",
"args": ["-m", "mcp_ortools.server"]
}
}
}Model Specification
Models are specified in JSON format with three main sections:
variables: Define variables and their domainsconstraints: List of constraints using OR-Tools methodsobjective: Optional optimization objective
Constraint Syntax
Constraints must use OR-Tools method syntax:
.__le__()for less than or equal (<=).__ge__()for greater than or equal (>=).__eq__()for equality (==).__ne__()for not equal (!=)
Usage Examples
Simple Optimization Model
{
"variables": [
{"name": "x", "domain": [0, 10]},
{"name": "y", "domain": [0, 10]}
],
"constraints": [
"(x + y).__le__(15)",
"x.__ge__(2 * y)"
],
"objective": {
"expression": "40 * x + 100 * y",
"maximize": true
}
}Knapsack Problem
Example: Select items with values [3,1,2,1] and weights [2,2,1,1] with total weight limit of 2.
{
"variables": [
{"name": "p0", "domain": [0, 1]},
{"name": "p1", "domain": [0, 1]},
{"name": "p2", "domain": [0, 1]},
{"name": "p3", "domain": [0, 1]}
],
"constraints": [
"(2*p0 + 2*p1 + p2 + p3).__le__(2)"
],
"objective": {
"expression": "3*p0 + p1 + 2*p2 + p3",
"maximize": true
}
}Additional constraints example:
{
"constraints": [
"p0.__eq__(1)", // Item p0 must be selected
"p1.__ne__(p2)", // Can't select both p1 and p2
"(p2 + p3).__ge__(1)" // Must select at least one of p2 or p3
]
}Features
Full OR-Tools CP-SAT solver support
JSON-based model specification
Support for:
Integer and boolean variables (domain: [min, max])
Linear constraints using OR-Tools method syntax
Linear optimization objectives
Timeouts and solver parameters
Binary constraints and relationships
Portfolio selection problems
Knapsack problems
Supported Operations in Constraints
Basic arithmetic: +, -, *
Comparisons: .le(), .ge(), .eq(), .ne()
Linear combinations of variables
Binary logic through combinations of constraints
Development
To setup for development:
git clone https://github.com/Jacck/mcp-ortools.git
cd mcp-ortools
pip install -e .Model Response Format
The solver returns solutions in JSON format:
{
"status": "OPTIMAL",
"solve_time": 0.045,
"variables": {
"p0": 0,
"p1": 0,
"p2": 1,
"p3": 1
},
"objective_value": 3.0
}Status values:
OPTIMAL: Found optimal solution
FEASIBLE: Found feasible solution
INFEASIBLE: No solution exists
UNKNOWN: Could not determine solution
License
MIT License - see LICENSE file for details
Available Tools
1 toolmcp-reasonerC
Advanced reasoning tool with multiple strategies including Beam Search and Monte Carlo Tree Search
| Name | Required | Description | Default |
|---|---|---|---|
| thought | Yes | Current reasoning step | |
| thoughtNumber | Yes | Current step number | |
| totalThoughts | Yes | Total expected steps | |
| nextThoughtNeeded | Yes | Whether another step is needed | |
| strategyType | No | Reasoning strategy to use (beam_search or mcts) | |
| beamWidth | No | Number of top paths to maintain (n-sampling). Defaults to 3 if not specified | |
| numSimulations | No | Number of MCTS simulations to run. Defaults to 50 if not specified |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does not disclose behavioral traits such as rate limits, idempotency, or side effects. The description only mentions 'advanced reasoning' without explaining what operations are performed or their implications.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, highly concise. It front-loads the core purpose. However, it may be too brief for the tool's complexity, but it is not verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (7 parameters, no output schema, no annotations), the description is insufficient. It does not explain the reasoning process, how strategies differ, or how the parameters like beamWidth and numSimulations interact. More context is needed for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% coverage with descriptions for all 7 parameters. The description adds no additional meaning beyond what the schema already provides. Baseline score of 3 is appropriate as the schema handles the semantics well.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool is for advanced reasoning with specific strategies (Beam Search, MCTS). It is specific about the resource and action, though not as precise as a verb+resource pairing. No siblings exist to differentiate from, so the description adequately distinguishes itself.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, no context on strategy selection, and no prerequisites or use cases. The sibling-tools list is empty, but the description should still offer usage suggestions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v2.0.0- First observed
mcp-reasoner
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion or overlap with other tools.
With a single tool, there is no inconsistency in naming patterns; the tool name is clear and descriptive.
The server name 'MCP-ORTools' suggests a comprehensive operations research toolkit, yet only one generic reasoning tool is provided, which is a severe mismatch in scope.
The server lacks any dedicated OR tools (e.g., solvers, optimizers), offering only a generic reasoning tool, making it severely incomplete for its purported domain.
Maintenance
Related MCP Connectors
Optimize crew and workforce schedules, resource allocation, and routing with linear and mixed-inte…
- mcpOAuthcom.crisphive
Field operations on a deterministic solver — run jobs, crews & fleet from Claude or ChatGPT.
FinOps for Google Cloud: size 1- and 3-year CUD commitments to known demand. Also solves LP/MIP.
Vehicle routing, 3-D packing, cutting stock, rostering and knapsack with OR-Tools. 7 of 11 free.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP-ORTools integrates Google's OR-Tools constraint programming solver with Large Language Models through the MCP, enabling AI models to: Submit and validate constraint models Set model parameters Solve constraint satisfaction and optimization problems Retrieve and analyze solution21MIT
- AlicenseNot gradedqualityDmaintenanceEnables solving linear programming (LP) and mixed-integer linear programming (MILP) optimization problems through natural language, with built-in simplex and branch-and-cut solvers plus infeasibility diagnostics. Includes optional OR-Tools fallback for larger problems and supports parsing optimization problems from natural language descriptions.MIT
- AlicenseAqualityDmaintenanceProvides constraint satisfaction and optimization capabilities to LLMs and AI agents for scheduling, resource allocation, routing, budget optimization, and configuration problems using Google OR-Tools CP-SAT solver.55Apache 2.0
- FlicenseBqualityDmaintenanceEnables AI assistants to solve linear, integer, mixed-integer, and knapsack optimization problems using Google OR-Tools via a simple JSON interface.3-