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

# Create a new version of an MCP server

> **Security Requirements**

| Auth Types | Entities | Permissions | Required Roles |
|------------|----------|-------------|----------------|
| USER | MCP_REGISTRY | WRITE | MCP_REGISTRY:WRITE |



## OpenAPI

````yaml /openapi/swarmd.json put /registry/v1/mcp-servers/{mcpServerId}/versions
openapi: 3.1.0
info:
  title: Relay
  version: v0
servers:
  - url: https://api.dev.swarmd.ai
    description: Development
security: []
tags:
  - name: Policy Groups
    x-displayName: Policy Groups
  - name: Policy Bindings
    x-displayName: Policy Bindings
  - name: Evaluation Packs
    x-displayName: Evaluation Packs
  - name: Webhooks
    x-displayName: Webhooks
  - name: MCP JSON-RPC
    x-displayName: MCP JSON-RPC
  - name: Conversations
    x-displayName: Conversations
  - name: Human JSON-RPC
    x-displayName: Human JSON-RPC
  - name: Channel JSON-RPC
    x-displayName: Channel JSON-RPC
  - name: HITL Approvals
    x-displayName: HITL Approvals
  - name: Agent JSON-RPC
    x-displayName: Agent JSON-RPC
  - name: Tasks
    x-displayName: Tasks
  - name: Push Notifications
    x-displayName: Push Notifications
  - name: Messaging
    x-displayName: Messaging
  - name: LLM Runtime
    x-displayName: LLM Runtime
  - name: Agent Discovery
    x-displayName: Agent Discovery
  - name: MCP Servers
    x-displayName: MCP Servers
  - name: LLM Gateways
    x-displayName: LLM Gateways
  - name: Agents
    x-displayName: Agents
  - name: User Subscriptions
    x-displayName: User Subscriptions
  - name: LLM Providers
    x-displayName: LLM Providers
  - name: LLM Gateway Subscriptions
    x-displayName: LLM Gateway Subscriptions
  - name: Kill Switches
    x-displayName: Kill Switches
  - name: Channels
    x-displayName: Channels
  - name: Channel Subscriptions
    x-displayName: Channel Subscriptions
  - name: Agent Subscriptions
    x-displayName: Agent Subscriptions
  - name: Marketplace
    x-displayName: Marketplace
  - name: Identity Providers
    x-displayName: Identity Providers
  - name: Groups
    x-displayName: Groups
  - name: Authentication
    x-displayName: Authentication
  - name: Users
    x-displayName: Users
  - name: Tenants
    x-displayName: Tenants
  - name: mcp-consent-controller
    x-displayName: mcp-consent-controller
  - name: Audit Monitors
    x-displayName: Audit Monitors
  - name: Audit Integrity
    x-displayName: Audit Integrity
  - name: Audit Events
    x-displayName: Audit Events
  - name: Audit Traces
    x-displayName: Audit Traces
  - name: audit-rest-controller
    x-displayName: audit-rest-controller
  - name: Audit Dashboard
    x-displayName: Audit Dashboard
  - name: A2A Payments
    x-displayName: A2A Payments
paths:
  /registry/v1/mcp-servers/{mcpServerId}/versions:
    put:
      tags:
        - MCP Servers
      summary: Create a new version of an MCP server
      description: |-
        **Security Requirements**

        | Auth Types | Entities | Permissions | Required Roles |
        |------------|----------|-------------|----------------|
        | USER | MCP_REGISTRY | WRITE | MCP_REGISTRY:WRITE |
      operationId: editMcpServer
      parameters:
        - name: mcpServerId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Registry_EditMcpServerRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Registry_McpServerResponse'
      security:
        - Registry_bearerAuth: []
