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

# Update an MCP connection

> Update bounded MCP configuration. Header and environment objects merge write-only values by key, null values remove individual keys, and a null environment clears all variables. Hidden credentials are preserved unless explicitly changed or authentication is replaced; changing a remote server URL clears credentials for the old server. Call authorize explicitly after changing the server or authentication to reconnect.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public patch /v1/mcp-connections/{mcpConnectionId}
openapi: 3.1.0
info:
  title: Tembo Public API
  description: Public API Endpoints for Tembo
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/mcp-connections/{mcpConnectionId}:
    patch:
      tags:
        - MCP Connections
      summary: Update an MCP connection
      description: >-
        Update bounded MCP configuration. Header and environment objects merge
        write-only values by key, null values remove individual keys, and a null
        environment clears all variables. Hidden credentials are preserved
        unless explicitly changed or authentication is replaced; changing a
        remote server URL clears credentials for the old server. Call authorize
        explicitly after changing the server or authentication to reconnect.
      operationId: updateMcpConnection
      parameters:
        - in: path
          name: mcpConnectionId
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    name:
                      type: string
                      minLength: 1
                      maxLength: 200
                    serverUrl:
                      type: string
                      format: uri
                    type:
                      type: string
                      const: remote
                    authType:
                      type: string
                      enum:
                        - oauth
                        - client_credentials
                        - static_headers
                    clientId:
                      type: string
                      minLength: 1
                      maxLength: 4096
                    clientSecret:
                      type: string
                      minLength: 1
                      maxLength: 65536
                    headers:
                      type:
                        - object
                        - 'null'
                      propertyNames:
                        type: string
                        minLength: 1
                        maxLength: 256
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                        maxLength: 16384
                    oauthRegistration:
                      type: string
                      enum:
                        - automatic
                        - pre_registered
                    scope:
                      type: string
                      minLength: 1
                      maxLength: 4096
                  required:
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    command:
                      type: string
                      minLength: 1
                      maxLength: 4096
                    name:
                      type: string
                      minLength: 1
                      maxLength: 200
                    type:
                      type: string
                      const: stdio
                    args:
                      type:
                        - array
                        - 'null'
                      items:
                        type: string
                        maxLength: 8192
                      maxItems: 100
                    env:
                      type:
                        - object
                        - 'null'
                      propertyNames:
                        type: string
                        minLength: 1
                        maxLength: 256
                      additionalProperties:
                        type:
                          - string
                          - 'null'
                        maxLength: 16384
                  required:
                    - type
                  additionalProperties: false
      responses:
        '200':
          description: Update an MCP connection
          content:
            application/json:
              schema:
                type: object
                properties:
                  connectedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  serverUrl:
                    type:
                      - string
                      - 'null'
                  type:
                    type: string
                    enum:
                      - remote
                      - stdio
                  args:
                    type:
                      - array
                      - 'null'
                    items:
                      type: string
                      maxLength: 8192
                    maxItems: 100
                  authType:
                    type:
                      - string
                      - 'null'
                    enum:
                      - oauth
                      - client_credentials
                      - static_headers
                      - null
                  command:
                    type:
                      - string
                      - 'null'
                  createdAt:
                    type: string
                    format: date-time
                  envKeys:
                    type: array
                    items:
                      type: string
                  headerKeys:
                    type: array
                    items:
                      type: string
                  updatedAt:
                    type: string
                    format: date-time
                required:
                  - connectedAt
                  - id
                  - name
                  - serverUrl
                  - type
                  - args
                  - authType
                  - command
                  - createdAt
                  - envKeys
                  - headerKeys
                  - updatedAt
                additionalProperties: false
        '400':
          description: Validation error or missing resource scope
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: MCP connection not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: MCP connection conflict or unsupported action
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: MCP connection operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '502':
          description: The remote MCP server operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````