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

> Updates an existing MCP server by its slug. Use this endpoint to modify an MCP server's configuration or connection details.

# Update MCP Server

For the complete error reference, see [Error Guide](/rest-api/ai-agents-apis/error-codes).


## OpenAPI

````yaml patch /ai-agents/agent-builder/mcp-servers/{slug}
openapi: 3.0.0
info:
  title: AI Agents APIs
  description: API reference for CometChat AI Agents service
  version: '1.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: ai-agent
    description: ''
paths:
  /ai-agents/agent-builder/mcp-servers/{slug}:
    patch:
      tags:
        - Agent Builder MCP Servers
      summary: Update MCP Server
      description: >-
        Updates an existing MCP server by its slug. Use this endpoint to modify
        an MCP server's configuration or connection details.
      operationId: McpServersController_updateMcpServer
      parameters:
        - name: slug
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMcpServerDto'
      responses:
        '200':
          description: MCP server updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  _id:
                    type: string
                    example: myapp_my-mcp-server
                  appId:
                    type: string
                    example: my-app-id
                  slug:
                    type: string
                    example: my-mcp-server
                  name:
                    type: string
                    example: My MCP Server
                  description:
                    type: string
                    example: A Model Context Protocol server
                  url:
                    type: string
                    example: https://mcp.example.com/sse
                  icon:
                    type: string
                    example: https://example.com/icon.png
                  createdAt:
                    type: number
                    example: 1700000000000
                  updatedAt:
                    type: number
                    example: 1700000000000
      security:
        - apiKey: []
components:
  schemas:
    UpdateMcpServerDto:
      type: object
      properties:
        name:
          type: string
          description: Updated name of the MCP server (human readable)
          example: Weather Server
        description:
          type: string
          description: Updated description of the MCP server
          example: Provides weather data for cities
        url:
          type: string
          description: Updated URL of the MCP server
          example: http://localhost:3002
        icon:
          type: string
          description: Updated icon for the MCP server
          example: http://localhost:3002/icon.png
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````