# Setting up the SeaLights MCP server

### Running the Sealights MCP server <a href="#running-the-sealights-mcp-server" id="running-the-sealights-mcp-server"></a>

The MCP SeaLights Server can be run in various ways depending on your deployment needs. Below are comprehensive examples for different scenarios.

#### Method 1: Using UV (Recommended for Development) <a href="#method-1-using-uv-recommended-for-development" id="method-1-using-uv-recommended-for-development"></a>

{% code overflow="wrap" lineNumbers="true" %}

```
{
  "mcpServers": {
    "mcp-sealights": {
      "command": "uv",
      "args": [
        "run",
        "main.py",
        "--transport", "stdio"
      ],
      "cwd": "/path/to/SL.Sealights.MCP",
      "env": {
        "SEALIGHTS_DOMAIN": "app.sealights.io",
        "SEALIGHTS_API_TOKEN": "your_api_token_here",
        "SEALIGHTS_AGENT_TOKEN": "your_agent_token_here",
        "SEALIGHTS_LOG_LEVEL": "INFO"
      }
    }
  }
}
```

{% endcode %}

or

**Using --env-file Flag**

{% code overflow="wrap" lineNumbers="true" %}

```
{
  "mcpServers": {
    "mcp-sealights": {
      "command": "uv",
      "args": [
        "run",
        "main.py",
        "--env-file", "/path/to/sealights.env",
        "--transport", "stdio"
      ],
      "cwd": "/path/to/SL.Sealights.MCP"
    }
  }
}
```

{% endcode %}

#### Method 2: Using Docker <a href="#method-2-using-docker" id="method-2-using-docker"></a>

{% code overflow="wrap" lineNumbers="true" %}

```
docker run -it --rm \
  -e SEALIGHTS_DOMAIN=app.sealights.io \
  -e SEALIGHTS_API_TOKEN=your_api_token_here \
  -e SEALIGHTS_AGENT_TOKEN=your_agent_token_here \
  -p 8000:8000 \
  sealights/sealights-mcp
```

{% endcode %}

in your MCP Client configuration, you can specify the server URL as follows:

{% code overflow="wrap" lineNumbers="true" %}

```
{
  "mcpServers": {
     "mcp-sealights": {
            "type": "sse",
            "url": "http://localhost:8000/sse"
     }
  }
}
```

{% endcode %}

### Environment Variables <a href="#environment-variables" id="environment-variables"></a>

The MCP SeaLights Server can be configured using the following environment variables. You can copy `.env.example` to `.env` and configure the values according to your setup.

#### Core SeaLights Settings <a href="#core-sealights-settings" id="core-sealights-settings"></a>

<table><thead><tr><th>Variable</th><th width="139.6796875">Required</th><th width="105.296875">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>SEALIGHTS_DOMAIN</code></td><td>Yes</td><td>-</td><td>SeaLights domain (e.g., <code>app.sealights.io</code>, <code>your-company.sealights.io</code>)</td></tr><tr><td><code>SEALIGHTS_API_TOKEN</code></td><td>Yes</td><td>-</td><td>SeaLights API token for authentication</td></tr><tr><td><code>SEALIGHTS_AGENT_TOKEN</code></td><td>No</td><td>-</td><td>SeaLights Agent token for agent-based operations</td></tr></tbody></table>

#### HTTP Client Settings <a href="#http-client-settings" id="http-client-settings"></a>

<table><thead><tr><th width="253.98046875">Variable</th><th width="132.94921875">Required</th><th width="109.99609375">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>SEALIGHTS_CONNECTION_TIMEOUT</code></td><td>No</td><td><code>30.0</code></td><td>HTTP connection timeout in seconds</td></tr><tr><td><code>SEALIGHTS_READ_TIMEOUT</code></td><td>No</td><td><code>60.0</code></td><td>HTTP read timeout in seconds</td></tr><tr><td><code>SEALIGHTS_MAX_CONNECTIONS</code></td><td>No</td><td><code>100</code></td><td>Maximum number of HTTP connections</td></tr><tr><td><code>SEALIGHTS_SSL_VERIFY</code></td><td>No</td><td><code>true</code></td><td>Verify SSL certificates (true/false)</td></tr></tbody></table>

#### Proxy Settings (Optional) <a href="#proxy-settings-optional" id="proxy-settings-optional"></a>

