> ## Documentation Index
> Fetch the complete documentation index at: https://test-8ad8522e-feat-ai-sre.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create MCP server

> Register a new MCP server (connector) on the account.

## Restrictions

| Aspect      | Value                                                         |
| ----------- | ------------------------------------------------------------- |
| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |
| Permissions | **MCP Manage** (`ai-sre`)                                     |

## Usage

* `command`/`args`/`env` apply to `stdio`; `url`/`headers` apply to `sse`/`streamable-http`.
* Server name must start with a letter and contain only letters, digits, `-`, or `_`, and is unique within its scope (account-wide or one team), case-insensitive; violations return InvalidParameter.
* `environments` restricts where the server can run: a list of `cloud` and/or BYOC runner environment IDs; omitted or empty means all environments.
* `per_user_secret` auth mode requires `secret_schema` to be valid JSON with a non-empty `header_name`.
* Every call is recorded in the account audit log.


## OpenAPI

````yaml /api-reference/safari.openapi.en.json post /safari/mcp/server/create
openapi: 3.1.0
info:
  title: Flashduty Open API
  description: >-
    Public HTTP API for the Flashduty AI SRE platform — skills, MCP servers
    (connectors), A2A agents, and sessions. Every operation is authenticated
    with an `app_key` query parameter issued from the Flashduty console.
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: AI SRE/Skills
    description: AI SRE agent skill management.
  - name: AI SRE/MCP servers
    description: MCP (Model Context Protocol) server management.
  - name: AI SRE/A2A agents
    description: A2A (agent-to-agent) remote agent management.
  - name: AI SRE/Sessions
    description: AI SRE agent session history — list, inspect, and export transcripts.
  - name: AI SRE/Automations
  - name: AI SRE/Knowledge
  - name: AI SRE/Artifacts
    description: >-
      AI SRE artifact gallery — publish, browse, and publicly share
      agent-produced files.
