Skip to main content
Glama

Constrained Optimization MCP Server

build_and_test.pyโ€ข2.7 kB
#!/usr/bin/env python3 """ Build and test script for constrained-opt-mcp package """ import subprocess import sys import os from pathlib import Path def run_command(cmd, description): """Run a command and handle errors""" print(f"๐Ÿ”„ {description}...") try: result = subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True) print(f"โœ… {description} completed successfully") if result.stdout: print(f"Output: {result.stdout}") return True except subprocess.CalledProcessError as e: print(f"โŒ {description} failed") print(f"Error: {e.stderr}") return False def main(): """Main build and test process""" print("๐Ÿš€ Building and testing constrained-opt-mcp package") print("=" * 60) # Change to project root project_root = Path(__file__).parent.parent os.chdir(project_root) # Clean previous builds print("\n๐Ÿงน Cleaning previous builds...") if os.path.exists("dist"): import shutil shutil.rmtree("dist") if os.path.exists("build"): import shutil shutil.rmtree("build") if os.path.exists("*.egg-info"): import glob for egg_info in glob.glob("*.egg-info"): shutil.rmtree(egg_info) # Install build dependencies if not run_command("python -m pip install build twine", "Installing build dependencies"): return False # Build package if not run_command("python -m build", "Building package"): return False # Check distributions if not run_command("twine check dist/*", "Checking distributions"): return False # Test installation print("\n๐Ÿงช Testing package installation...") test_commands = [ "python -m pip install dist/*.whl --force-reinstall", "python -c \"import constrained_opt_mcp; print('โœ… Package imported successfully')\"", "python -c \"from constrained_opt_mcp.models import ortools_models; print('โœ… Models imported successfully')\"", "python -c \"from constrained_opt_mcp.solvers import ortools_solver; print('โœ… Solvers imported successfully')\"", "python -c \"from constrained_opt_mcp.server import main; print('โœ… Server module imported successfully')\"", ] for cmd in test_commands: if not run_command(cmd, f"Testing: {cmd}"): return False print("\n๐ŸŽ‰ Package build and test completed successfully!") print("๐Ÿ“ฆ Package files created in dist/") print("๐Ÿš€ Ready for PyPI publication!") return True if __name__ == "__main__": success = main() sys.exit(0 if success else 1)

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sharmarajnish/MCP-Constrained-Optimization'

If you have feedback or need assistance with the MCP directory API, please join our Discord server