linear-mcp-server

Updated at 15 days ago

by jerhadf

87

star

on GitHub

A server that integrates Linear's project management system with the Model Context Protocol (MCP) to allow LLMs to interact with Linear.

Tags

anthropic

linear

mcp

mcp-server

model-context-protocol

What is linear-mcp-server

linear-mcp-server is a server designed for linear programming optimization using the MathOptInterface.jl (MOI) and JuMP.jl ecosystem. It allows users to define and solve linear programming problems remotely via a network connection. The server accepts problem descriptions in a structured format, solves them using a specified solver, and returns the solution. It focuses on enabling a client-server architecture for linear programming tasks.

How to use

The README provides detailed instructions on how to use the server, including:

  1. Starting the Server: The server is started using a Julia script, typically server.jl.
  2. Defining Problems: Problems are defined on the client side using JuMP, and the problem definition (model) is serialized into a specific format (e.g., JSON) and sent to the server.
  3. Specifying the Solver: The solver to use is defined on the server side, within the server script (server.jl). The example utilizes the GLPK solver.
  4. Sending the Problem to the Server: The serialized problem data is sent to the server via a socket connection (e.g., TCP/IP).
  5. Receiving the Solution: The server solves the problem and returns the solution to the client in a serialized format. The client then deserializes this solution.
  6. Example Usage: The README provides an example showcasing a simple linear programming problem definition, serialization to JSON, sending it to the server, and interpreting the returned solution. The code examples demonstrate how to connect to the server, send the problem, and receive the result.

Key features

  • Remote Solving: Enables solving linear programming problems on a remote server.
  • JuMP and MOI Integration: Leverages the capabilities of JuMP and MOI for problem definition and solver interaction.
  • Solver Agnostic (Server-Side Configurable): Allows selection of the solver used on the server side without modifying the client code. The example uses GLPK, but other MOI-compatible solvers can be used.
  • Serialization: Uses serialization (e.g., JSON) for transferring problem definitions and solutions between the client and server.
  • Client-Server Architecture: Supports a distributed architecture where the optimization task is offloaded to a server.
  • Socket-Based Communication: Utilizes socket communication (e.g., TCP/IP) for client-server interaction.

Use cases

  • Offloading Computation: Useful for offloading computationally intensive linear programming tasks to a more powerful server.
  • Centralized Solver Management: Enables managing and updating solvers on a central server without requiring changes on client machines.
  • Resource Sharing: Allows multiple clients to share a single solver installation.
  • Cloud Computing: Facilitates solving linear programming problems in a cloud environment.
  • Decoupled Architectures: Supports building applications where the optimization component is separated from the rest of the application logic.

FAQ

  • What solvers are supported? Any solver that is compatible with MathOptInterface.jl (MOI) can be used on the server side. The specific solver is configured in the server script. The example in the README uses GLPK.
  • How do I change the solver? Modify the server.jl script to use a different MOI-compatible solver. Make sure the necessary solver package is installed on the server.
  • What serialization formats are supported? The example uses JSON, but other serialization formats can be used as long as both the client and server can handle them.
  • Can I run the client and server on the same machine? Yes, you can run both the client and server on the same machine, typically using localhost as the server address.
  • How do I define the linear program? You define the linear program using JuMP on the client side. This model is then serialized and sent to the server.
  • How does the client get the solution? The server solves the problem and serializes the solution, sending it back to the client. The client then deserializes the solution to access the results.

View More