MCP-OR工具
使用 Google OR-Tools 进行约束求解的模型上下文协议 (MCP) 服务器实现。该实现旨在通过标准化约束模型规范与大型语言模型配合使用。
概述
MCP-ORTools 通过模型上下文协议将 Google 的 OR-Tools 约束编程求解器与大型语言模型相集成,使 AI 模型能够:
提交并验证约束模型
设置模型参数
解决约束满足和优化问题
检索和分析解决方案
安装
安装软件包:
配置 Claude Desktop 在
%APPDATA%\Claude\claude_desktop_config.json
(Windows) 或~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) 创建配置文件:
型号规格
模型以 JSON 格式指定,包含三个主要部分:
variables
:定义变量及其域constraints
:使用 OR-Tools 方法的约束列表objective
:可选优化目标
约束语法
约束必须使用 OR-Tools 方法语法:
.__le__()
表示小于或等于 (<=).__ge__()
表示大于或等于 (>=).__eq__()
表示相等 (==).__ne__()
表示不等于 (!=)
使用示例
简单优化模型
背包问题
示例:选择值为 [3,1,2,1]、权重为 [2,2,1,1] 的项目,总权重限制为 2。
附加约束示例:
特征
全面支持 OR-Tools CP-SAT 求解器
基于 JSON 的模型规范
支持:
整数和布尔变量(域:[最小值,最大值])
使用 OR-Tools 方法语法的线性约束
线性优化目标
超时和求解器参数
二元约束和关系
投资组合选择问题
背包问题
约束中支持的操作
基本算术:+、-、*
比较: .乐(),.格(),.等式(), .讷()
变量的线性组合
通过约束组合的二进制逻辑
发展
开发设置:
模型响应格式
求解器以 JSON 格式返回解决方案:
状态值:
最佳:找到最佳解决方案
可行:找到可行的解决方案
不可行:不存在解决方案
未知:无法确定解决方案
执照
MIT 许可证 - 详情请参阅许可证文件
This server cannot be installed
MCP-ORTools 通过 MCP 将 Google 的 OR-Tools 约束编程求解器与大型语言模型相集成,使 AI 模型能够:
提交并验证约束模型 设置模型参数 解决约束满足和优化问题 检索并分析解决方案
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 -27
- -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 -96MIT 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.
- -securityFlicense-qualityA service that converts OpenAPI specifications into MCP tools, enabling AI assistants to interact with your API endpoints through natural language.Last updated -