Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex AI Studio
  • About Yandex AI Studio
  • Getting started with Model Gallery
  • Yandex Workflows
    • All guides
    • Disabling request logging
    • Getting an API key
        • Connecting an external MCP server
        • Creating an MCP server from a template
        • Creating an MCP server from scratch
      • Viewing information about an MCP server
      • Deleting an MCP server
  • Switching from the AI Assistant API to Responses API
  • Compatibility with OpenAI
  • Quotas and limits
  • Pricing policy
  • Access management
  • Audit Trails events
  • Public materials
  • Release notes
  • Terms and definitions
  1. Step-by-step guides
  2. MCP Hub
  3. Creating an MCP server
  4. Connecting an external MCP server

Connecting an external MCP server to MCP Hub

Written by
Yandex Cloud
Improved by
Danila N.
Updated at February 3, 2026

Note

This feature is at the Preview stage.

If you already have deployed an external MCP server, e.g., on smithery.ai, in Yandex Cloud Marketplace, or on a Yandex Compute Cloud VM, you can connect it to MCP Hub.

Tip

To access MCP servers in MCP Hub, you will also need the serverless.mcpGateways.invoker role or higher. To access external MCP servers and MCP servers created from a template, you will additionally need the serverless.mcpGateways.anonymousInvoker role or higher.

To add an existing external MCP server to MCP Hub:

Management console
cURL
  1. In the management console, select the folder for which your account has the serverless.mcpGateways.editor and iam.serviceAccounts.user roles or higher.

  2. Go to AI Studio.

  3. In the left-hand panel, select MCP servers and click Create MCP server. In the window that opens:

    1. Under Add method, select Connect.

    2. Under Tools, click Add tools, and in the window that opens:

      1. In the Transport field, select a transport method for communicating with the MCP server. Available types:

        • Streamable HTTP: State-of-the-art transport mechanism. Your AI agent will be able to get updates (events) from the server without a persistent HTTP connection.
        • HTTP with SSE: Legacy transport mechanism. Your AI agent will be able to get updates from the server over the same persistent HTTP connection.
      2. In the URL field, specify the external MCP server URL, e.g., https://mcp.example.com.

      3. In the Authorization type field, specify the authentication data to provide in requests:

        • Access token: To provide the access token in the request authorization header.

          To add additional headers to the request, click Add header.

        • No authorization: To skip authentication.

      4. Click Connect.

      5. In the Add tools window that opens, select the tools from the template to add to the new MCP server and click Add.

        Note

        One MCP server can contain up to 50 tools.

    3. Under Server parameters:

      1. In the Name field, enter a name for the new MCP server. Follow these naming requirements:

        • It must be from 2 to 63 characters long.
        • It can only contain lowercase Latin letters, numbers, and hyphens.
        • It must start with a letter and cannot end with a hyphen.
      2. Optionally, add a description and labels for the server you are creating by using the corresponding buttons.

      3. In the Access field, select the type of your new server:

        • Private: To build a private MCP server with the authentication-based access.
        • Public: To build a public MCP server that requires no authentication.
      4. In the Service account field, select the service account your MCP server will use to access Yandex Cloud services and resources. The service account should get the roles sufficient to access these resources and services.

      5. Optionally, enable Select network to specify a cloud network to host your MCP server instances.

      6. Optionally, turn on the Enable logging option and configure the logging settings to keep a log of the MCP server you are creating.

    4. Click Save.

Note

