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

# Update an MCP server

> Changes an MCP server's settings. A field left out stays as it is. `auth` is replaced whole, `tools: []` exposes every tool, and `static_headers: {}` clears the headers. The instance must be `ready`; otherwise the request answers `409`.



## OpenAPI

````yaml /openapi/source/external/agent-gateway/agent-gateway.json patch /agent_gateways/{instance_id}/mcp_servers/{server_id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: Telnyx API
  x-latency-category: interactive
  x-endpoint-cost: light
  description: >-
    Agent Gateway authenticates, authorizes, and audits the requests agents send
    to models, tools, and other agents. Each gateway runs as a dedicated
    instance on the account's
    [*Network*](https://developers.telnyx.com/docs/network/overview). This API
    creates, lists, and deletes instances, and manages the keys, teams, spend
    logs, MCP servers, APIs, tool permissions, and guardrails on them. Each
    instance serves an OpenAI-compatible API at its `gateway_url`.
servers:
  - url: https://api.telnyx.com/v2
    description: Telnyx API v2
security:
  - bearerAuth: []
tags:
  - name: Agent Gateways
    description: Create, list, retrieve, and delete Agent Gateway instances.
  - name: Agent Gateway Keys
    description: Keys on an instance.
  - name: Agent Gateway Teams
    description: 'Teams on an instance: shared model lists, budgets, and rate limits.'
  - name: Agent Gateway Spend Logs
    description: The requests an instance served, with their cost.
  - name: Agent Gateway MCP Servers
    description: MCP servers on an instance, served to agents at one MCP endpoint.
  - name: Agent Gateway APIs
    description: REST APIs on an instance, served to agents as tools.
  - name: Agent Gateway Tool Permissions
    description: The MCP servers and tools a key or team may use.
  - name: Agent Gateway Guardrails
    description: Checks an instance runs on model and tool requests.
  - name: Agent Gateway Policies
    description: Named sets of guardrails an instance applies to requests.
  - name: Agent Gateway Policy Attachments
    description: Where an instance applies each policy.
paths:
  /agent_gateways/{instance_id}/mcp_servers/{server_id}:
    patch:
      tags:
        - Agent Gateway MCP Servers
      summary: Update an MCP server
      description: >-
        Changes an MCP server's settings. A field left out stays as it is.
        `auth` is replaced whole, `tools: []` exposes every tool, and
        `static_headers: {}` clears the headers. The instance must be `ready`;
        otherwise the request answers `409`.
      operationId: UpdateAgentGatewayMcpServer
      parameters:
        - name: instance_id
          in: path
          required: true
          description: The Agent Gateway's `id`.
          schema:
            type: string
            format: uuid
          example: 32ce035d-3165-4031-b1a7-a7c0c259590a
        - name: server_id
          in: path
          required: true
          description: The MCP server's `id`.
          schema:
            type: string
            format: uuid
          example: 88d5a97b-4080-4855-8bac-a39811b1dc24
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentGatewayMcpServerUpdate'
            examples:
              tools:
                summary: Expose two tools
                value:
                  tools:
                    - get_order
                    - create_ticket
      responses:
        '200':
          description: The updated MCP server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentGatewayMcpServerResponse'
              example:
                data:
                  id: 88d5a97b-4080-4855-8bac-a39811b1dc24
                  name: orders
                  url: http://10.40.3.7:9000/mcp
                  transport: http
                  auth:
                    type: api_key
                  tools:
                    - get_order
                    - create_ticket
                  static_headers:
                    X-Env: prod
                  forwarded_headers:
                    - X-Request-Id
                  open_to_every_key: false
                  created_at: '2026-10-28T16:50:43.184000Z'
                  updated_at: '2026-10-28T16:50:43.184000Z'
        '400':
          description: A name the instance already uses
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: '10012'
                    title: Duplicate resource
                    detail: Resource is a duplicate.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10012
                    source:
                      pointer: /name
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: >-
                      The required authentication headers were either invalid or
                      not included in the request.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: '10005'
                    title: Resource not found
                    detail: The requested resource or URL could not be found.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10005
        '409':
          description: The instance is not `ready`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: '99901'
                    title: Instance not ready
                    detail: The instance is not ready; its engine is not running.
        '422':
          description: A field fails validation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: '10027'
                    title: Unprocessable Entity
                    detail: The value is invalid.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10027
                    source:
                      pointer: /transport
        '502':
          description: The instance's engine did not answer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxErrors'
              example:
                errors:
                  - code: '99903'
                    title: Engine unavailable
                    detail: The instance's engine did not answer; try again shortly.
components:
  schemas:
    AgentGatewayMcpServerUpdate:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          pattern: ^[A-Za-z0-9_.]{1,100}$
          description: >-
            A name for the server, unique on the instance across MCP servers and
            APIs, regardless of case. Letters, digits, `_`, and `.`. The gateway
            prefixes the server's tools with it and a hyphen.
        url:
          type: string
          description: The server's MCP endpoint, `http` or `https`.
        transport:
          type: string
          enum:
            - http
            - sse
          default: http
          description: '`http` for Streamable HTTP, or `sse` for Server-Sent Events.'
        auth:
          oneOf:
            - $ref: '#/components/schemas/AgentGatewayNoAuth'
            - $ref: '#/components/schemas/AgentGatewayStaticAuth'
            - $ref: '#/components/schemas/AgentGatewayOAuthClientCredentials'
            - $ref: '#/components/schemas/AgentGatewayPassthroughAuth'
            - $ref: '#/components/schemas/AgentGatewayAwsSigV4Auth'
          description: >-
            How the gateway authenticates to the server. Replaced whole on an
            update; `{"type": "none"}` removes the credential.
        tools:
          type: array
          items:
            type: string
          description: >-
            The tools the server exposes to every key, by name. `[]` exposes
            every tool.
        static_headers:
          type: object
          additionalProperties:
            type: string
          description: Headers sent on every request.
        forwarded_headers:
          type: array
          items:
            type: string
          maxItems: 32
          description: Headers copied from the agent's request, by name.
        open_to_every_key:
          type: boolean
          default: false
          description: >-
            `true` lets every key on the instance use the server, granted or
            not.
      description: The fields to change. A field left out stays as it is.
    AgentGatewayMcpServerResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/AgentGatewayMcpServer'
    TelnyxErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TelnyxError'
    AgentGatewayNoAuth:
      type: object
      title: No authentication
      description: The gateway sends no credential.
      properties:
        type:
          type: string
          const: none
    AgentGatewayStaticAuth:
      type: object
      title: API key
      required:
        - type
        - value
      description: >-
        A static credential the gateway sends on every request. Write-only:
        responses show its `type` only.
      properties:
        type:
          type: string
          enum:
            - api_key
            - bearer_token
            - basic
            - token
            - authorization
          description: >-
            How the credential is sent: `api_key` as `X-API-Key: <value>`,
            `bearer_token` as `Authorization: Bearer <value>`, `basic` as
            `Authorization: Basic <base64 of value>` with `value` in the form
            `user:password`, `token` as `Authorization: token <value>`, and
            `authorization` as `Authorization: <value>`.
        value:
          type: string
          writeOnly: true
          description: The credential.
        header:
          type:
            - string
            - 'null'
          description: A header name that replaces `X-API-Key` or `Authorization`.
    AgentGatewayOAuthClientCredentials:
      type: object
      title: OAuth client credentials
      required:
        - type
        - token_url
        - client_id
        - client_secret
      description: >-
        The gateway gets its own access token with the `client_credentials`
        grant and sends it as a bearer token on every request, renewing it
        before it expires. The client ID and secret are write-only.
      properties:
        type:
          type: string
          const: oauth_client_credentials
        token_url:
          type: string
          description: The OAuth provider's token endpoint.
        client_id:
          type: string
          writeOnly: true
        client_secret:
          type: string
          writeOnly: true
        credentials_in:
          type: string
          enum:
            - body
            - basic
          default: body
          description: >-
            Whether the client ID and secret go in the token request's body or
            as HTTP Basic authentication.
        scopes:
          type: array
          items:
            type: string
          description: The scopes to request.
        audience:
          type:
            - string
            - 'null'
          description: The token's audience, sent in the token request.
        resource:
          type:
            - string
            - 'null'
          description: The resource the token is for, sent in the token request.
    AgentGatewayPassthroughAuth:
      type: object
      title: Token passthrough
      description: >-
        The gateway forwards the agent's own `Authorization` header to the
        server unchanged.
      properties:
        type:
          type: string
          const: passthrough
    AgentGatewayAwsSigV4Auth:
      type: object
      title: AWS Signature Version 4
      required:
        - type
        - region
      description: >-
        The gateway signs each request with AWS Signature Version 4. Without
        keys or a role, it uses the instance's own AWS identity. Keys are
        write-only.
      properties:
        type:
          type: string
          const: aws_sigv4
        region:
          type: string
          description: The AWS region to sign for.
        service:
          type: string
          default: bedrock-agentcore
          description: The AWS service to sign for.
        access_key_id:
          type:
            - string
            - 'null'
          writeOnly: true
        secret_access_key:
          type:
            - string
            - 'null'
          writeOnly: true
        session_token:
          type:
            - string
            - 'null'
          writeOnly: true
        role_name:
          type:
            - string
            - 'null'
          description: The ARN of a role for the gateway to assume.
    AgentGatewayMcpServer:
      type: object
      required:
        - id
        - name
        - url
        - transport
        - auth
        - tools
        - static_headers
        - forwarded_headers
        - open_to_every_key
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Identifies the server.
        name:
          type: string
          description: >-
            A name for the server, unique on the instance across MCP servers and
            APIs, regardless of case. Letters, digits, `_`, and `.`. The gateway
            prefixes the server's tools with it and a hyphen.
        url:
          type: string
          description: The server's MCP endpoint.
        transport:
          type: string
          enum:
            - http
            - sse
          description: '`http` for Streamable HTTP, or `sse` for Server-Sent Events.'
        auth:
          $ref: '#/components/schemas/AgentGatewayShownAuth'
        tools:
          type: array
          items:
            type: string
          description: >-
            The tools the server exposes to every key, by name. `[]` exposes
            every tool.
        static_headers:
          type: object
          additionalProperties:
            type: string
          description: Headers sent on every request.
        forwarded_headers:
          type: array
          items:
            type: string
          maxItems: 32
          description: Headers copied from the agent's request, by name.
        open_to_every_key:
          type: boolean
          default: false
          description: >-
            `true` lets every key on the instance use the server, granted or
            not.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
    TelnyxError:
      type: object
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              type: string
            parameter:
              type: string
        meta:
          type: object
          properties:
            url:
              type: string
    AgentGatewayShownAuth:
      type: object
      description: >-
        The server's outbound authentication method. Credentials are never
        returned.
      properties:
        type:
          type: string
          description: The method's `type`.
      required:
        - type
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Telnyx API key

````