CreateMcpServer

Updated at:

Creates an MCP server.

Operation description

Request description

  • After submission, the system verifies the availability of the MCP server based on the provided connection information.

  • If the MCP server connection is unavailable, the API returns the corresponding error message.

  • The Name field must start with a lowercase letter and can contain only lowercase letters, digits, underscores (_), and hyphens (-). It must be unique within the current account.

  • The Visibility field defines the visibility level of the MCP server. Valid values: TENANT (visible within the account), PROJECT (visible to specified projects), and USER (visible to specified users). Depending on the selected value, you must provide the corresponding VisibilityScope parameter to further specify the visibility scope.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:CreateMcpServer

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

Yes

The name of the MCP server. The name must be unique at the tenant level. It must start with a lowercase letter and can contain only lowercase letters, digits, underscores (_), and hyphens (-).

my-mcp-server

Config

object

No

The connection configuration of the MCP server.

{"Transport":"SSE","Url":"https://example.com/mcp/sse","CustomHeaders":{}}

Url

string

No

The service URL of the MCP server. It must start with https://.

https://example.com/mcp/sse

Transport

string

No

The transport protocol.

Valid values:

  • STREAMABLE_HTTP :

    Streamable HTTP.

  • SSE :

    Server-Sent Events (SSE)

SSE

CustomHeaders

object

No

The custom request headers in key-value pairs. Reserved headers cannot be overwritten.

{}

Visibility

string

No

The visibility level.

Valid values:

  • PROJECT :

    Project.

  • USER :

    User.

  • TENANT :

    Tenant.

TENANT

VisibilityScope

object

No

The visibility scope. Specify the corresponding field based on the value of Visibility.

ProjectIds

array

No

The IDs of the projects in which the MCP server is visible. This parameter takes effect only when Visibility is set to PROJECT.

string

No

The returned DataWorks workspace ID.

123456

UserIds

array

No

The IDs of the users who can see the MCP server. This parameter takes effect only when Visibility is set to USER.

string

No

The user ID.

123456

Response elements

Element

Type

Description

Example

object

The created MCP server.

RequestId

string

The ID of the request.

valueA

McpServer

object

The registered MCP server.

Name

string

The name of the MCP server.

my-mcp-server

GmtCreateTime

string

The creation time.

The value is a 13-digit number, such as 1780555634000.

1780555634000

Examples

Success response

JSON format

{
  "RequestId": "valueA",
  "McpServer": {
    "Name": "my-mcp-server",
    "GmtCreateTime": "1780555634000"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.