Linear MCP server

Integrates Linear project management with MCP to enable task creation, updates, and queries for automated workflow management.
Back to servers
Setup instructions
Provider
Shannon Lal
Release date
Jan 03, 2025
Language
TypeScript
Package
Stats
3.8K downloads
6 stars

The MCP Linear project provides a server implementation for Model Context Protocol (MCP), enabling efficient model inference through a standardized communication interface. It allows clients to interact with AI models in a consistent way regardless of the underlying model implementation.

Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Basic Installation

Install the MCP Linear server using pip:

pip install mcp-linear

For development or the latest features, you can install directly from the repository:

pip install git+https://github.com/username/mcp-linear.git

Server Configuration

Configuration File

Create a configuration file named config.yaml with the following structure:

model:
  name: "my-model"
  backend: "transformers"  # or "llama-cpp", "vllm", etc.
  model_path: "/path/to/model/weights"
  
server:
  host: "0.0.0.0"
  port: 8000
  max_batch_size: 10
  max_queue_size: 100

Configuration Options

  • model.name: Identifier for your model
  • model.backend: The inference backend to use
  • model.model_path: Path to model weights or identifier
  • server.host: Host address to bind the server
  • server.port: Port for the server to listen on
  • server.max_batch_size: Maximum batch size for inference
  • server.max_queue_size: Maximum queue size for pending requests

Starting the Server

Start the MCP server using the command:

mcp-linear serve --config config.yaml

Additional command line options:

mcp-linear serve --config config.yaml --log-level debug --workers 4

Client Usage

Python Client

Connect to the MCP server using the Python client:

from mcp_client import MCPClient

# Initialize the client
client = MCPClient("http://localhost:8000")

# Simple text generation
response = client.generate(
    prompt="Explain quantum computing in simple terms",
    max_tokens=100
)
print(response.text)

# Stream responses
for chunk in client.generate_stream(
    prompt="Write a short story about robots",
    max_tokens=500
):
    print(chunk.text, end="", flush=True)

Command Line Interface

You can also use the built-in CLI to interact with the server:

mcp-cli generate \
  --server http://localhost:8000 \
  --prompt "What is machine learning?" \
  --max-tokens 150

Managing Multiple Models

The server supports hosting multiple models simultaneously:

# config.yaml
models:
  - name: "gpt-small"
    backend: "transformers"
    model_path: "/models/gpt2"
    device: "cuda:0"
    
  - name: "llama-7b"
    backend: "llama-cpp"
    model_path: "/models/llama-7b.gguf"
    device: "cuda:1"

server:
  host: "0.0.0.0"
  port: 8000

When connecting with a client, specify the model:

response = client.generate(
    model="gpt-small",
    prompt="Explain the theory of relativity",
    max_tokens=200
)

Monitoring and Metrics

Monitor your server's performance using the built-in metrics endpoint:

curl http://localhost:8000/metrics

Key metrics available:

  • Request throughput
  • Average latency
  • Queue size
  • GPU/CPU utilization

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-linear" '{"command":"npx","args":["-y","mcp-linear"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-linear": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-linear"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-linear": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-linear"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later