> ## Documentation Index
> Fetch the complete documentation index at: https://docs.steadwing.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze via MCP

> Trigger incident analysis via MCP (Model Context Protocol) integration.



## OpenAPI

````yaml POST /api/mcp/analyze
openapi: 3.1.0
info:
  title: RCA FastAPI Backend
  version: 1.0.0
servers:
  - url: https://api.steadwing.com
security: []
paths:
  /api/mcp/analyze:
    post:
      tags:
        - mcp
      summary: Analyze Incident Mcp
      description: >-
        Trigger AI-powered Root Cause Analysis for an incident using MCP-based
        system prompt.


        Authentication: Requires a valid API key in the X-API-Key header.

        Organization ID is automatically extracted from the API key.


        The analysis will:

        - Use the MCP_RCA_SYSTEM_PROMPT instead of the dynamic prompt builder

        - Accept optional file contents for direct code analysis

        - Analyze incident and files without external tool integrations

        - Perform comprehensive RCA following a structured workflow

        - Create an incident record with detailed analysis, root cause, and
        solutions


        The API returns immediately with the incident ID, and the analysis runs
        in the background.
      operationId: analyze_incident_mcp_api_mcp_analyze_post
      parameters:
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyzeMCPIncidentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AnalyzeMCPIncidentRequest:
      properties:
        error_log:
          type: string
          title: Error Log
        files:
          anyOf:
            - items:
                $ref: '#/components/schemas/FileContent'
              type: array
            - type: 'null'
          title: Files
      type: object
      required:
        - error_log
      title: AnalyzeMCPIncidentRequest
      description: >-
        Request schema for MCP-based RCA analysis.


        Note: organization_id is extracted from the API key, not from the
        request body.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FileContent:
      properties:
        name:
          type: string
          title: Name
        content:
          type: string
          title: Content
      type: object
      required:
        - name
        - content
      title: FileContent
      description: Schema for file content in MCP RCA requests
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````