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

# Connect MCP Server

> Open a live connection to the MCP server and refresh its stored capabilities and tool list. Returns a ConnectResult with the connection status, round-trip latency, reported server info, protocol version, discovered tools, an event log, and any error. Secret values are scrubbed from the result.



## OpenAPI

````yaml /api-reference/agents/mcp.oas.yaml post /v1/agents/mcp-servers/{server_id}/connect
openapi: 3.1.0
info:
  title: SLNG Agent Resources — MCP servers
  version: 1.0.0
  description: >-
    Public API for organisation tools, MCP servers, Vault entries, and BYOK
    client models.
  contact:
    name: SLNG Support
    email: support@slng.ai
servers:
  - url: https://api.agents.slng.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/agents/mcp-servers/{server_id}/connect:
    post:
      summary: Connect MCP Server
      description: >-
        Open a live connection to the MCP server and refresh its stored
        capabilities and tool list. Returns a ConnectResult with the connection
        status, round-trip latency, reported server info, protocol version,
        discovered tools, an event log, and any error. Secret values are
        scrubbed from the result.
      operationId: connectMcp
      parameters:
        - name: server_id
          in: path
          required: true
          description: >-
            UUID of the MCP server to probe. A server in another organisation or
            one that is soft-deleted returns 404.
          schema:
            type: string
            format: uuid
            title: Server Id
      responses:
        '200':
          description: The connection probe result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectResult'
              example:
                status: connected
                latency_ms: 142
                server_info:
                  name: example-mcp
                protocol_version: '2025-06-18'
                capabilities:
                  tools:
                    - name: search
                      description: Search the crawl index
                      input_schema:
                        type: object
                      schema_hash: >-
                        9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
                  truncated: false
                  pages_fetched: 1
                events:
                  - direction: sent
                    method: initialize
                    ts: '2026-08-01T12:00:00Z'
                    summary: Opened connection
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          $ref: '#/components/responses/ConflictError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ConnectResult:
      description: >-
        Outcome of a live connection probe, including the connection status,
        round-trip latency, reported server info and protocol version,
        discovered capabilities, an ordered event log, and any error. Secret
        values are scrubbed.
      properties:
        status:
          type: string
          enum:
            - connected
            - failed
          title: Status
        latency_ms:
          type: integer
          title: Latency Ms
        server_info:
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          title: Server Info
        protocol_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Protocol Version
        capabilities:
          anyOf:
            - $ref: '#/components/schemas/McpCapabilities'
            - type: 'null'
        events:
          items:
            $ref: '#/components/schemas/McpEvent'
          type: array
          title: Events
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      additionalProperties: false
      type: object
      required:
        - status
        - latency_ms
      title: ConnectResult
    McpCapabilities:
      description: >-
        Tools discovered from the MCP server, with flags for whether discovery
        was truncated and how many pages were fetched.
      properties:
        tools:
          items:
            $ref: '#/components/schemas/McpTool'
          type: array
          title: Tools
        truncated:
          type: boolean
          title: Truncated
          default: false
        pages_fetched:
          type: integer
          minimum: 0
          title: Pages Fetched
          default: 0
      additionalProperties: false
      type: object
      title: McpCapabilities
    McpEvent:
      description: >-
        One entry in the connection probe log, recording a single sent,
        received, or error message with its method, timestamp, and a short
        summary.
      properties:
        direction:
          type: string
          enum:
            - sent
            - received
            - error
          title: Direction
        method:
          type: string
          title: Method
        ts:
          type: string
          title: Ts
        summary:
          type: string
          title: Summary
      additionalProperties: false
      type: object
      required:
        - direction
        - method
        - ts
        - summary
      title: McpEvent
    ApiErrorResponse:
      type: object
      description: Error envelope returned when a request fails.
      required:
        - detail
        - error
      properties:
        detail:
          type: string
        error:
          $ref: '#/components/schemas/ApiErrorDetail'
    McpTool:
      description: >-
        A tool exposed by the MCP server, with its input and output JSON schemas
        and a hash used to detect schema drift.
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        input_schema:
          additionalProperties: true
          type: object
          title: Input Schema
        output_schema:
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          title: Output Schema
        schema_hash:
          type: string
          pattern: ^[0-9a-f]{64}$
          title: Schema Hash
      additionalProperties: false
      type: object
      required:
        - name
        - schema_hash
      title: McpTool
    ApiErrorDetail:
      type: object
      description: >-
        Machine-readable error detail with a stable code, a human-readable
        message, and optional field-level entries.
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable machine-readable error code.
        message:
          type: string
        request_id:
          type:
            - string
            - 'null'
        retryable:
          type: boolean
        fields:
          type: array
          items:
            type: object
            additionalProperties: true
  responses:
    UnauthorizedError:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    ForbiddenError:
      description: >-
        The caller cannot perform this operation, or public resource access is
        disabled for the organisation. Disabled access returns code
        PUBLIC_SHARED_RESOURCES_DISABLED with retryable set to false.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    NotFoundError:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    ConflictError:
      description: The requested change conflicts with the current resource state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    RateLimitError:
      description: The organisation's request limit was exceeded.
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    InternalServerError:
      description: The operation failed. The response does not expose secret values.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: SLNG API key
      description: Your SLNG consumer API key.

````