The example below demonstrates how to create a simple MCP server with a single tool. To create an MCP server with multiple tools, add the descriptions of these tools as separate JSON objects into the tools list. For more information about the parameters used to create an MCP server, see McpGateway.Create in the API reference.

  1. Get an IAM token, which is required for authentication.

  2. Save the IAM token to an environment variable:

    export IAM_TOKEN="<IAM_token_contents>"
    
  3. Create a file with the request body, e.g., body.json:

    body.json

    {
      "folderId": "<folder_ID>",
      "name": "<MCP_server_name>",
      "description": "<MCP_server_description>",
      "serviceAccountId": "<service_account_ID>",
      "public": "true|false",
      "tools": [
        {
          "name": "<tool_name>",
          "description": "<tool_description>",
          "inputJsonSchema": "<tool_JSON_schema>",
          "action": {
            "mcpCall": {
              "url": "<MCP_server_URL>",
              "toolCall": {
                "toolName": "<tool_name>",
                "parametersJson": "<input_parameters>"
              },
              "transport": "<transport_mechanism>",
              "unauthorized": {}
            }
          }
        }
      ]
    }
    

    Where:

    • folderId: ID of the folder the MCP server is created in. Make sure to assign the serverless.mcpGateways.editor and iam.serviceAccounts.user roles or higher for this folder to your account.

    • name: Name of the new MCP server. Follow these naming requirements:

      • It must be from 2 to 63 characters long.
      • It can only contain lowercase Latin letters, numbers, and hyphens.
      • It must start with a letter and cannot end with a hyphen.
    • description: Description of the new MCP server.

    • serviceAccountId: ID of the service account your MCP server will use to access Yandex Cloud services and resources. The service account should get the roles sufficient to access these resources and services.

    • public: Type of the new server. The possible values are:

      • true: To create a public MCP server.
      • false: To create a private MCP server.
    • tools: Description of the tools you add to the MCP server:

      • name: Tool name. Follow these naming requirements:

        • It must be from 2 to 63 characters long.
        • It can only contain lowercase Latin letters, numbers, and hyphens.
        • It must start with a letter and cannot end with a hyphen.
      • description: Tool description.

      • inputJsonSchema: JSON schema describing the tool's input parameters.

        JSON schema:

        {
          properties?: { [key: string]: object };
          required?: string[];
          type: "object";
        }
        
        JSON struture example
        {
          "type": "object",
          "properties": {
            "location": {
              "type": "string",
              "description": "City name or zip code"
            }
          },
          "required": ["location"]
        }
        
      • action.httpCall: Description of configuration parameters for connection to an external MCP server:

        • url: External MCP server URL, e.g., https://mcp.example.com.

        • toolName: Tool name. Follow these naming requirements:

          • It must be from 2 to 63 characters long.
          • It can only contain lowercase Latin letters, numbers, and hyphens.
          • It must start with a letter and cannot end with a hyphen.
        • parametersJson: Parameters fed into the tool, in jq template format.

        • transport: Transport mechanism type for interacting with the MCP server. Available types:

          • STREAMABLE: State-of-the-art transport mechanism. Your AI agent will be able to get updates (events) from the server without a persistent HTTP connection.
          • SSE: Legacy transport mechanism. Your AI agent will be able to get updates from the server over the same persistent HTTP connection.
        • "unauthorized": {}: Provide this value if the external MCP server does not require authentication. If authentication is required, provide either the authorization header or serviceAccount field in the request body instead of unauthorized. For more information, see McpGateway.Create in the API reference.

      Request body example
      {
        "folderId": "b1gt6g8ht345********",
        "name": "my-external-mcp-server",
        "description": "my sample external MCP-server",
        "serviceAccountId": "ajegtlf2q28a********",
        "public": "true",
        "tools": [
          {
            "name": "tool-name",
            "description": "tool description",
            "inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"City name or zip code\"}},\"required\":[\"location\"]}",
            "action": {
              "mcpCall": {
                "url": "https://mcp.example.com",
                "toolCall": {
                  "toolName": "tool-name",
                  "parametersJson": "//( . )"
                },
                "transport": "SSE",
                "unauthorized": {}
              }
            }
          }
        ]
      }
      
  4. Use the McpGateway.Create REST API method to create a new MCP server in the folder:

    curl \
      --request POST \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --data "@body.json" \
      "https://serverless-mcp-gateway.api.cloud.yandex.net/mcpgateway/v1/mcpGateways"
    

    Result:

    {
      "done": false,
      "metadata": {
        "@type": "type.googleapis.com/yandex.cloud.serverless.mcpgateway.v1.CreateMcpGatewayMetadata",
        "mcpGatewayId": "db815a8nma7u********",
        "folderId": "b1gt6g8ht345********"
      },
      "id": "db8o404e7f2v********",
      "description": "Create MCP Gateway",
      "createdAt": "2025-12-22T18:04:42.776181560Z",
      "createdBy": "ajeol2afu1js********",
      "modifiedAt": "2025-12-22T18:04:42.776181560Z"
    }
    

    Save the new MCP server's ID (the mcpGatewayId field value) for the next step.

  5. Wait until the MCP server is created, then view its details by specifying the ID you saved in the previous step.

    curl \
      --request GET \
      --header "Authorization: Bearer $IAM_TOKEN" \
      "https://serverless-mcp-gateway.api.cloud.yandex.net/mcpgateway/v1/mcpGateways/<MCP_server_ID>"
    
    Result
    {
      "tools": [
        {
          "action": {
            "mcpCall": {
              "toolCall": {
                "toolName": "tool-name",
                "parametersJson": "//( . )"
              },
              "unauthorized": {},
              "url": "https://mcp.example.com",
              "transport": "SSE"
            }
          },
          "name": "tool-name",
          "description": "tool description",
          "inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\",\"description\":\"City name or zip code\"}},\"required\":[\"location\"]}"
        }
      ],
      "logOptions": {
        "disabled": false
      },
      "public": true,
      "id": "db815a8nma7u********",
      "folderId": "b1gt6g8ht345********",
      "createdAt": "2025-12-22T18:04:42.819804Z",
      "name": "my-external-mcp-server",
      "description": "my sample external MCP-server",
      "status": "ACTIVE",
      "baseDomain": "https://db815a8nma7u********.99igvxy3.mcpgw.serverless.yandexcloud.net",
      "serviceAccountId": "ajegtlf2q28a********",
      "cloudId": "b1gia87mbaom********"
    }
    

This will create an MCP server in MCP Hub, containing the added tools and accessible to AI agents.

Using the Responses API to access an external MCP serverUsing the Responses API to access an external MCP server

Instead of MCP Hub, you can use the Responses API to access an external MCP server from an AI agent. Do this by simply specifying the server URL and the API key with yc.serverless.mcpGateways.invoke as the specified scope.

Example of connecting an MCP server via the Responses API:
from openai import OpenAI

# Creating a client
client = openai.OpenAI(
    api_key="<API_key>",
    base_url="https://rest-assistant.api.cloud.yandex.net/v1",
    project="<folder_ID>"
)
# Example of calling the MCP via the Responses API
response = client.responses.create(
    model="gpt://<folder_ID>/yandexgpt",
    input=[
        {
            "role": "user",
            "content": "Find a client named John Doe in your CRM"
        }
    ],
    # MCP tools, available models
    tools=[
        {
            "server_label": "crm_lookup",
            "server_url": "<MCP_server_URL>",
            "type": "mcp",
            "metadata": {
                "description": "Client search in CRM by name"
            }
        }
    ]
)

print(response.output_text)

See alsoSee also

  • MCP Hub

Was the article helpful?

Previous
Working with the Vector Store search index
Next
Creating an MCP server from a template
© 2026 Direct Cursus Technology L.L.C.