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

# Create MCP server

> Register a new MCP server the agent can call tools through.

## Restrictions

| Aspect      | Value                                                         |
| ----------- | ------------------------------------------------------------- |
| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |
| Permissions | None — any valid `app_key` can call this operation            |

## Usage

* `transport` must be one of stdio, sse, or streamable-http; other values return InvalidParameter.
* Duplicate server names return InvalidParameter.
* Every call is recorded in the account's 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 (safari) module — manage agent
    skills, MCP servers, and A2A remote agents. 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.
paths:
  /safari/mcp/server/create:
    post:
      tags:
        - AI SRE/MCP servers
      summary: Create MCP server
      description: Register a new MCP server the agent can call tools through.
      operationId: mcp-write-server-create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPServerCreateRequest'
            example:
              server_name: GitHub Tools
              description: Read issues and pull requests from GitHub.
              transport: stdio
              command: npx
              args:
                - '-y'
                - '@modelcontextprotocol/server-github'
              env:
                GITHUB_TOKEN: ghp_xxx
              status: enabled
              team_id: 0
      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-2b5e8d14a7c9
                  account_id: 10023
                  team_id: 0
                  can_edit: true
                  server_name: GitHub Tools
                  description: Read issues and pull requests from GitHub.
                  transport: stdio
                  command: npx
                  args:
                    - '-y'
                    - '@modelcontextprotocol/server-github'
                  env:
                    GITHUB_TOKEN: ghp_xxx
                  status: enabled
                  connect_timeout: 10
                  call_timeout: 30
                  tool_count: 12
                  auth_mode: shared
                  created_by: 80011
                  created_at: 1716960000000
                  updated_at: 1717046400000
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '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
          minLength: 1
          maxLength: 255
          description: Display name of the server.
        description:
          type: string
          minLength: 1
          maxLength: 1024
          description: What this MCP server provides.
        transport:
          type: string
          enum:
            - stdio
            - sse
            - streamable-http
          description: Transport used to reach the server.
        command:
          type: string
          description: Executable to launch for stdio transport.
        args:
          type: array
          items:
            type: string
          description: Command-line arguments for the stdio executable.
        env:
          type: object
          additionalProperties:
            type: string
          description: Environment variables for the stdio process.
        url:
          type: string
          description: Endpoint URL for sse or streamable-http transport.
        headers:
          type: object
          additionalProperties:
            type: string
          description: HTTP headers sent to the remote endpoint.
        connect_timeout:
          type: integer
          description: Connection timeout in seconds.
        call_timeout:
          type: integer
          description: Per-call timeout in seconds.
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: Initial lifecycle state of the server.
        team_id:
          type: integer
          format: int64
          description: Owning team for the new server; 0 for account scope.
        auth_mode:
          type: string
          description: Credential model; defaults to shared.
        secret_schema:
          type: string
          description: >-
            JSON schema of the per-user secret; required when auth_mode is
            per_user_secret.
        oauth_metadata:
          type: string
          description: OAuth metadata JSON; reserved for OAuth-based auth.
      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: >-
        A configured MCP (Model Context Protocol) server the agent can call
        tools through.
      properties:
        server_id:
          type: string
          description: Unique identifier of the MCP server.
        account_id:
          type: integer
          format: int64
          description: Owning account.
        team_id:
          type: integer
          format: int64
          description: Owning team; 0 means account scope.
        can_edit:
          type: boolean
          description: Whether the calling member may edit or delete this resource.
        server_name:
          type: string
          description: Display name of the MCP server.
        description:
          type: string
          description: What this MCP server provides.
        ai_description:
          type: string
          description: LLM-generated description, preferred over description when present.
        transport:
          type: string
          enum:
            - stdio
            - sse
            - streamable-http
          description: Transport used to reach the server.
        command:
          type: string
          description: Executable launched for stdio transport.
        args:
          type: array
          items:
            type: string
          description: Command-line arguments for the stdio executable.
        env:
          type: object
          additionalProperties:
            type: string
          description: Environment variables passed to the stdio process.
        url:
          type: string
          description: Endpoint URL for sse or streamable-http transport.
        headers:
          type: object
          additionalProperties:
            type: string
          description: HTTP headers sent to the remote endpoint; secret values are masked.
        proxy_url:
          type: string
          description: Outbound proxy URL used to reach the server.
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: Whether the server is active and usable by agents.
        connect_timeout:
          type: integer
          description: Connection timeout in seconds.
        call_timeout:
          type: integer
          description: Per-call timeout in seconds.
        tools:
          type: array
          items:
            $ref: '#/components/schemas/MCPToolInfo'
          description: Live tool catalogue; populated only by get and test.
        tool_count:
          type: integer
          description: Number of tools discovered on the server.
        list_error:
          type: string
          description: Tool-probe failure message; present when the live probe failed.
        auth_mode:
          type: string
          description: 'Credential model: shared, per_user_secret, or per_user_oauth.'
        secret_schema:
          type: string
          description: JSON schema of the per-user secret.
        oauth_metadata:
          type: string
          description: OAuth metadata JSON.
        created_by:
          type: integer
          format: int64
          description: Member who created this resource.
        created_at:
          type: integer
          format: int64
          description: Creation time as a Unix timestamp in milliseconds.
        updated_at:
          type: integer
          format: int64
          description: Last-update time as a 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
    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.
      required:
        - code
        - message
    MCPToolInfo:
      type: object
      description: Metadata for a single tool exposed by an MCP server.
      properties:
        name:
          type: string
          description: Tool name as advertised by the server.
        description:
          type: string
          description: What the tool does.
        input_schema:
          description: JSON schema of the tool's input arguments.
      required:
        - name
        - description
    ErrorResponse:
      type: object
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        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 values. The value is a stable wire string — not a
        localized message and not a numeric status. HTTP status is
        informational.
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
  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.
    TooManyRequests:
      description: >-
        Rate limit hit. Either the global API limit, a per-account limit, or a
        per-integration 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 under Account → APP Keys.
        Required on every public API call.

````