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

# Create connection

> Create a new MCP connection with an auto-generated ID. Requires API key and namespace ownership.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /connect/{namespace}
openapi: 3.1.0
info:
  title: Smithery Platform API
  description: >-
    API for the Smithery platform — discover, deploy, and manage MCP (Model
    Context Protocol) servers. Provides endpoints for browsing the server
    registry, managing deployments, creating scoped access tokens, and
    connecting to MCP servers.
  version: 1.0.0
servers:
  - url: https://api.smithery.ai
security:
  - bearerAuth: []
tags:
  - name: servers
    description: >-
      Browse the MCP server registry, manage server configuration, and handle
      deployments
  - name: skills
    description: Discover and search reusable prompt-based skills for MCP servers
  - name: tools
    description: Search for MCP tools across all registered servers
paths:
  /connect/{namespace}:
    post:
      tags:
        - connect
      summary: Create connection
      description: >-
        Create a new MCP connection with an auto-generated ID. Requires API key
        and namespace ownership.
      operationId: postSmithery.run:namespace
      parameters:
        - schema:
            type: string
          in: path
          name: namespace
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConnectionRequest'
      responses:
        '201':
          description: Connection created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '404':
          description: Namespace not found or access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateConnectionRequest:
      type: object
      properties:
        transport:
          description: >-
            Connection transport. Use `uplink` for a local server paired over
            Smithery CLI.
          example: http
          type: string
          enum:
            - http
            - uplink
        mcpUrl:
          description: >-
            URL of a custom MCP server. For Smithery registry servers, prefer
            `server`.
          example: https://mcp.example.com/sse
          type: string
          format: uri
        server:
          description: >-
            Smithery registry server qualified name. Use this instead of mcpUrl
            for registry servers.
          example: upstash/context7-mcp
          type: string
          minLength: 1
          maxLength: 255
          pattern: ^@?[a-zA-Z0-9][a-zA-Z0-9_-]*(?:\/[a-zA-Z0-9][a-zA-Z0-9_-]*)?$
        source:
          type: object
          properties:
            kind:
              type: string
              const: module
            entrypoint:
              type: string
              minLength: 1
              maxLength: 255
            sourceFiles:
              minItems: 1
              maxItems: 16
              type: array
              items:
                type: object
                properties:
                  path:
                    type: string
                    minLength: 1
                    maxLength: 255
                  contents:
                    type: string
                    maxLength: 131072
                required:
                  - path
                  - contents
                additionalProperties: false
          required:
            - kind
            - entrypoint
            - sourceFiles
          additionalProperties: false
        name:
          description: Human-readable name (optional, defaults to connection ID)
          example: My MCP Server
          type: string
          minLength: 1
          maxLength: 255
        metadata:
          description: Custom metadata for filtering connections
          example:
            userId: user123
            team: engineering
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
        headers:
          description: >-
            Custom headers to send with MCP requests (stored securely, not
            returned in responses)
          example:
            X-API-Key: secret-key
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: string
        mock:
          $ref: '#/components/schemas/MockConfig'
          description: >-
            Run this connection in mock mode. Tool calls are LLM-simulated
            against the registry's scanned schemas and never reach the upstream
            server. Provide an optional `scenario` to seed the simulator with a
            starting-state description. Registry servers only; frozen at
            creation (cannot be toggled via PUT).
          example:
            enabled: true
            scenario: A developer inbox with 3 unread Q4 planning threads.
      additionalProperties: false
    Connection:
      type: object
      properties:
        connectionId:
          type: string
          description: Connection ID (auto-generated or developer-defined)
          example: clever-dolphin-a9X3
        name:
          type: string
          description: Human-readable name
        transport:
          description: Connection transport
          type: string
          enum:
            - http
            - uplink
        mcpUrl:
          anyOf:
            - type: string
            - type: 'null'
          description: MCP server URL. Null for uplink connections.
        metadata:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties: {}
            - type: 'null'
        mock:
          $ref: '#/components/schemas/MockConfig'
          description: >-
            Mock-mode config: `{enabled: true, scenario?}` when LLM-simulated,
            absent otherwise.
        iconUrl:
          anyOf:
            - type: string
            - type: 'null'
        createdAt:
          description: ISO 8601 timestamp
          type: string
        status:
          $ref: '#/components/schemas/ConnectionStatus'
          description: Last known connection status
        serverInfo:
          $ref: '#/components/schemas/ServerInfo'
          description: Server information from MCP initialization (name, version)
      required:
        - connectionId
        - name
        - mcpUrl
        - metadata
      additionalProperties: false
    ValidationError:
      type: object
      properties:
        error:
          type: string
          const: validation_error
        message:
          type: string
          example: Invalid request
      required:
        - error
        - message
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: string
          example: not_found
        message:
          type: string
          example: Resource not found
      required:
        - error
        - message
      additionalProperties: false
    MockConfig:
      type: object
      properties:
        enabled:
          type: boolean
          description: Turn mock mode on for this connection.
        scenario:
          description: >-
            Natural-language starting-state for the simulator (threaded into the
            LLM system prompt so generated data is consistent with the scenario
            across calls).
          example: >-
            Slack workspace with an active #community-ops channel containing
            recent event-planning messages, plus 50 Airtable candidate records
            with mixed tenure and interests.
          type: string
      required:
        - enabled
      additionalProperties: false
      id: MockConfig
    ConnectionStatus:
      oneOf:
        - type: object
          properties:
            state:
              type: string
              const: connected
          required:
            - state
          additionalProperties: false
          title: ConnectionStatusConnected
        - type: object
          properties:
            state:
              type: string
              const: disconnected
          required:
            - state
          additionalProperties: false
          title: ConnectionStatusDisconnected
        - type: object
          properties:
            state:
              type: string
              const: auth_required
            setupUrl:
              description: Hosted Smithery URL for completing setup and OAuth
              type: string
              format: uri
            authorizationUrl:
              description: Deprecated compatibility alias for setupUrl
              deprecated: true
              type: string
              format: uri
          required:
            - state
          additionalProperties: false
          title: ConnectionStatusAuthRequired
        - type: object
          properties:
            state:
              type: string
              const: input_required
            setupUrl:
              description: Hosted Smithery URL for completing setup in the browser
              type: string
              format: uri
            http:
              $ref: '#/components/schemas/CredentialProfileHttp'
            missing:
              type: object
              properties:
                headers:
                  type: array
                  items:
                    type: string
                query:
                  type: array
                  items:
                    type: string
              required:
                - headers
                - query
              additionalProperties: false
          required:
            - state
            - http
            - missing
          additionalProperties: false
          title: ConnectionStatusInputRequired
        - type: object
          properties:
            state:
              type: string
              const: error
            message:
              type: string
              description: Error message
          required:
            - state
            - message
          additionalProperties: false
          title: ConnectionStatusError
    ServerInfo:
      type: object
      properties:
        name:
          type: string
        title:
          type: string
        icons:
          type: array
          items:
            type: object
            properties:
              src:
                type: string
              mimeType:
                type: string
              sizes:
                type: array
                items:
                  type: string
              theme:
                type: string
                enum:
                  - light
                  - dark
            required:
              - src
            additionalProperties: false
        version:
          type: string
        websiteUrl:
          type: string
        description:
          type: string
      required:
        - name
        - version
      additionalProperties: false
    CredentialProfileHttp:
      type: object
      properties:
        headers:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/HttpInputField'
        query:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/HttpInputField'
      additionalProperties: false
      id: CredentialProfileHttp
    HttpInputField:
      type: object
      properties:
        label:
          type: string
        description:
          type: string
        required:
          type: boolean
      required:
        - label
      additionalProperties: false
      id: HttpInputField
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Smithery API key as Bearer token

````