components:
  schemas:
    Registry_EditMcpServerRequest:
      type: object
      properties:
        version:
          type: string
          description: New version (must be strictly greater than the current head)
        reason:
          type: string
          description: Optional explanation of why this edit was made
        name:
          type: string
        description:
          type: string
        serverUrl:
          type: string
        visibility:
          type: string
          enum:
            - PUBLIC
            - INTERNAL
            - PRIVATE
        transport:
          type: string
          enum:
            - STREAMABLE_HTTP
            - SSE
            - REST
        healthCheckUrl:
          type: string
        documentationUrl:
          type: string
        openApiSpec:
          type: string
          description: >-
            Replacement OpenAPI 3.x document for kind=OPENAPI MCPs; ignored on
            inherit-from-predecessor when null, rejected for kind=REMOTE_PROXY
            MCPs.
        tags:
          type: array
          description: >-
            Optional user-defined tags; when omitted, tags are inherited from
            the current head version
          items:
            type: string
      required:
        - version
    Registry_McpServerResponse:
      type: object
      properties:
        mcpServerId:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        relayServerUrl:
          type: string
        serverUrl:
          type: string
        transport:
          type: string
          enum:
            - STREAMABLE_HTTP
            - SSE
            - REST
        protocolVersion:
          type: string
        visibility:
          type: string
          enum:
            - PUBLIC
            - INTERNAL
            - PRIVATE
        authDetails:
          oneOf:
            - $ref: '#/components/schemas/Registry_ApiKey'
            - $ref: '#/components/schemas/Registry_Bearer'
            - $ref: '#/components/schemas/Registry_None'
            - $ref: '#/components/schemas/Registry_OAuth2'
            - $ref: '#/components/schemas/Registry_OAuth2AuthCode'
            - $ref: '#/components/schemas/Registry_QueryParam'
        status:
          type: string
        subscriptionCount:
          type: integer
          format: int32
        metrics:
          $ref: '#/components/schemas/Registry_McpServerMetrics'
        kind:
          type: string
          enum:
            - REMOTE_PROXY
            - OPENAPI
        version:
          type: string
        versionCreatedAt:
          type: string
          format: date-time
    Registry_ApiKey:
      allOf:
        - $ref: '#/components/schemas/Registry_McpAuthDetails'
        - type: object
          properties:
            header:
              type: string
        - $ref: '#/components/schemas/Registry_SubscriptionAuthConfig'
        - type: object
          properties:
            apiKey:
              $ref: '#/components/schemas/Registry_ApiKeyConfig'
        - $ref: '#/components/schemas/Registry_McpAuthConfig'
        - type: object
          properties:
            apiKeyValue:
              type: string
              description: API key value.
            apiKeyHeader:
              type: string
              description: Header name for the API key, e.g. 'X-Api-Key'.
        - $ref: '#/components/schemas/Registry_SubscriptionAuthDetailsResponse'
        - type: object
          properties:
            apiKey:
              $ref: '#/components/schemas/Registry_ApiKeyCredentialsDTO'
      required:
        - scheme
    Registry_Bearer:
      allOf:
        - $ref: '#/components/schemas/Registry_McpAuthDetails'
        - $ref: '#/components/schemas/Registry_SubscriptionAuthConfig'
        - type: object
          properties:
            bearer:
              $ref: '#/components/schemas/Registry_BearerTokenConfig'
        - $ref: '#/components/schemas/Registry_McpAuthConfig'
        - type: object
          properties:
            bearerToken:
              type: string
              description: Bearer token.
        - $ref: '#/components/schemas/Registry_SubscriptionAuthDetailsResponse'
        - type: object
          properties:
            bearerToken:
              type: string
      required:
        - scheme
    Registry_None:
      allOf:
        - $ref: '#/components/schemas/Registry_McpAuthDetails'
        - $ref: '#/components/schemas/Registry_SubscriptionAuthConfig'
        - $ref: '#/components/schemas/Registry_McpAuthConfig'
        - $ref: '#/components/schemas/Registry_SubscriptionAuthDetailsResponse'
      required:
        - scheme
    Registry_OAuth2:
      allOf:
        - $ref: '#/components/schemas/Registry_McpAuthDetails'
        - type: object
          properties:
            clientId:
              type: string
            tokenUrl:
              type: string
            scopes:
              type: array
              items:
                type: string
        - $ref: '#/components/schemas/Registry_SubscriptionAuthConfig'
        - type: object
          properties:
            oauth2:
              $ref: '#/components/schemas/Registry_OAuth2Config'
        - $ref: '#/components/schemas/Registry_SubscriptionAuthDetailsResponse'
        - type: object
          properties:
            oauth2:
              $ref: '#/components/schemas/Registry_OAuth2CredentialsDTO'
      required:
        - scheme
    Registry_OAuth2AuthCode:
      allOf:
        - $ref: '#/components/schemas/Registry_McpAuthDetails'
        - type: object
          properties:
            clientId:
              type: string
            authorizationUrl:
              type: string
            tokenUrl:
              type: string
            scopes:
              type: array
              items:
                type: string
            authorized:
              type: boolean
            reauthRequired:
              type: boolean
      required:
        - scheme
    Registry_QueryParam:
      allOf:
        - $ref: '#/components/schemas/Registry_McpAuthDetails'
        - type: object
          properties:
            name:
              type: string
        - $ref: '#/components/schemas/Registry_SubscriptionAuthConfig'
        - type: object
          properties:
            queryParam:
              $ref: '#/components/schemas/Registry_QueryParamConfig'
        - $ref: '#/components/schemas/Registry_McpAuthConfig'
        - type: object
          properties:
            queryParamName:
              type: string
              description: Query parameter name, e.g. 'api_key'.
            queryParamValue:
              type: string
              description: Query parameter value/token.
        - $ref: '#/components/schemas/Registry_SubscriptionAuthDetailsResponse'
        - type: object
          properties:
            queryParam:
              $ref: '#/components/schemas/Registry_QueryParamCredentialsDTO'
      required:
        - scheme
    Registry_McpServerMetrics:
      type: object
      properties:
        requestCount:
          type: integer
          format: int64
        errorPercentage:
          type: number
          format: double
        avgLatencyMs:
          type: number
          format: double
    Registry_McpAuthDetails:
      type: object
      description: >-
        Non-secret view of the credentials stored for an MCP server. Secret
        values are never returned.
      discriminator:
        propertyName: scheme
      properties:
        scheme:
          type: string
          description: Auth scheme stored for the MCP server.
          enum:
            - NONE
            - BEARER
            - API_KEY
            - QUERY_PARAM
            - OAUTH2_CLIENT_CREDENTIALS
            - OAUTH2_AUTHORIZATION_CODE
      required:
        - scheme
    Registry_SubscriptionAuthConfig:
      type: object
      description: Authentication configuration for a subscription.
      discriminator:
        propertyName: authType
      properties:
        authType:
          type: string
          enum:
            - NONE
            - OAUTH2
            - API_KEY
            - BEARER
            - QUERY_PARAM
      required:
        - authType
    Registry_ApiKeyConfig:
      type: object
      properties:
        apiKeyValue:
          type: string
        apiKeyHeader:
          type: string
    Registry_McpAuthConfig:
      type: object
      description: >-
        Outbound credentials supplied by the tenant at registration / rotation
        time. Secret fields are persisted encrypted at rest and never returned
        in responses.
      discriminator:
        propertyName: scheme
      properties:
        scheme:
          type: string
          description: Auth scheme used when calling the MCP server.
          enum:
            - NONE
            - BEARER
            - API_KEY
            - QUERY_PARAM
            - OAUTH2_CLIENT_CREDENTIALS
            - OAUTH2_AUTHORIZATION_CODE
      required:
        - scheme
    Registry_SubscriptionAuthDetailsResponse:
      type: object
      description: >-
        Resolved auth credentials for a subscription. Secret values are
        encrypted at rest.
      discriminator:
        propertyName: authType
      properties:
        authType:
          type: string
      required:
        - authType
    Registry_ApiKeyCredentialsDTO:
      type: object
      properties:
        header:
          type: string
        value:
          type: string
    Registry_BearerTokenConfig:
      type: object
      properties:
        token:
          type: string
    Registry_OAuth2Config:
      type: object
      properties:
        clientId:
          type: string
        clientSecret:
          type: string
        tokenUrl:
          type: string
        scopes:
          type: array
          items:
            type: string
    Registry_OAuth2CredentialsDTO:
      type: object
      properties:
        clientId:
          type: string
        clientSecret:
          type: string
        tokenUrl:
          type: string
        scopes:
          type: array
          items:
            type: string
        accessToken:
          type: string
        tokenExpiresAt:
          type: string
          format: date-time
        refreshToken:
          type: string
    Registry_QueryParamConfig:
      type: object
      properties:
        queryParamName:
          type: string
        queryParamValue:
          type: string
    Registry_QueryParamCredentialsDTO:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
  securitySchemes:
    Registry_bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token (USER, AGENT, or SERVICE auth)

````