Creating an MCP server in MCP Hub from scratch
Note
This feature is at the Preview stage.
In MCP Hub, you can create new MCP servers from scratch containing tools such as an HTTPS request to an external API, a Yandex Cloud Functions function, or a workflow in Yandex Workflows.
To create a new MCP server:
-
In the management console
, select the folder for which your account has theserverless.mcpGateways.editorrole or higher. -
In the list of services, select AI Studio.
-
In the left-hand panel, select MCP servers and click Create MCP server. In the window that opens, do the following:
-
Under Add Method, select
Create. -
Under Tools, select the type of tool you want to add to the MCP server:
HTTPS request,Cloud Functions, orWorkflows:HTTPS requestCloud FunctionsWorkflows-
In the Tool name field, specify a name for the tool you are creating. 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.
-
In the Instructions for agent field, enter the required text description for the tool. This description must define conditions for the AI agent to use this tool. Here is an example:
A tool for creating tickets in a corporate task processing system. Use this tool to log customer complaints, support requests, and error reports. When using this tool, set the `queue`, `type`, `priority`, and `summary` parameters. In the `queue` parameter (queue name), always provide the SUPPORT constant. In the `type` parameter (request type), provide one of the following values: bug (error report), complaint (customer complaint) or support-request (request for consultation). In the `priority` parameter, provide one of these values: low, medium, or high. In the `summary` parameter, provide a text describing the gist of the user request in their own words. -
In the URL field, specify the endpoint the HTTPS request will be sent to.
-
You can use jq templates
to add path parameters to the endpoint value. Here is an example:https://console.yandex.cloud/folders/\(.folder-id)In this example, the
folder-idfield must also be added to the Tool parameters section of the MCP server settings. -
To send query parameters of the endpoint request:
- Add relevantly named fields to the Tool parameters section of the new MCP server settings, e.g.,
country,city, andname. - Add relevant query parameters to the Tool parameters section of the new MCP server settings. Specify jq templates with the names of the fields mentioned above as values for the new query parameters, e.g.,
\(.country),\(.city), and\(.name).
- Add relevantly named fields to the Tool parameters section of the new MCP server settings, e.g.,
-
-
In the Method field, select the HTTP request method:
GET,POST,DELETE,PATCH,OPTIONS, orHEAD. -
Expand the Advanced section and specify the authentication data to provide in HTTPS requests:
Service account: To provide the IAM token issued for the service account attached to the MCP server.Access token: To provide the specified access token.Without authorization: To skip authentication.
-
Under Tool parameters, specify the names, types, and text descriptions of parameters the tool will use.
You can add the parameters one by one using the
Add button on the Form tab or provide them on the JSON schema tab using the JSON structure below.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"] } -
Under HTTPS request settings, configure the HTTPS request settings:
-
Under Request headers, specify the names and values of the headers that will be provided in requests.
-
Under Query parameters, specify the names and values of the parameters that will be provided in the request.
-
Under Request body, review an example of the request you got and adjust it if required.
By default, an empty request body is generated with a flat JSON
object consisting of pairs of tool parameters and their values. For example:{ "parameter-a": <parameter-a_value>, "parameter-b": <parameter-b_value>, "parameter-c": <parameter-c_value> }
All HTTPS request parameters support templating: their values can be generated dynamically. The templating language is
jq. For more information, see the jq guide .For example, the
\(.city)value of the HTTPS request parameter will be taken from thecitytool parameter. In addition, you can use the syntaxBearer \(.token)for theAuthorizationheader to set up authorization via a token provided in the tool parameter. -
-
In the Tool name field, specify a name for the tool you are creating. 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.
-
In the Instructions for agent field, enter the required text description for the tool. This description must define conditions for the AI agent to use this tool. Here is an example:
This tool recognizes text in an image transmitted in base64 encoding. In the recognized text, the tool extracts "article":"quantity" pairs and returns them in JSON structure format. -
In the Function field, select a function from Cloud Functions that will handle the requests and its version.
-
Under Tool parameters, specify the names, types, and text descriptions of parameters the tool will use.
You can add the parameters one by one using the
Add button on the Form tab or provide them on the JSON schema tab using the JSON structure below.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"] }
By default, an empty request body is generated with a flat JSON
object consisting of pairs of tool parameters and their values. For example:{ "parameter-a": <parameter-a_value>, "parameter-b": <parameter-b_value>, "parameter-c": <parameter-c_value> }-
In the Tool name field, specify a name for the tool you are creating. 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.
-
In the Instructions for agent field, enter the required text description for the tool. This description must define conditions for the AI agent to use this tool. Here is an example:
This tool invokes a workflow to automatically summarize long text. Provides the source text, maximum summation length, and language. -
In the Workflow field, select the Workflows workflow that will handle requests.
-
Under Tool parameters, specify the names, types, and text descriptions of parameters the tool will use.
You can add the parameters one by one using the
Add button on the Form tab or provide them on the JSON schema tab using the JSON structure below.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"] }
By default, an empty request body is generated with a flat JSON
object consisting of pairs of tool parameters and their values. For example:{ "parameter-a": <parameter-a_value>, "parameter-b": <parameter-b_value>, "parameter-c": <parameter-c_value> } -
-
To add an additional instrument to the MCP server, click
Add instrument.Note
One MCP server can contain up to 50 tools.
-
Under Server parameters:
-
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.
-
Optionally, add a description and labels for the server you are creating by using the corresponding buttons.
-
In the Access field, select the server type:
- Private: To build a private MCP server with the authentication-based access.
- Public: To build a public MCP server that requires no authentication.
-
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.
-
Optionally, enable Specify network to specify a cloud network to host your MCP server instances.
-
Optionally, turn on the Enable logging option and configure the logging settings to keep a log of the MCP server you are creating.
-
-
Click Save.
-
This will create an MCP server in MCP Hub, containing the added tools and accessible to AI agents.