# LinearB MCP

> LinearB connects your AI agent directly to your software delivery pipeline, automating engineering intelligence and DORA reporting. You can query complex metrics like cycle time or coding duration across multiple teams. It also allows you to report new deployments using Git references and log incidents to accurately calculate MTTR and Change Failure Rate.

## Overview
- **Category:** ship-it
- **Price:** Free
- **Tags:** dora-metrics, engineering-intelligence, deployment-tracking, incident-management, cycle-time, devops

## Description

Managing software health used to mean opening a dozen dashboards—one for deployments, one for team capacity, another for incident logs. Now, your agent handles the heavy lifting. This MCP lets your AI client access all those critical engineering metrics directly. You can ask natural language questions like, 'What was our average cycle time last month?' and get an immediate answer detailing coding time versus pickup time.

Need to log a new release? Your agent records that deployment using the Git reference, keeping your records current without you lifting a finger. If something breaks, reporting a new incident is just a command away. Because this capability lives in the Vinkius catalog, connecting it takes minutes. You get a single source of truth for performance data—the whole picture needed to audit organizational health and track deployments.

## Tools

### record_new_deployment
Reports a new software release into LinearB using a specific repository ID and Git reference.

### record_new_incident
Creates an incident record for service outages, requiring the provider ID and time it started.

### list_software_deployments
Retrieves a list of all recent software deployments recorded in LinearB.

### list_software_incidents
Fetches a listing of engineering incidents to track service disruptions.

### query_software_metrics
Queries detailed software engineering metrics, allowing you to specify what data points and time windows you need.

### list_connected_repos
Retrieves a list of all repositories that have been connected and monitored by LinearB.

### list_engineering_teams
Lists every team defined within the LinearB system for scope management.

## Prompt Examples

**Prompt:** 
```
Query the average cycle_time for the last 30 days for team 'Backend'.
```

**Response:** 
```
I've retrieved the metrics for team 'Backend'. The average cycle_time over the last 30 days is 3.5 days, with coding_time at 1.2 days and pickup_time at 0.8 days.
```

**Prompt:** 
```
Record a new deployment for repo ID '123' with Git ref 'v1.2.0'.
```

**Response:** 
```
Successfully informed LinearB of the new deployment. The Git ref 'v1.2.0' for repository 123 has been recorded, and cycle times for the included PRs will be updated.
```

**Prompt:** 
```
Report a new incident starting now for provider 'OpsGenie'.
```

**Response:** 
```
I've reported the incident to LinearB. It has been associated with provider 'OpsGenie' starting at [timestamp]. This will be used to calculate your MTTR.
```

## Capabilities

### Query Team Performance Metrics
Ask about complex metrics like average cycle time, coding duration, or pickup time across specific teams.

### Log Software Releases
Inform the system about a new software deployment by providing a Git reference (SHA or tag).

### Track Service Outages
Record and list engineering incidents, which is necessary for calculating Mean Time To Recover (MTTR) and Change Failure Rate.

### Map Technical Assets
View a comprehensive list of all connected repositories and defined engineering teams in the system.

## Use Cases

### Auditing Team Performance
A manager needs to know if the 'Backend' team is falling behind. Instead of opening the dashboard and clicking filters for time ranges and metric types, they ask their agent: 'What was the average cycle_time for Backend over the last 30 days?' The agent uses `query_software_metrics` and immediately reports the data points.

### Logging a Critical Outage
The primary service goes down. An engineer opens their chat client and tells their agent: 'Record an incident for OpsGenie starting now.' The agent uses `record_new_incident` so that the MTTR calculation starts instantly, without manual data entry.

### Tracking a Major Release
The CI/CD pipeline finishes and pushes version v2.1.0 for repo 456. Instead of navigating to LinearB's UI, the DevOps engineer asks their agent: 'Report deployment v2.1.0 for repo 456.' The agent uses `record_new_deployment` instantly.

### Understanding System Scope
A new team member joins and needs to understand the overall architecture. They ask their AI client: 'List all connected repositories and teams.' This triggers both `list_connected_repos` and `list_engineering_teams`, giving them a complete map.

## Benefits

- You can query complex engineering data, like average cycle time across teams, simply by asking a question. This is done using the `query_software_metrics` tool, eliminating manual dashboard report generation.
- Need to keep deployment records current? You use `record_new_deployment` to tell LinearB about a new release using its Git reference, ensuring your DORA metrics never suffer from stale data.
- When an outage happens, you immediately call the `record_new_incident` tool. This action logs the event and is critical for calculating accurate Mean Time To Recover (MTTR).
- You don't need to manually map out who owns what. You can use `list_engineering_teams` and `list_connected_repos` to quickly understand your entire technical structure.
- The ability to list both deployments (`list_software_deployments`) and incidents (`list_software_incidents`) in one flow gives you a full, chronological picture of system stability.

## How It Works

The bottom line is that you talk to your agent like talking to a coworker; it handles all the API calls and data formatting for you.

1. Subscribe to this MCP and provide your LinearB Public API Key.
2. Authorize your AI client to connect to the Vinkius catalog.
3. Use natural language commands within your agent to query metrics, list deployments, or report incidents.

## Frequently Asked Questions

**How do I query cycle time using LinearB MCP?**
You ask your agent directly, specifying the metric and time frame. The `query_software_metrics` tool handles the complex data request, giving you immediate insight into coding time versus pickup time.

**Can I use LinearB MCP to track deployments from CI/CD?**
Yes. You can use your agent to trigger `record_new_deployment` by passing the Git SHA or tag, ensuring that every release is logged automatically for accurate reporting.

**What happens when I list engineering teams with LinearB MCP?**
The `list_engineering_teams` tool fetches a clean list of all defined teams in the system. This helps you map technical IDs to specific organizational units for better reporting.

**Does LinearB MCP help calculate MTTR?**
Yes, by using `record_new_incident`, your agent logs the start time of an incident against a provider. This critical data point allows you to accurately track and calculate Mean Time To Recover (MTTR).

**Which repositories can I query with LinearB MCP?**
First, use `list_connected_repos` to see all available sources. Then, your agent uses those IDs when calling tools like `query_software_metrics` or `record_new_deployment`.