Offers containerized deployment options for the MCP server with both STDIO and SSE transport methods, facilitating easy installation and deployment
Provides integration with GitHub for version control, release management, and issue tracking through automated workflows
Uses GitHub Actions for CI/CD pipeline, automating testing, security scanning, building Docker images, and publishing to PyPI
Integrates with Grafana for visualization of metrics and monitoring data from the MCP server
Supports deployment to Kubernetes environments for production use, with provided configuration files in the k8s directory
Includes monitoring capabilities through Prometheus integration, allowing performance tracking and metrics collection
Publishes the package to PyPI, enabling installation via pip and integration with various Python environments
MCP Optimizer
🚀 Mathematical Optimization MCP Server with PuLP and OR-Tools support
🚀 Quick Start
Integration with LLM Clients
Claude Desktop Integration
Option 1: Using uvx (Recommended)
- Install Claude Desktop from claude.ai
- Open Claude Desktop → Settings → Developer → Edit Config
- Add to your
claude_desktop_config.json
:
- Restart Claude Desktop and look for the 🔨 tools icon
Option 2: Using pip
Then add to your Claude Desktop config:
Option 3: Using Docker
Method A: Docker with STDIO transport (Recommended for MCP clients)
Then add to your Claude Desktop config:
Method B: Docker with SSE transport (for HTTP/web clients)
Then use HTTP client to connect to http://localhost:8000
(requires additional MCP HTTP client setup)
Cursor Integration
- Install the MCP extension in Cursor
- Add mcp-optimizer to your workspace settings:
Other LLM Clients
For other MCP-compatible clients (Continue, Cody, etc.), use similar configuration patterns with the appropriate command for your installation method.
Advanced Installation Options
Local Development
Local Package Build and Run
For testing and development, you can build the package locally and run it with uvx:
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.
Troubleshooting: If you encounter event loop issues when using uvx, the package includes automatic detection and handling of existing event loops using nest-asyncio
.
Docker with Custom Configuration
Standalone Server Commands
Transport Modes
MCP Optimizer supports two transport protocols:
- STDIO: Standard input/output for direct MCP client integration (Claude Desktop, Cursor, etc.)
- SSE: Server-Sent Events over HTTP for web-based clients and custom integrations
STDIO Transport (Default - for MCP clients like Claude Desktop)
SSE Transport (for HTTP/web clients)
Available CLI Options
🎯 Features
Supported Optimization Problem Types:
- Linear Programming - Maximize/minimize linear objective functions
- Assignment Problems - Optimal resource allocation using Hungarian algorithm
- Transportation Problems - Logistics and supply chain optimization
- Knapsack Problems - Optimal item selection (0-1, bounded, unbounded)
- Routing Problems - TSP and VRP with time windows
- Scheduling Problems - Job and shift scheduling
- Integer Programming - Discrete optimization problems
- Financial Optimization - Portfolio optimization and risk management
- Production Planning - Multi-period production planning
Testing
📊 Usage Examples
Linear Programming
Assignment Problem
Knapsack Problem
Portfolio Optimization
🏗️ Architecture
🧪 Test Results
✅ Comprehensive Test Suite
✅ Unit Tests
- 66 tests passed, 9 skipped
- Execution time: 0.45 seconds
- All core components functional
📈 Performance Metrics
- Linear Programming: ~0.01s
- Assignment Problems: ~0.01s
- Knapsack Problems: ~0.01s
- Complex test suite: 0.02s for 3 optimization problems
- Overall performance: 🚀 Excellent!
🔧 Technical Details
Core Solvers
- OR-Tools: For assignment, transportation, knapsack problems
- PuLP: For linear/integer programming
- FastMCP: For MCP server integration
Supported Solvers
- CBC, GLPK, GUROBI, CPLEX (via PuLP)
- SCIP, CP-SAT (via OR-Tools)
Key Features
- ✅ Full MCP protocol integration
- ✅ Comprehensive input validation
- ✅ Robust error handling
- ✅ High-performance optimization
- ✅ Production-ready architecture
- ✅ Extensive test coverage
- ✅ Docker and Kubernetes support
📋 Requirements
- Python 3.11+
- uv (for dependency management)
- OR-Tools (automatically installed)
- PuLP (automatically installed)
🚀 Production Deployment
Docker
Kubernetes
Monitoring
🎯 Project Status
✅ PRODUCTION READY 🚀
- All core optimization tools implemented and tested
- MCP server fully functional
- Comprehensive test coverage (66 unit tests + 9 integration tests)
- OR-Tools integration confirmed working
- Performance optimized (< 30s for complex test suites)
- Ready for production deployment
📖 Usage Examples
The examples/
directory contains practical examples and prompts for using MCP Optimizer with Large Language Models (LLMs):
Available Examples
- 📊 Linear Programming (RU | EN)
- Production optimization, diet planning, transportation, blending problems
- 👥 Assignment Problems (RU | EN)
- Employee-project assignment, machine-order allocation, task distribution
- 💰 Portfolio Optimization (RU | EN)
- Investment portfolios, retirement planning, risk management
How to Use Examples
- For LLM Integration: Copy the prompt text and provide it to your LLM with MCP Optimizer access
- For Direct API Usage: Use the provided API structures directly with MCP Optimizer functions
- For Learning: Understand different optimization problem types and formulations
Each example includes:
- Problem descriptions and real-world scenarios
- Ready-to-use prompts for LLMs
- Technical API structures
- Common activation phrases
- Practical applications
🔄 Recent Updates
Latest Release Features:
- 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.py
- Enhanced Testing - Updated comprehensive test suite with correct function signatures
- OR-Tools Integration - Confirmed full functionality of all OR-Tools components
🚀 Fully Automated Release Process
New Simplified Git Flow (3 steps!)
The project uses a fully automated release process:
1. Create Release Branch
2. Create PR to main
3. Merge PR - DONE! 🎉
After PR merge, automatically happens:
- ✅ Create tag v0.3.0
- ✅ Publish to PyPI
- ✅ Publish Docker images
- ✅ Create GitHub Release
- ✅ Merge main back to develop
- ✅ Cleanup release branch
NO NEED to run finalize_release.py
manually anymore!
🔒 Secure Detection: Uses hybrid approach combining GitHub branch protection with automated release detection. See Release Process for details.
Automated Release Pipeline
The CI/CD pipeline automatically handles:
- ✅ Release Candidates: Built from
release/*
branches - ✅ Production Releases: Triggered by version tags on
main
- ✅ PyPI Publishing: Automatic on tag creation
- ✅ Docker Images: Multi-architecture builds
- ✅ GitHub Releases: With artifacts and release notes
CI/CD Pipeline
The GitHub Actions workflow automatically:
- ✅ Runs tests on Python 3.11 and 3.12
- ✅ Performs security scanning
- ✅ Builds and pushes Docker images
- ✅ Publishes to PyPI on tag creation
- ✅ Creates GitHub releases
Requirements for PyPI Publication
- Set
PYPI_API_TOKEN
secret in GitHub repository - Ensure all tests pass
- Follow semantic versioning
🛠️ Development Tools
Debug Tools
Use the debug script to inspect MCP server structure:
Comprehensive Testing
Run the full integration test suite:
Docker Build Instructions
Image Details
- Base: Python 3.12 Slim (Debian-based)
- Size: ~649MB (optimized with multi-stage builds)
- Architecture: Multi-platform support (x86_64, ARM64)
- Security: Non-root user, minimal dependencies
- Performance: Optimized Python bytecode, cleaned build artifacts
Local Build Commands
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Git Flow Policy
This project follows a standard Git Flow workflow:
- Feature branches →
develop
branch - Release branches →
main
branch - Hotfix branches →
main
anddevelop
branches
📚 Documentation:
- Contributing Guide - Complete development workflow and Git Flow policy
- Release Process - How releases are created and automated
- Repository Setup - Complete setup guide including branch protection and security configuration
Development Setup
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- OR-Tools - Google's optimization tools
- PuLP - Linear programming in Python
- FastMCP - Fast MCP server implementation
📞 Support
- 📧 Email: support@mcp-optimizer.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: docs/
Made with ❤️ for the optimization community
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
mcp-optimizer
Related MCP Servers
- PythonApache 2.0
- TypeScriptMIT License
- TypeScriptMIT License
- TypeScriptMIT License