paths:
  /safari/mcp/server/create:
    post:
      tags:
        - AI SRE/MCP servers
      summary: Create MCP server
      description: Register a new MCP server (connector) on the account.
      operationId: mcp-write-server-create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPServerCreateRequest'
            example:
              server_name: prometheus
              description: Query Prometheus metrics and alerts.
              transport: streamable-http
              url: https://mcp.example.com/prometheus
              status: enabled
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MCPServerItem'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  server_id: mcp_4kP9wQ2nLceRtY7uVb3xA1
                  account_id: 10023
                  team_id: 0
                  can_edit: true
                  environments: []
                  server_name: prometheus
                  description: Query Prometheus metrics and alerts.
                  transport: streamable-http
                  url: https://mcp.example.com/prometheus
                  status: enabled
                  connect_timeout: 10
                  call_timeout: 60
                  auth_mode: shared
                  created_by: 80011
                  created_at: 1716960000000
                  updated_at: 1717046400000
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - AppKeyAuth: []
components:
  schemas:
    MCPServerCreateRequest:
      type: object
      description: Configuration for a new MCP server.
      properties:
        server_name:
          type: string
          description: >-
            MCP server name: must start with a letter and contain only letters,
            digits, `-`, or `_` (`@` is reserved); unique within its scope
            (account-wide or one team), case-insensitive.
          minLength: 1
          maxLength: 255
        description:
          type: string
          description: Server description.
          minLength: 1
          maxLength: 1024
        transport:
          type: string
          description: >-
            Transport protocol: `stdio` launches a local process via
            `command`/`args`/`env`, `sse` / `streamable-http` connects to a
            remote service via `url`/`headers`.
          enum:
            - stdio
            - sse
            - streamable-http
        command:
          type: string
          description: Executable command (stdio transport).
        args:
          type: array
          items:
            type: string
          description: Command arguments (stdio transport).
        env:
          type: object
          additionalProperties:
            type: string
          description: Environment variables (stdio transport).
        url:
          type: string
          description: Server URL (sse / streamable-http transport).
        headers:
          type: object
          additionalProperties:
            type: string
          description: HTTP headers (sse / streamable-http).
        connect_timeout:
          type: integer
          description: Connection timeout in seconds. 0 = default (10s).
        call_timeout:
          type: integer
          description: Tool-call timeout in seconds. 0 = default (60s).
        auth_mode:
          type: string
          description: >-
            Authentication mode: shared (default), per_user_secret, or
            per_user_oauth.
        secret_schema:
          type: string
          description: JSON secret schema; required when auth_mode=per_user_secret.
        oauth_metadata:
          type: string
          description: JSON OAuth metadata; reserved for per_user_oauth.
        status:
          type: string
          description: >-
            Initial status: `enabled` (default) or `disabled` (created but kept
            off).
          enum:
            - enabled
            - disabled
          default: enabled
        team_id:
          type: integer
          description: 'Team scope: 0 = account-wide; >0 = team.'
          format: int64
        environments:
          type: array
          items:
            type: string
          description: >-
            Execution environments this server is callable from: `cloud` and/or
            BYOC runner environment IDs. Omitted or empty means all
            environments.
        allow_insecure_oauth_http:
          type: boolean
          description: >-
            Allow this server's OAuth token exchange over plaintext HTTP.
            Testing use only; defaults to false.
        allow_insecure_tls_skip_verify:
          type: boolean
          description: >-
            Skip TLS certificate verification when connecting to this server.
            Testing use only; defaults to false.
        source_template_name:
          type: string
          description: Marketplace template name when created from a connector template.
      required:
        - server_name
        - description
        - transport
    ResponseEnvelope:
      type: object
      description: >-
        Standard response envelope used by every Flashduty public API. On
        success `data` contains the endpoint-specific payload and `error` is
        absent. On failure `error` is present and `data` is absent. `request_id`
        is always present and is also mirrored in the `Flashcat-Request-Id`
        response header.
      properties:
        request_id:
          type: string
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        error:
          $ref: '#/components/schemas/DutyError'
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
      required:
        - request_id
    MCPServerItem:
      type: object
      description: An MCP server (connector) registered on the account.
      properties:
        server_id:
          type: string
          description: Unique MCP server ID (prefix `mcp_`).
        account_id:
          type: integer
          description: Owning account ID.
          format: int64
        team_id:
          type: integer
          description: 'Team scope: 0 = account-wide; >0 = the owning team.'
          format: int64
        can_edit:
          type: boolean
          description: Whether the caller may edit this server.
        environments:
          type: array
          items:
            type: string
          description: >-
            Execution environments this server is callable from (`cloud` and/or
            BYOC runner environment IDs). Always present; `[]` means all
            environments (also the value on legacy rows created before this
            field).
        server_name:
          type: string
          description: >-
            MCP server name, unique within its scope (account-wide or one team),
            case-insensitive.
        description:
          type: string
          description: Server description.
        ai_description:
          type: string
          description: >-
            LLM-generated description, preferred over `description` when
            present. Omitted when not yet generated.
        transport:
          type: string
          description: >-
            Transport protocol. One of: `stdio` (standard I/O to a local
            subprocess), `sse` (standalone SSE, the legacy MCP transport),
            `streamable-http` (the newer HTTP streaming transport).
          enum:
            - stdio
            - sse
            - streamable-http
        command:
          type: string
          description: Executable command (stdio transport only).
        args:
          type: array
          items:
            type: string
          description: Command arguments (stdio transport).
        env:
          type: object
          additionalProperties:
            type: string
          description: Environment variables (stdio transport). Secret values are masked.
        url:
          type: string
          description: Server URL (sse / streamable-http transport).
        headers:
          type: object
          additionalProperties:
            type: string
          description: HTTP headers (sse / streamable-http). Secret values are masked.
        proxy_url:
          type: string
          description: Outbound proxy URL used to reach the server.
        status:
          type: string
          description: Server status.
          enum:
            - enabled
            - disabled
        connect_timeout:
          type: integer
          description: Connection timeout in seconds (0 = server default, 10s).
        call_timeout:
          type: integer
          description: Tool-call timeout in seconds (0 = server default, 60s).
        allow_insecure_oauth_http:
          type: boolean
          description: >-
            Allow this server's OAuth token exchange over plaintext HTTP;
            testing use only. Omitted when false.
        allow_insecure_tls_skip_verify:
          type: boolean
          description: >-
            Skip TLS certificate verification when connecting to this server;
            testing use only. Omitted when false.
        auth_mode:
          type: string
          description: >-
            Authentication mode. One of: `shared` (a single static credential
            saved on the resource and shared by all callers in the account; the
            default — an empty value behaves the same), `per_user_secret` (each
            user stores their own secret per `secret_schema`, injected per user
            at runtime), `per_user_oauth` (each user completes their own OAuth
            grant; discovery and registration run lazily on first use).
          enum:
            - shared
            - per_user_secret
            - per_user_oauth
        secret_schema:
          type: string
          description: JSON-encoded secret schema (per_user_secret mode).
        oauth_metadata:
          type: string
          description: JSON-encoded OAuth metadata (per_user_oauth mode).
        source_template_name:
          type: string
          description: >-
            Marketplace template this connector was installed from; empty for
            user-authored.
        created_by:
          type: integer
          description: Member ID that created the server.
          format: int64
        created_at:
          type: integer
          format: int64
          description: Creation time. Unix timestamp in milliseconds.
        updated_at:
          type: integer
          format: int64
          description: Last update time. Unix timestamp in milliseconds.
      required:
        - server_id
        - account_id
        - team_id
        - can_edit
        - server_name
        - description
        - transport
        - status
        - connect_timeout
        - call_timeout
        - created_by
        - created_at
        - updated_at
        - environments
    DutyError:
      type: object
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            Human-readable error message, localized by the caller's
            Accept-Language. May contain field names, IDs, or other context from
            the failing request.
          example: The specified parameter template_id is not valid.
      required:
        - code
        - message
    ErrorResponse:
      type: object
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          description: >-
            Unique trace ID of this request; include it when reporting issues so
            logs can be located.
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    ErrorCode:
      type: string
      description: >-
        Flashduty error code enum. Every failed API response sets `error.code`
        to one of these stable wire strings. HTTP status is informational — the
        authoritative signal is the enum value.


        | Code | HTTP | Meaning |

        |---|---|---|

        | `OK` | 200 | Reserved — not returned on real errors. |

        | `InvalidParameter` | 400 | A required parameter is missing or failed
        validation. |

        | `BadRequest` | 400 | Generic 400 used when no more specific code fits.
        |

        | `InvalidContentType` | 400 | The `Content-Type` header is not
        `application/json`. |

        | `ResourceNotFound` | 400 | The referenced resource does not exist.
        Note: returned as HTTP 400, not 404 (historical choice). |

        | `NoLicense` | 400 | The feature is license-gated and no active license
        was found. |

        | `ReferenceExist` | 400 | Deletion blocked — other entities still
        reference this resource. |

        | `Unauthorized` | 401 | `app_key` is missing, invalid, or expired. |

        | `BalanceNotEnough` | 402 | Billing-gated operation with insufficient
        account balance. |

        | `AccessDenied` | 403 | Authenticated but lacking the permission
        required for this operation. |

        | `RouteNotFound` | 404 | The request URL path is not a known route. |

        | `MethodNotAllowed` | 405 | The HTTP method is not allowed on this
        otherwise-known path. |

        | `UndonedOrderExist` | 409 | An outstanding billing order blocks this
        new one. Wait and retry. |

        | `RequestLocked` | 423 | Operation temporarily locked due to repeated
        failures. |

        | `EntityTooLarge` | 413 | Request body exceeds the configured max size.
        |

        | `RequestTooFrequently` | 429 | Rate limit hit — API-global,
        per-account, or per-integration. |

        | `RequestVerifyRequired` | 428 | Second-factor verification required
        but not supplied. |

        | `DangerousOperation` | 428 | High-risk operation requires MFA
        verification. |

        | `InternalError` | 500 | Unhandled server-side error. Include
        `request_id` in the bug report. |

        | `ServiceUnavailable` | 503 | A backend dependency is unavailable. Try
        again later. |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: Reserved — not returned on real errors.
        InvalidParameter: A required parameter is missing or failed validation.
        BadRequest: Generic 400 used when no more specific code fits.
        InvalidContentType: The `Content-Type` header is not `application/json`.
        ResourceNotFound: >-
          The referenced resource does not exist. Note: returned as HTTP 400,
          not 404 (historical choice).
        NoLicense: The feature is license-gated and no active license was found.
        ReferenceExist: Deletion blocked — other entities still reference this resource.
        Unauthorized: '`app_key` is missing, invalid, or expired.'
        BalanceNotEnough: Billing-gated operation with insufficient account balance.
        AccessDenied: Authenticated but lacking the permission required for this operation.
        RouteNotFound: The request URL path is not a known route.
        MethodNotAllowed: The HTTP method is not allowed on this otherwise-known path.
        UndonedOrderExist: An outstanding billing order blocks this new one. Wait and retry.
        RequestLocked: Operation temporarily locked due to repeated failures.
        EntityTooLarge: Request body exceeds the configured max size.
        RequestTooFrequently: Rate limit hit — API-global, per-account, or per-integration.
        RequestVerifyRequired: Second-factor verification required but not supplied.
        DangerousOperation: High-risk operation requires MFA verification.
        InternalError: Unhandled server-side error. Include `request_id` in the bug report.
        ServiceUnavailable: A backend dependency is unavailable. Try again later.
      example: InvalidParameter
  responses:
    BadRequest:
      description: Invalid request — usually a missing or malformed parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              summary: Missing required parameter
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter skill_id is not valid.
    Unauthorized:
      description: Missing or invalid app_key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingAppKey:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: Unauthorized
                  message: You are unauthorized.
    Forbidden:
      description: The app_key is valid but lacks permission for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            accessDenied:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: AccessDenied
                  message: Access Denied.
    TooManyRequests:
      description: Rate limit hit. Either the global API limit or a per-account limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: Unexpected server-side error. Include the request_id when reporting.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: app_key
      description: >-
        App key issued from the Flashduty console. Required on every public API
        call. Keep it secret — it grants the same access as the owning account.

````