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

# Connect an MCP server

> Connects an external MCP server. Only remote transports are
supported (`sse`, `streamable_http`) — there is no way to run a local
subprocess-based (stdio) server. Pass an `Idempotency-Key` header to
safely retry this request. For `auth_type: "oauth2"`, supply
`oauth_config` (client_id/client_secret/authorization_url/token_url/
scopes) here, then complete
`POST /mcp-servers/{mcp_server_id}/oauth/authorize` to get a URL for the
dev to open in a browser and finish the provider's consent screen —
the server isn't actually usable until that completes.



## OpenAPI

````yaml /openapi.json post /api/v1/mcp-servers
openapi: 3.1.0
info:
  title: Eclatira API
  description: >-
    Programmatically create calls and batches, manage agents/tools/knowledge,
    and retrieve conversation analytics.
  contact:
    name: Eclatira Support
    email: contact@eclatira.com
  version: 1.0.0
servers:
  - url: https://app.eclatira.com
    description: API Server
security: []
tags:
  - name: developer-api
    description: >-
      The API-key-authenticated developer surface: calls, batches, and agents.
      Authenticate with `Authorization: Bearer ek_...`.
  - name: Calls
    description: Place outbound calls with an agent, check status, list history.
  - name: Batches
    description: 'Outbound call campaigns: create, list, inspect, cancel, retry.'
  - name: Agents
    description: Create and manage the agents that place and receive calls.
  - name: Tools
    description: Custom actions an agent can call mid-call, attached per-agent.
  - name: MCP Servers
    description: >-
      Connect an agent to an external MCP (Model Context Protocol) server so it
      can call that server's tools, with static or OAuth auth.
  - name: Knowledge Base
    description: Upload files and index them into an agent's knowledge base.
  - name: Realtime
    description: >-
      Mint a short-lived session token to open a live voice/video WebSocket
      connection: the only supported way for an API-key holder to authenticate
      into /ws/{user_id}.
  - name: Webhooks
    description: >-
      Register a durable callback URL to receive call.completed and
      batch.completed events for every matching workspace event, and fetch the
      tenant signing secret used to verify X-Webhook-Signature.
  - name: developer-api-keys
    description: >-
      Account-management routes (create/list/revoke API keys), authenticated via
      dashboard login, not an API key, since they mint the credentials the rest
      of the developer API uses.
paths:
  /api/v1/mcp-servers:
    post:
      tags:
        - MCP Servers
        - developer-api
      summary: Connect an MCP server
      description: |-
        Connects an external MCP server. Only remote transports are
        supported (`sse`, `streamable_http`) — there is no way to run a local
        subprocess-based (stdio) server. Pass an `Idempotency-Key` header to
        safely retry this request. For `auth_type: "oauth2"`, supply
        `oauth_config` (client_id/client_secret/authorization_url/token_url/
        scopes) here, then complete
        `POST /mcp-servers/{mcp_server_id}/oauth/authorize` to get a URL for the
        dev to open in a browser and finish the provider's consent screen —
        the server isn't actually usable until that completes.
      operationId: createMcpServer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1CreateMcpServerRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1McpServerResponse'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1ErrorResponse'
          description: Unprocessable Content
      security:
        - ApiKeyAuth: []
components:
  schemas:
    V1CreateMcpServerRequest:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
          default: ''
        transport:
          type: string
          enum:
            - sse
            - streamable_http
          title: Transport
        url:
          type: string
          title: Url
        auth_type:
          type: string
          enum:
            - none
            - static
            - oauth2
          title: Auth Type
          default: none
        static_auth:
          anyOf:
            - $ref: '#/components/schemas/V1McpStaticAuthInput'
            - type: 'null'
        oauth_config:
          anyOf:
            - $ref: '#/components/schemas/V1McpOAuthConfigInput'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - name
        - transport
        - url
      title: V1CreateMcpServerRequest
    V1McpServerResponse:
      properties:
        mcp_server_id:
          type: string
          title: Mcp Server Id
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        transport:
          type: string
          title: Transport
        url:
          type: string
          title: Url
        auth_type:
          type: string
          title: Auth Type
        static_auth:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Static Auth
        oauth_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Oauth Config
        enabled:
          type: boolean
          title: Enabled
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        last_tested_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Tested At
        last_test_status:
          anyOf:
            - type: string
              enum:
                - ok
                - error
            - type: 'null'
          title: Last Test Status
        last_test_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Test Error
        last_test_tool_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last Test Tool Count
        last_test_tool_names:
          items:
            type: string
          type: array
          title: Last Test Tool Names
          default: []
      type: object
      required:
        - mcp_server_id
        - name
        - description
        - transport
        - url
        - auth_type
        - enabled
      title: V1McpServerResponse
    V1ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/V1ErrorDetail'
      type: object
      required:
        - error
      title: V1ErrorResponse
      description: |-
        The error envelope every `developer-api`-tagged route returns for
        non-2xx responses, including `422`; this overrides FastAPI's default
        validation-error shape.
    V1McpStaticAuthInput:
      properties:
        header_name:
          type: string
          title: Header Name
          default: Authorization
        header_value:
          type: string
          format: password
          title: Header Value
          writeOnly: true
      additionalProperties: false
      type: object
      required:
        - header_value
      title: V1McpStaticAuthInput
    V1McpOAuthConfigInput:
      properties:
        client_id:
          type: string
          title: Client Id
        client_secret:
          type: string
          format: password
          title: Client Secret
          writeOnly: true
        authorization_url:
          type: string
          title: Authorization Url
        token_url:
          type: string
          title: Token Url
        scopes:
          items:
            type: string
          type: array
          title: Scopes
          default: []
      additionalProperties: false
      type: object
      required:
        - client_id
        - client_secret
        - authorization_url
        - token_url
      title: V1McpOAuthConfigInput
      description: |-
        Only the pre-authorization fields a dev supplies to connect an OAuth2
        MCP server. access_token/refresh_token/expires_at are never client
        input — they're populated by the /oauth/authorize + /oauth/callback
        flow (see api/v1/_mcp_servers.py) and preserved across a later update.
    V1ErrorDetail:
      properties:
        type:
          type: string
          title: Type
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
      type: object
      required:
        - type
        - code
        - message
      title: V1ErrorDetail
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        A long-lived, privileged API key (`ek_...` prefix), minted once from the
        dashboard. Intended for trusted server-side use only; never expose it in
        client-side code. Send as `Authorization: Bearer ek_...`. Required by
        every Calls, Batches, Agents, Tools, MCP Servers, Documents, and
        Realtime route.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.