# StartMcpGateway ensures a gateway exists for the sandbox.


[API catalog](/reference/api/) · [Docker Sandboxes overview](/reference/api/sandboxes/latest/) · [Product manual](https://docs.docker.com/ai/sandboxes-api/) · [OpenAPI specification](/reference/api/sandboxes/api.yaml)

API version: v1


> This API is experimental. Features, interfaces,
> and behavior may change.




`POST /v1/sandboxes/{sandbox}/mcp-gateway/start`

StartMcpGateway ensures a gateway exists for the sandbox.
Action: a lifecycle transition is not a representation a caller can PUT.

## Connection and access

[API connection and authentication guidance](/reference/api/sandboxes/latest/#authentication)


Server: `https://connect.docker.com/sandboxes`

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
[
  {
    "bearer": []
  }
]
```

## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request POST \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-binary @request-body \
  'https://connect.docker.com/sandboxes/v1/sandboxes/<SANDBOX>/mcp-gateway/start'
```


Prepare request-body using the selected media type and schema.


## Parameters

### sandbox

Location: path. Required: yes.

The sandbox id.

```json
{
  "description": "The sandbox id.",
  "in": "path",
  "name": "sandbox",
  "pointer": "/paths/~1v1~1sandboxes~1{sandbox}~1mcp-gateway~1start/post/parameters/0",
  "required": true,
  "schema": {
    "type": "string"
  }
}
```

## Request and responses

### Request  application/json




Schema:

```json
{
  "additionalProperties": false,
  "description": "StartMcpGatewayRequest ensures a sandbox gateway exists.\nservers must be empty when gateway_url is set",
  "properties": {
    "gatewayUrl": {
      "description": "gateway_url attaches read-only to a pre-existing shareable gateway when supported.",
      "format": "uri",
      "type": [
        "string",
        "null"
      ]
    },
    "servers": {
      "description": "servers are initial server names for a backend-minted gateway.",
      "items": {
        "minLength": 1,
        "type": "string"
      },
      "type": "array"
    },
    "static": {
      "description": "static pins the requested server set and closes gateway-side discovery.",
      "type": "boolean"
    }
  },
  "title": "StartMcpGatewayRequest",
  "type": "object"
}
```










### Response 200 application/json

Success


Schema:

```json
{
  "allOf": [
    {
      "$ref": "#/components/schemas/McpGateway"
    },
    {
      "not": {
        "properties": {
          "state": {
            "enum": [
              "provisioning"
            ]
          }
        },
        "required": [
          "state"
        ]
      }
    }
  ]
}
```










### Response 202 application/json

Accepted. The resource is still progressing; read it or follow its events until completion.


Schema:

```json
{
  "allOf": [
    {
      "$ref": "#/components/schemas/McpGateway"
    },
    {
      "properties": {
        "state": {
          "enum": [
            "provisioning"
          ]
        }
      },
      "required": [
        "state"
      ]
    }
  ]
}
```










### Response default application/json

The structured Error body identifies the failure with a stable code and optional typed details.


Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```









Schema example:
```json
{
  "code": "notFound",
  "details": [],
  "message": "sandbox not found"
}
```


## Complete operation contract

```json
{
  "description": "StartMcpGateway ensures a gateway exists for the sandbox.\nAction: a lifecycle transition is not a representation a caller can PUT.",
  "operationId": "startMcpGateway",
  "parameters": [
    {
      "description": "The sandbox id.",
      "in": "path",
      "name": "sandbox",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "additionalProperties": false,
          "description": "StartMcpGatewayRequest ensures a sandbox gateway exists.\nservers must be empty when gateway_url is set",
          "properties": {
            "gatewayUrl": {
              "description": "gateway_url attaches read-only to a pre-existing shareable gateway when supported.",
              "format": "uri",
              "type": [
                "string",
                "null"
              ]
            },
            "servers": {
              "description": "servers are initial server names for a backend-minted gateway.",
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "static": {
              "description": "static pins the requested server set and closes gateway-side discovery.",
              "type": "boolean"
            }
          },
          "title": "StartMcpGatewayRequest",
          "type": "object"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "allOf": [
              {
                "$ref": "#/components/schemas/McpGateway"
              },
              {
                "not": {
                  "properties": {
                    "state": {
                      "enum": [
                        "provisioning"
                      ]
                    }
                  },
                  "required": [
                    "state"
                  ]
                }
              }
            ]
          }
        }
      },
      "description": "Success"
    },
    "202": {
      "content": {
        "application/json": {
          "schema": {
            "allOf": [
              {
                "$ref": "#/components/schemas/McpGateway"
              },
              {
                "properties": {
                  "state": {
                    "enum": [
                      "provisioning"
                    ]
                  }
                },
                "required": [
                  "state"
                ]
              }
            ]
          }
        }
      },
      "description": "Accepted. The resource is still progressing; read it or follow its events until completion."
    },
    "default": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "The structured Error body identifies the failure with a stable code and optional typed details."
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "summary": "StartMcpGateway ensures a gateway exists for the sandbox.",
  "tags": [
    "MCP gateways"
  ],
  "x-sbx-authenticated-only": false,
  "x-sbx-conditional-permissions": [],
  "x-sbx-plane": "control",
  "x-sbx-required-permissions": [
    "mcpWrite"
  ],
  "x-sbx-resource-response": {
    "$ref": "#/components/schemas/McpGateway"
  },
  "x-sbx-serving-surface": "management"
}
```

## Referenced schemas

- [#/components/schemas/Error](/reference/api/sandboxes/latest/schemas/Error/)

- [#/components/schemas/McpGateway](/reference/api/sandboxes/latest/schemas/McpGateway/)




