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
Installation
- Install the package:
- Configure Claude Desktop
Create the configuration file at
%APPDATA%\Claude\claude_desktop_config.json
(Windows) or~/Library/Application Support/Claude/claude_desktop_config.json
(macOS):
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
Knapsack Problem
Example: Select items with values [3,1,2,1] and weights [2,2,1,1] with total weight limit of 2.
Additional constraints example:
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:
Model Response Format
The solver returns solutions in JSON format:
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
This server cannot be installed
MCP-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 solution
- Overview
- Installation
- Model Specification
- Usage Examples
- Features
- Development
- Model Response Format
- License
Related Resources
Related MCP Servers
- -securityFlicense-qualityProvides SEO automation with tools for keyword research, SERP analysis, and competitor analysis through Google Ads API integration, enabling AI assistants to access these capabilities via MCP.Last updated -20JavaScript
- -securityAlicense-qualityA Model Context Protocol (MCP) connector that allows AI agents to directly interact with Google Sheets, enabling creation, reading, and modification of spreadsheets through natural language.Last updated -77JavaScriptMIT License
- -securityFlicense-qualityA lightweight orchestration hub for managing local Model Context Protocol (MCP) tools in a unified way, allowing users to build, manage, and call their AI tools from IDEs, terminal, and custom assistants.Last updated -Python
- -securityFlicense-qualityA service that converts OpenAPI specifications into MCP tools, enabling AI assistants to interact with your API endpoints through natural language.Last updated -Python