<table><thead><tr><th width="266.921875">Variable</th><th width="115.77734375">Required</th><th width="115.71875">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>SEALIGHTS_PROXY_URL</code></td><td>No</td><td>-</td><td>Proxy server URL (e.g., <code>http://proxy.company.com:8080</code>)</td></tr><tr><td><code>SEALIGHTS_PROXY_AUTH_USERNAME</code></td><td>No</td><td>-</td><td>Proxy authentication username</td></tr><tr><td><code>SEALIGHTS_PROXY_AUTH_PASSWORD</code></td><td>No</td><td>-</td><td>Proxy authentication password</td></tr></tbody></table>

#### Logging Settings <a href="#logging-settings" id="logging-settings"></a>

<table><thead><tr><th width="258.90625">Variable</th><th width="111.77734375">Required</th><th width="122.953125">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>SEALIGHTS_LOG_LEVEL</code></td><td>No</td><td><code>WARNING</code></td><td>Log level (<code>DEBUG</code>, <code>INFO</code>, <code>WARNING</code>, <code>ERROR</code>)</td></tr><tr><td><code>MCP_VERBOSE</code></td><td>No</td><td><code>false</code></td><td>Enable verbose MCP logging (<code>true</code>/<code>false</code>/<code>1</code>/<code>0</code>/<code>yes</code>/<code>no</code>)</td></tr></tbody></table>

#### Tool Categories <a href="#tool-categories" id="tool-categories"></a>

Control which tool categories are enabled. All are enabled by default.

<table><thead><tr><th width="316.359375">Variable</th><th width="90.30078125">Required</th><th width="84.8515625">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>SEALIGHTS_ENABLE_COCKPIT_TOOLS</code></td><td>No</td><td><code>true</code></td><td>Enable Cockpit tools (dashboard, metrics, etc.)</td></tr><tr><td><code>SEALIGHTS_ENABLE_COVERAGE_TOOLS</code></td><td>No</td><td><code>true</code></td><td>Enable Coverage tools (test coverage analysis)</td></tr><tr><td><code>SEALIGHTS_ENABLE_REPORTS_TOOLS</code></td><td>No</td><td><code>true</code></td><td>Enable Reports tools (test reports, analytics)</td></tr><tr><td><code>SEALIGHTS_ENABLE_OPTIMIZATION_TOOLS</code></td><td>No</td><td><code>true</code></td><td>Enable Test Optimization tools (test selection, prioritization)</td></tr><tr><td><code>SEALIGHTS_ENABLE_WORKFLOWS_TOOLS</code></td><td>No</td><td><code>true</code></td><td>Enable Common Workflows tools (CI/CD integrations)</td></tr><tr><td><code>SEALIGHTS_ENABLE_EXECUTIONS_TOOLS</code></td><td>No</td><td><code>true</code></td><td>Enable Executions tools (test execution management)</td></tr></tbody></table>

#### Operational Settings <a href="#operational-settings" id="operational-settings"></a>

| Variable         | Required | Default | Description                                           |
| ---------------- | -------- | ------- | ----------------------------------------------------- |
| `READ_ONLY_MODE` | No       | `false` | Run in read-only mode (disables all write operations) |

#### Example Configuration <a href="#example-configuration" id="example-configuration"></a>

Create a `.env` file in your project root with the following content:

{% code overflow="wrap" lineNumbers="true" %}

```
# Core SeaLights Settings
SEALIGHTS_DOMAIN=app.sealights.io
SEALIGHTS_API_TOKEN=your_api_token_here
SEALIGHTS_AGENT_TOKEN=your_agent_token_here

# HTTP Client Settings (optional - defaults shown)
SEALIGHTS_CONNECTION_TIMEOUT=30.0
SEALIGHTS_READ_TIMEOUT=60.0
SEALIGHTS_MAX_CONNECTIONS=100
SEALIGHTS_SSL_VERIFY=true

# Logging (optional)
SEALIGHTS_LOG_LEVEL=INFO
MCP_VERBOSE=false

# All tool categories are enabled by default
# Uncomment to disable specific categories:
# SEALIGHTS_ENABLE_COCKPIT_TOOLS=false
# SEALIGHTS_ENABLE_COVERAGE_TOOLS=false
# SEALIGHTS_ENABLE_REPORTS_TOOLS=false
# SEALIGHTS_ENABLE_OPTIMIZATION_TOOLS=false
# SEALIGHTS_ENABLE_WORKFLOWS_TOOLS=false
# SEALIGHTS_ENABLE_EXECUTIONS_TOOLS=false

# Operational settings
READ_ONLY_MODE=false
```

{% endcode %}

### Command-Line Options <a href="#command-line-options" id="command-line-options"></a>

The MCP SeaLights Server supports comprehensive command-line configuration. You can run the server with various options to override environment variables or configure specific behaviors.

#### Usage <a href="#usage" id="usage"></a>

{% code overflow="wrap" lineNumbers="true" %}

```
# Basic usage
python3 main.py

# With specific options
python3 main.py --domain app.sealights.io --api-token YOUR_TOKEN --verbose

# Show all available options
python3 main.py --help
```

{% endcode %}

#### Core Authentication Options <a href="#core-authentication-options" id="core-authentication-options"></a>

<table><thead><tr><th width="133.109375">Flag</th><th width="202.015625">Environment Variable</th><th width="90.02734375">Type</th><th width="89.80859375">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>--domain</code></td><td><code>SEALIGHTS_DOMAIN</code></td><td>String</td><td>-</td><td>SeaLights domain (e.g., <code>app.sealights.io</code>, <code>your-company.sealights.io</code>)</td></tr><tr><td><code>--api-token</code></td><td><code>SEALIGHTS_API_TOKEN</code></td><td>String</td><td>-</td><td>SeaLights API token for authentication</td></tr><tr><td><code>--agent-token</code></td><td><code>SEALIGHTS_AGENT_TOKEN</code></td><td>String</td><td>-</td><td>SeaLights Agent token for agent-based operations</td></tr></tbody></table>

#### Server Configuration Options <a href="#server-configuration-options" id="server-configuration-options"></a>

<table><thead><tr><th>Flag</th><th width="208.84765625">Environment Variable</th><th width="89.3984375">Type</th><th width="94.71484375">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>--env-file</code></td><td>-</td><td>Path</td><td><code>.env</code></td><td>Path to environment file to load</td></tr><tr><td><code>--transport</code></td><td>-</td><td>Choice</td><td><code>sse</code></td><td>Transport type: <code>stdio</code> or <code>sse</code></td></tr><tr><td><code>--port</code></td><td>-</td><td>Integer</td><td><code>8000</code></td><td>Port to listen on for SSE transport</td></tr><tr><td><code>--read-only</code></td><td><code>READ_ONLY_MODE</code></td><td>Flag</td><td><code>false</code></td><td>Run in read-only mode (disables all write operations)</td></tr></tbody></table>

#### HTTP Client Options <a href="#http-client-options" id="http-client-options"></a>

<table><thead><tr><th width="192.4921875">Flag</th><th width="264.84765625">Environment Variable</th><th width="84.0703125">Type</th><th width="78.88671875">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>--connection-timeout</code></td><td><code>SEALIGHTS_CONNECTION_TIMEOUT</code></td><td>Float</td><td><code>30.0</code></td><td>HTTP connection timeout in seconds</td></tr><tr><td><code>--read-timeout</code></td><td><code>SEALIGHTS_READ_TIMEOUT</code></td><td>Float</td><td><code>60.0</code></td><td>HTTP read timeout in seconds</td></tr><tr><td><code>--max-connections</code></td><td><code>SEALIGHTS_MAX_CONNECTIONS</code></td><td>Integer</td><td><code>100</code></td><td>Maximum number of HTTP connections</td></tr><tr><td><code>--ssl-verify</code> / <code>--no-ssl-verify</code></td><td><code>SEALIGHTS_SSL_VERIFY</code></td><td>Flag</td><td><code>--ssl-verify</code></td><td>Enable/disable SSL certificate verification</td></tr></tbody></table>

#### Proxy Configuration Options <a href="#proxy-configuration-options" id="proxy-configuration-options"></a>

<table><thead><tr><th width="163.48828125">Flag</th><th>Environment Variable</th><th width="93.3359375">Type</th><th width="76.984375">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>--proxy-url</code></td><td><code>SEALIGHTS_PROXY_URL</code></td><td>String</td><td>-</td><td>Proxy URL (e.g., <code>http://proxy.company.com:8080</code>)</td></tr><tr><td><code>--proxy-username</code></td><td><code>SEALIGHTS_PROXY_AUTH_USERNAME</code></td><td>String</td><td>-</td><td>Proxy authentication username</td></tr><tr><td><code>--proxy-password</code></td><td><code>SEALIGHTS_PROXY_AUTH_PASSWORD</code></td><td>String</td><td>-</td><td>Proxy authentication password</td></tr></tbody></table>

#### Logging Options <a href="#logging-options" id="logging-options"></a>

<table><thead><tr><th>Flag</th><th width="191.015625">Environment Variable</th><th width="83.390625">Type</th><th width="86.82421875">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>-v</code> / <code>--verbose</code></td><td><code>SEALIGHTS_LOG_LEVEL</code></td><td>Count</td><td>0</td><td>Increase verbosity (can be used multiple times)<br>0 = WARNING, 1 = INFO, 2+ = DEBUG</td></tr></tbody></table>

#### Tool Category Options <a href="#tool-category-options" id="tool-category-options"></a>

Control which tool categories are enabled. All categories are enabled by default.

<table><thead><tr><th width="259.265625">Flag</th><th>Environment Variable</th><th width="75.1796875">Type</th><th width="114.66796875">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>--enable-cockpit-tools</code> / <code>--disable-cockpit-tools</code></td><td><code>SEALIGHTS_ENABLE_COCKPIT_TOOLS</code></td><td>Flag</td><td><code>--enable-cockpit-tools</code></td><td>Enable/disable Cockpit tools (dashboard, metrics, etc.)</td></tr><tr><td><code>--enable-coverage-tools</code> / <code>--disable-coverage-tools</code></td><td><code>SEALIGHTS_ENABLE_COVERAGE_TOOLS</code></td><td>Flag</td><td><code>--enable-coverage-tools</code></td><td>Enable/disable Coverage tools (test coverage analysis)</td></tr><tr><td><code>--enable-reports-tools</code> / <code>--disable-reports-tools</code></td><td><code>SEALIGHTS_ENABLE_REPORTS_TOOLS</code></td><td>Flag</td><td><code>--enable-reports-tools</code></td><td>Enable/disable Reports tools (test reports, analytics)</td></tr><tr><td><code>--enable-optimization-tools</code> / <code>--disable-optimization-tools</code></td><td><code>SEALIGHTS_ENABLE_OPTIMIZATION_TOOLS</code></td><td>Flag</td><td><code>--enable-optimization-tools</code></td><td>Enable/disable Test Optimization tools (test selection, prioritization)</td></tr><tr><td><code>--enable-workflows-tools</code> / <code>--disable-workflows-tools</code></td><td><code>SEALIGHTS_ENABLE_WORKFLOWS_TOOLS</code></td><td>Flag</td><td><code>--enable-workflows-tools</code></td><td>Enable/disable Common Workflows tools (CI/CD integrations)</td></tr><tr><td><code>--enable-executions-tools</code> / <code>--disable-executions-tools</code></td><td><code>SEALIGHTS_ENABLE_EXECUTIONS_TOOLS</code></td><td>Flag</td><td><code>--enable-executions-tools</code></td><td>Enable/disable Executions tools (test execution management)</td></tr></tbody></table>

#### Example Commands <a href="#example-commands" id="example-commands"></a>

{% code overflow="wrap" lineNumbers="true" %}

```
# Start with basic configuration
python3 main.py --domain app.sealights.io --api-token your_token_here

# Start with verbose logging
python3 main.py --domain app.sealights.io --api-token your_token_here -vv

# Start with SSE transport on custom port
python3 main.py --transport sse --port 9000 --domain app.sealights.io --api-token your_token_here

# Start with proxy configuration
python3 main.py \
  --domain app.sealights.io \
  --api-token your_token_here \
  --proxy-url http://proxy.company.com:8080 \
  --proxy-username proxy_user \
  --proxy-password proxy_pass

# Start with specific tool categories disabled
python3 main.py \
  --domain app.sealights.io \
  --api-token your_token_here \
  --disable-optimization-tools \
  --disable-workflows-tools

# Start in read-only mode with custom timeouts
python3 main.py \
  --domain app.sealights.io \
  --api-token your_token_here \
  --read-only \
  --connection-timeout 60.0 \
  --read-timeout 120.0

# Load configuration from custom env file
python3 main.py --env-file /path/to/custom/.env

# Disable SSL verification (for development/testing)
python3 main.py \
  --domain dev.sealights.io \
  --api-token your_token_here \
  --no-ssl-verify
```

{% endcode %}

#### Configuration Precedence <a href="#configuration-precedence" id="configuration-precedence"></a>

Configuration values are applied in the following order (later values override earlier ones):

1. **Default values** (built into the application)
2. **Environment variables** (from `.env` file or system environment)
3. **Command-line arguments** (highest precedence)

This means you can set defaults in your `.env` file and override specific values using command-line flags as needed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/integrations/sealights-mcp/setting-up-the-sealights-mcp-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
