
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

An MCP server that exposes mathematical optimization tools built on PuLP and OR-Tools, supporting STDIO and SSE transport for MCP clients.
A mathematical optimization MCP server is cataloged as an MCP server attributed to dmitryanchikov. An MCP server that exposes mathematical optimization tools built on PuLP and OR-Tools, supporting STDIO and SSE transport for MCP clients. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for A mathematical optimization MCP server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
README.md · 65db22317115 · Fetched 2026-11-13 13:53:56 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
🚀 Mathematical Optimization MCP Server with PuLP and OR-Tools support
📖 Quick Links: 🚀 Quick Start | 🔧 macOS Troubleshooting | 📊 Examples | 🎯 Features
Most stable method with full functionality
# Run with STDIO transport (for MCP clients)
docker run --rm -i ghcr.io/dmitryanchikov/mcp-optimizer:latest
# Run with SSE transport (for remote clients)
docker run -d -p 8000:8000 -e TRANSPORT_MODE=sse \
ghcr.io/dmitryanchikov/mcp-optimizer:latest
# Check SSE endpoint
curl -i http://localhost:8000/sse
Standard approach
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# or .venv\Scripts\activate # Windows
# Install mcp-optimizer
pip install mcp-optimizer
# For SSE issues, use stable dependency versions:
# pip install "mcp-optimizer[stable]"
# Run (STDIO mode recommended)
mcp-optimizer --transport stdio
# Linux/Windows - works out of the box
uvx mcp-optimizer
# macOS - requires Python 3.12
uvx --python python3.12 mcp-optimizer
# STDIO mode recommended
uvx mcp-optimizer --transport stdio
macOS users: If you encounter OR-Tools related errors, see 🔧 macOS uvx Troubleshooting section for automated fix scripts.
OR-Tools support:
For full OR-Tools support via pip:
# Install OR-Tools via Homebrew
brew install or-tools
# Then install mcp-optimizer
pip install "mcp-optimizer[stable]"
| Installation Method | Recommended Transport | Why |
|---|---|---|
| Docker | SSE | Full stability |
| pip + venv | STDIO | Avoids dependency issues with newer versions |
| uvx | STDIO | Maximum compatibility |
Option 1: Using Docker (Recommended)
docker pull ghcr.io/dmitryanchikov/mcp-optimizer:latest
claude_desktop_config.json:{
"mcpServers": {
"mcp-optimizer": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"ghcr.io/dmitryanchikov/mcp-optimizer:latest",
"python", "main.py"
]
}
}
}
Option 2: Using pip + venv
# Create virtual environment and install
python -m venv .venv
source .venv/bin/activate # Linux/macOS
pip install mcp-optimizer
Then add to your Claude Desktop config:
{
"mcpServers": {
"mcp-optimizer": {
"command": "mcp-optimizer"
}
}
}
Option 3: Using uvx
Add to your claude_desktop_config.json:
{
"mcpServers": {
"mcp-optimizer": {
"command": "uvx",
"args": ["mcp-optimizer"]
}
}
}
Note: On macOS, uvx provides limited functionality (PuLP solver only) or see 🔧 macOS uvx Troubleshooting
Advanced Docker Setup (for remote MCP clients)
# Run SSE server on port 8000 (uses environment variable)
docker run -d -p 8000:8000 -e TRANSPORT_MODE=sse \
ghcr.io/dmitryanchikov/mcp-optimizer:latest
# Or with CLI argument and custom port
docker run -d -p 9000:9000 ghcr.io/dmitryanchikov/mcp-optimizer:latest \
python -m mcp_optimizer.main --transport sse --host 0.0.0.0 --port 9000
# Check server status
docker logs <container-name>
# Verify SSE endpoint (should show event stream)
curl -i http://localhost:8000/sse
SSE Endpoint: http://localhost:8000/sse (Server-Sent Events for MCP communication)
{
"mcp.servers": {
"mcp-optimizer": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"ghcr.io/dmitryanchikov/mcp-optimizer:latest",
"python", "main.py"
]
}
}
}
Alternative configurations:
// Using pip installation
{
"mcp.servers": {
"mcp-optimizer": {
"command": "mcp-optimizer"
}
}
}
// Using uvx (limited functionality on macOS)
{
"mcp.servers": {
"mcp-optimizer": {
"command": "uvx",
"args": ["mcp-optimizer"]
}
}
}
For other MCP-compatible clients (Continue, Cody, etc.), use similar configuration patterns. Recommended priority:
# Clone the repository
git clone https://github.com/dmitryanchikov/mcp-optimizer.git
cd mcp-optimizer
# Install dependencies with uv
uv sync --extra dev
# Run the server
uv run python main.py
For testing and development, you can build the package locally and run it with uvx:
# Build the package locally
uv build
# Run with uvx from local wheel file
uvx --from ./dist/mcp_optimizer-0.3.9-py3-none-any.whl mcp-optimizer
# Or run with help to see available options
uvx --from ./dist/mcp_optimizer-0.3.9-py3-none-any.whl mcp-optimizer --help
# Test the local package with a simple MCP message
echo '{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0"}}, "id": 1}' | uvx --from ./dist/mcp_optimizer-0.3.9-py3-none-any.whl mcp-optimizer
Note: The local build creates both wheel (.whl) and source distribution (.tar.gz) files in the dist/ directory. The wheel file is recommended for uvx installation as it's faster and doesn't require compilation.
# Build locally with optimization
git clone https://github.com/dmitryanchikov/mcp-optimizer.git
cd mcp-optimizer
docker build -t mcp-optimizer:optimized .
docker run -p 8000:8000 mcp-optimizer:optimized
# Check optimized image size (398MB vs 1.03GB original - 61% reduction!)
docker images mcp-optimizer:optimized
# Test the optimized image
./scripts/test_docker_optimization.sh
# Run directly with uvx (no installation needed)
uvx mcp-optimizer
# Or run specific commands
uvx mcp-optimizer --help
# With pip installation
mcp-optimizer
# Or run with Python module (use main.py for stdio mode)
python main.py
MCP Optimizer supports two MCP transport protocols:
STDIO Transport (Default - for MCP clients like Claude Desktop)
# Default STDIO mode for MCP protocol
uvx mcp-optimizer
# or
uvx mcp-optimizer --transport stdio
# or
uv run python -m mcp_optimizer.main --transport stdio
# or
python main.py
SSE Transport (for remote MCP clients)
# SSE mode for remote MCP clients (default port 8000)
uvx mcp-optimizer --transport sse
# or
uv run python -m mcp_optimizer.main --transport sse
# Custom host and port
uvx mcp-optimizer --transport sse --host 0.0.0.0 --port 9000
# or
uv run python -m mcp_optimizer.main --transport sse --host 0.0.0.0 --port 9000
# With debug mode
uvx mcp-optimizer --transport sse --debug --log-level DEBUG
Available CLI Options
# Show all available options
uvx mcp-optimizer --help
# Options:
# --transport {stdio,sse} MCP transport protocol (default: stdio)
# --port PORT Port for SSE transport (default: 8000)
# --host HOST Host for SSE transport (default: 127.0.0.1)
# --debug Enable debug mode
# --reload Enable auto-reload for development
# --log-level {DEBUG,INFO,WARNING,ERROR} Logging level (default: INFO)
#
# Environment Variables:
# TRANSPORT_MODE={stdio,sse} Override transport mode
# SERVER_HOST=0.0.0.0 Override server host
# SERVER_PORT=8000 Override server port
✅ Full Functionality:
brew install or-tools && pip install mcp-optimizerpython -m venv venv && source venv/bin/activate && pip install ortools mcp-optimizer⚠️ Limited Functionality:
Common Issues & Solutions:
OR-Tools "Library not loaded" error:
# Solution: Install via Homebrew
brew install or-tools
# Then use regular pip/venv instead of uvx
uvx shows OR-Tools warnings:
WARNING: OR-Tools not available: No module named 'ortools'
This is expected - uvx provides fallback functionality with PuLP solver.
Best practices for macOS:
✅ Full Functionality:
| Platform | uvx | pip | Docker |
|---|---|---|---|
| macOS | PuLP only | ✅ Full | ✅ Full |
| Linux | ✅ Full | ✅ Full | ✅ Full |
| Windows | ✅ Full | ✅ Full | ✅ Full |
Solver Features:
Common Error Messages:
Library not loaded: /Users/corentinl/work/stable/temp_python3.13/lib/libscip.9.2.dylib
ImportError: No module named 'ortools'
WARNING: OR-Tools not available
Root Cause: OR-Tools binary wheels contain hardcoded library paths that fail in uvx isolated environments. This is a macOS-specific issue due to how uvx isolates dependencies.
✅ Available with uvx + fallback (PuLP solver only):
❌ Lost with uvx (requires OR-Tools):
# Smart adaptive script - no hardcoded versions!
# Automatically detects your system libraries and Python versions
./scripts/fix_macos_uvx.sh
# Then uvx works with full functionality
uvx mcp-optimizer --transport stdio
# Install system dependencies
brew install or-tools scip
# Create symlink for hardcoded path
sudo mkdir -p /Users/corentinl/work/stable/temp_python3.13/lib/
sudo ln -sf /opt/homebrew/lib/libscip.9.2.dylib /Users/corentinl/work/stable/temp_python3.13/lib/libscip.9.2.dylib
# Test fix
uvx mcp-optimizer --help
# Install dependencies first
brew install or-tools
# Install package
pip install mcp-optimizer
mcp-optimizer
docker run -p 8000:8000 mcp-optimizer
Quick Testing:
# Test local package build and functionality
./scripts/test_local_package.sh
# Test Docker container build and functionality
./scripts/test_docker_container.sh
# Run comprehensive test suite (both package and Docker)
./scripts/test_all.sh
# Run only specific tests
./scripts/test_all.sh --skip-docker # Skip Docker tests
./scripts/test_all.sh --skip-package # Skip package tests
Manual Testing:
# Run simple functionality tests
uv run python tests/test_integration/comprehensive_test.py
# Run comprehensive integration tests
uv run python tests/test_integration/comprehensive_test.py
# Run all unit tests
uv run pytest tests/ -v
# Run with coverage
uv run pytest tests/ --cov=src/mcp_optimizer --cov-report=html
Test Scripts Features:
Requirements:
uv, curl, lsof, gtimeout/timeoutdocker + local requirementsbrew install coreutils (for gtimeout)CI/CD Integration:
# GitHub Actions example
- name: Test Package
run: ./scripts/test_local_package.sh
- name: Test Docker
run: ./scripts/test_docker_container.sh
from mcp_optimizer.tools.linear_programming import solve_linear_program
# Maximize 3x + 2y subject to:
# x + y <= 4
# 2x + y <= 6
# x, y >= 0
objective = {"sense": "maximize", "coefficients": {"x": 3, "y": 2}}
variables = {
"x": {"type": "continuous", "lower": 0},
"y": {"type": "continuous", "lower": 0}
}
constraints = [
{"expression": {"x": 1, "y": 1}, "operator": "<=", "rhs": 4},
{"expression": {"x": 2, "y": 1}, "operator": "<=", "rhs": 6}
]
result = solve_linear_program(objective, variables, constraints)
# Result: x=2.0, y=2.0, objective=10.0
from mcp_optimizer.tools.assignment import solve_assignment_problem
workers = ["Alice", "Bob", "Charlie"]
tasks = ["Task1", "Task2", "Task3"]
costs = [
[4, 1, 3], # Alice's costs for each task
[2, 0, 5], # Bob's costs for each task
[3, 2, 2] # Charlie's costs for each task
]
result = solve_assignment_problem(workers, tasks, costs)
# Result: Total cost = 5.0 with optimal assignments
from mcp_optimizer.tools.knapsack import solve_knapsack_problem
items = [
{"name": "Item1", "weight": 10, "value": 60},
{"name": "Item2", "weight": 20, "value": 100},
{"name": "Item3", "weight": 30, "value": 120}
]
result = solve_knapsack_problem(items, capacity=50)
# Result: Total value = 220.0 with optimal item selection
from mcp_optimizer.tools.financial import optimize_portfolio
assets = [
{"name": "Stock A", "expected_return": 0.12, "risk": 0.18},
{"name": "Stock B", "expected_return": 0.10, "risk": 0.15},
{"name": "Bond C", "expected_return": 0.06, "risk": 0.08}
]
result = optimize_portfolio(
assets=assets,
objective="minimize_risk",
budget=10000,
risk_tolerance=0.15
)
# Result: Optimal portfolio allocation with minimized risk
mcp-optimizer/
├── LICENSE # MIT License
├── README.md # Project documentation
├── CHANGELOG.md # Release notes
├── CONTRIBUTING.md # Contribution guidelines
├── pyproject.toml # Python project configuration
├── uv.lock # Dependency lock file
├── main.py # Entry point
├── Dockerfile # Main Docker configuration
├── docker-compose.yml # Multi-service setup
├── .dockerignore # Docker ignore rules
├── .gitignore # Git ignore rules
├── .python-version # Python version specification
├── src/mcp_optimizer/ # Main source code
│ ├── __init__.py
│ ├── __main__.py # Module entry point
│ ├── main.py # Application entry point
│ ├── mcp_server.py # MCP server implementation
│ ├── config.py # Configuration management
│ ├── tools/ # 9 categories of optimization tools
│ │ ├── linear_programming.py
│ │ ├── assignment.py
│ │ ├── knapsack.py
│ │ ├── routing.py
│ │ ├── scheduling.py
│ │ ├── financial.py
│ │ └── production.py
│ ├── solvers/ # PuLP and OR-Tools integration
│ │ ├── pulp_solver.py
│ │ └── ortools_solver.py
│ ├── schemas/ # Pydantic validation schemas
│ └── utils/ # Utility functions
├── tests/ # Comprehensive test suite
│ ├── test_tools/ # Tool-specific tests
│ ├── test_solvers/ # Solver tests
│ └── test_integration/ # Integration tests
├── scripts/ # Automation scripts
├── examples/ # Usage examples and prompts
│ ├── en/ # English examples
│ └── ru/ # Russian examples
├── k8s/ # Kubernetes deployment manifests
└── monitoring/ # Grafana/Prometheus setup
└── grafana/
└── datasources/
🧪 Starting Comprehensive MCP Optimizer Tests
==================================================
✅ Server Health PASSED
✅ Linear Programming PASSED
✅ Assignment Problems PASSED
✅ Knapsack Problems PASSED
✅ Routing Problems PASSED
✅ Scheduling Problems PASSED
✅ Financial Optimization PASSED
✅ Production Planning PASSED
✅ Performance Test PASSED
📊 Test Results: 9 passed, 0 failed
🎉 All tests passed! MCP Optimizer is ready for production!
# Build image
docker build -t mcp-optimizer .
# Run container
docker run -p 8000:8000 mcp-optimizer
# Deploy to Kubernetes
kubectl apply -f k8s/
# Start monitoring stack
docker-compose up -d
✅ PRODUCTION READY 🚀
The examples/ directory contains practical examples and prompts for using MCP Optimizer with Large Language Models (LLMs):
Each example includes:
Function Exports - Added exportable functions to all tool modules:
solve_linear_program() in linear_programming.pysolve_assignment_problem() in assignment.pysolve_knapsack_problem() in knapsack.pyoptimize_portfolio() in financial.pyoptimize_production() in production.pyEnhanced Testing - Updated comprehensive test suite with correct function signatures
OR-Tools Integration - Confirmed full functionality of all OR-Tools components
The project uses a fully automated release process:
# For minor release (auto-increment)
uv run python scripts/release.py --type minor
# For specific version
uv run python scripts/release.py 0.2.0
# For hotfix
uv run python scripts/release.py --hotfix --type patch
# Preview changes
uv run python scripts/release.py --type minor --dry-run
# Create PR: release/v0.3.0 → main
gh pr create --base main --head release/v0.3.0 --title "Release v0.3.0"
After PR merge, automatically happens:
NO NEED to run manual_finalize_release.py manually anymore!
🔒 Secure Detection: Uses hybrid approach combining GitHub branch protection with automated release detection. See Release Process for details.
The CI/CD pipeline automatically handles:
release/* branchesmainThe GitHub Actions workflow automatically:
PYPI_API_TOKEN secret in GitHub repositoryUse the debug script to inspect MCP server structure:
# Run debug tools to check server structure
uv run python scripts/debug_tools.py
# This will show:
# - Available MCP tools
# - Tool types and attributes
# - Server configuration
Run the full integration test suite:
# Run comprehensive tests
uv run python tests/test_integration/comprehensive_test.py
# This tests:
# - All optimization tools (9 categories)
# - Server health and functionality
# - Performance benchmarks
# - End-to-end workflows
# Standard build
docker build -t mcp-optimizer:latest .
# Build with development dependencies
docker build --build-arg ENV=development -t mcp-optimizer:dev .
# Build with cache mount for faster rebuilds
docker build --mount=type=cache,target=/build/.uv -t mcp-optimizer .
# Check image size
docker images mcp-optimizer
# Run container
docker run -p 8000:8000 mcp-optimizer:latest
# For development with volume mounting
docker run -p 8000:8000 -v $(pwd):/app mcp-optimizer:latest
# Test container functionality
docker run --rm mcp-optimizer:latest python -c "from mcp_optimizer.mcp_server import create_mcp_server; print('✅ MCP Optimizer works!')"
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project follows a standard Git Flow workflow:
develop branchmain branchmain and develop branches📚 Documentation:
# Clone and setup
git clone https://github.com/dmitryanchikov/mcp-optimizer.git
cd mcp-optimizer
# Create feature branch from develop
git checkout develop
git checkout -b feature/your-feature-name
# Install dependencies
uv sync --extra dev
# Run tests
uv run pytest tests/ -v
# Run linting
uv run ruff check src/
uv run mypy src/
# Create PR to develop branch (not main!)
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the optimization community
The MCP Optimizer Docker image has been optimized to balance functionality and size:
| Component | Size | % of Total | Description |
|---|---|---|---|
| Python packages (/venv) | 237.0 MB | 42.8% | Virtual environment with dependencies |
| System libraries (/usr) | 173.2 MB | 31.3% | Base Debian system + Python |
| Other | 137.4 MB | 24.8% | Base image, filesystem |
| Configuration (/var, /etc) | 6.2 MB | 1.1% | System settings |
| Application code (/code) | 0.2 MB | 0.04% | MCP Optimizer source code |
[examples] extra[examples] extra for additional demo functionalityClaim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for A mathematical optimization MCP server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mcp-optimizer)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.