Skip to main content
Glama

MCP Optimizer

Crew Optimizer

Crew Optimizer rebuilds the original optimisation project around the CrewAI ecosystem. It provides reusable CrewAI tools and agents capable of solving linear programs via SciPy's HiGHS backend, exploring mixed-integer models with a lightweight branch-and-bound search (or OR-Tools fallback), translating natural language prompts into LP JSON, and diagnosing infeasibility. You can embed the tools inside your own crews or call them programmatically through the OptimizerCrew convenience wrapper, or serve them over the MCP protocol for clients such as Smithery.

Installation

python -m venv .venv source .venv/bin/activate pip install -e .[mip]

This installs Crew Optimizer together with optional OR-Tools support for MILP solving. Add pytest, ruff, or other dev tools as needed (pip install pytest).

Quick Usage

from crew_optimizer import OptimizerCrew crew = OptimizerCrew(verbose=False) lp_model = { "name": "diet-toy", "sense": "min", "objective": { "terms": [ {"var": "x", "coef": 3}, {"var": "y", "coef": 2}, ], "constant": 0, }, "variables": [ {"name": "x", "lb": 0}, {"name": "y", "lb": 0}, ], "constraints": [ { "name": "c1", "lhs": { "terms": [ {"var": "x", "coef": 1}, {"var": "y", "coef": 2}, ], "constant": 0, }, "cmp": ">=", "rhs": 8, }, { "name": "c2", "lhs": { "terms": [ {"var": "x", "coef": 3}, {"var": "y", "coef": 1}, ], "constant": 0, }, "cmp": ">=", "rhs": 6, }, ], } solution = crew.solve_lp(lp_model) print(solution)

To integrate with a wider multi-agent workflow, call crew.build_crew() to obtain a Crew populated with the LP, MILP, and parser agents. Provide model inputs through CrewAI’s shared context as usual.

MCP / Smithery Hosting

Crew Optimizer ships an MCP server (python -m crew_optimizer.server) that wraps the same solvers. The repository already contains a Smithery manifest (smithery.json) and build config (smithery.yaml).

  1. Push the repository to GitHub.

  2. In Smithery, choose Publish an MCP Server, connect GitHub, and select the repo.

  3. Smithery installs the package (pip install .) and launches mcp http src/crew_optimizer/server.py --port 3333 using the bundled startup script.

  4. The server exposes the following tools:

    • solve_linear_program

    • solve_mixed_integer_program

    • parse_natural_language

    • diagnose_infeasibility

For local testing:

mcp http src/crew_optimizer/server.py --port 3333 --cors "*"

Testing

Install test dependencies (pip install pytest) and run:

python -m pytest

The suite covers the LP solver, MILP branch-and-bound, and the NL parser.

Licence

Distributed under the MIT Licence. See LICENSE for details.

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Enables solving linear programming (LP) and mixed-integer linear programming (MILP) optimization problems through natural language, with built-in simplex and branch-and-cut solvers plus infeasibility diagnostics. Includes optional OR-Tools fallback for larger problems and supports parsing optimization problems from natural language descriptions.

  1. Installation
    1. Quick Usage
      1. MCP / Smithery Hosting
        1. Testing
          1. Licence

            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/mrugankpednekar/mcp-optimizer'

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