> ## 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.

# Create MCP Server

> Create a new MCP server.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/ai/assistants.yml post /ai/mcp_servers
openapi: 3.1.0
info:
  title: Telnyx AI Assistants API
  version: 2.0.0
  description: >-
    API for managing AI Assistants, including CRUD fields, versions, tags,
    integrations, MCP servers, and shared tools.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ai/mcp_servers:
    post:
      tags:
        - MCP Servers
      summary: Create MCP Server
      description: Create a new MCP server.
      operationId: create_mcp_server
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMCPServerRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPServer'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const mcpServer = await client.ai.mcpServers.create({
              name: 'name',
              type: 'type',
              url: 'url',
            });

            console.log(mcpServer.id);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            mcp_server = client.ai.mcp_servers.create(
                name="name",
                type="type",
                url="url",
            )
            print(mcp_server.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmcpServer, err := client.AI.McpServers.New(context.TODO(), telnyx.AIMcpServerNewParams{\n\t\tName: \"name\",\n\t\tType: \"type\",\n\t\tURL:  \"url\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", mcpServer.ID)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.ai.mcpservers.McpServerCreateParams;
            import com.telnyx.sdk.models.ai.mcpservers.McpServerCreateResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    McpServerCreateParams params = McpServerCreateParams.builder()
                        .name("name")
                        .type("type")
                        .url("url")
                        .build();
                    McpServerCreateResponse mcpServer = client.ai().mcpServers().create(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            mcp_server = telnyx.ai.mcp_servers.create(name: "name", type:
            "type", url: "url")


            puts(mcp_server)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $mcpServer = $client->ai->mcpServers->create(
                name: 'name',
                type: 'type',
                url: 'url',
                allowedTools: ['string'],
                apiKeyRef: 'api_key_ref',
              );

              var_dump($mcpServer);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:mcp-servers create \
              --api-key 'My API Key' \
              --name name \
              --type type \
              --url url
components:
  schemas:
    CreateMCPServerRequest:
      type: object
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          title: Type
        url:
          type: string
          title: Url
        api_key_ref:
          type:
            - string
            - 'null'
          title: Api Key Ref
        allowed_tools:
          type:
            - array
            - 'null'
          items:
            type: string
          title: Allowed Tools
      required:
        - name
        - type
        - url
      title: CreateMCPServerRequest
    MCPServer:
      type: object
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        type:
          type: string
          title: Type
        url:
          type: string
          title: Url
        api_key_ref:
          type:
            - string
            - 'null'
          title: Api Key Ref
        allowed_tools:
          type:
            - array
            - 'null'
          items:
            type: string
          title: Allowed Tools
        created_at:
          type: string
          format: date-time
          title: Created At
      required:
        - id
        - name
        - type
        - url
        - created_at
      title: MCPServer
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````