- NAME
-
- gcloud apihub locations configure-and-deploy-server - configure and deploy an API Hub server
- SYNOPSIS
-
-
gcloud apihub locations configure-and-deploy-serverLOCATION([--apigee-x-environment=APIGEE_X_ENVIRONMENT--apigee-x-proxy=APIGEE_X_PROXY--apigee-x-target-project=APIGEE_X_TARGET_PROJECT:--apigee-x-proxy-description=APIGEE_X_PROXY_DESCRIPTION--apigee-x-proxy-display-name=APIGEE_X_PROXY_DISPLAY_NAME]) ((--mcp-tools=[description=DESCRIPTION],[operation=OPERATION],[tool-id=TOOL-ID] |--mcp-tools-from-file=MCP_TOOLS_FROM_FILE)) [--async] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
Configures and deploys an API Hub server in the specified location. If a server
with the same target identity already exists, this command overwrites it by
creating a new revision; all existing tools are replaced.
Currently only MCP (Model Context Protocol) servers on Apigee X are supported.
- EXAMPLES
-
To deploy an MCP server with a single tool on Apigee X:
gcloud apihub locations configure-and-deploy-server us-central1 --project=my-project --mcp-tools='tool-id=greet,description=Greet theuser,operation=projects/my-project/locations/us-central1/apis/hello\ /versions/v1/operations/greet' --apigee-x-environment=eval \ --apigee-x-proxy=mcp-discovery-server \ --apigee-x-target-project=my-apigee-projectTo deploy with a tools spec file (required for tools that reference an HTTP operation by spec + path + method):
gcloud apihub locations configure-and-deploy-server us-central1 --project=my-project --mcp-tools-from-file=tools.yaml --apigee-x-environment=eval --apigee-x-proxy=mcp-discovery-server --apigee-x-target-project=my-apigee-projectIf any flag value contains a comma, use the alternate delimiter syntax
^DELIM^value(seegcloud topic escaping). For example:gcloud apihub locations configure-and-deploy-server us-central1 --project=my-project --mcp-tools='^|^tool-id=lookup|description=Lookup by id, name,or email|operation=projects/my-project/locations/us-central1/apis/user\ s/versions/v1/operations/lookup' --apigee-x-environment=eval \ --apigee-x-proxy=mcp-discovery-server \ --apigee-x-target-project=my-apigee-project - POSITIONAL ARGUMENTS
-
-
Location resource - The location in which to configure and deploy the server.
Format:
projects/{project}/locations/{location}. This represents a Cloud resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways.To set the
projectattribute:-
provide the argument
locationon the command line with a fully specified name; -
provide the argument
--projecton the command line; -
set the property
core/project.
This must be specified.
LOCATION-
ID of the location or fully qualified identifier for the location.
To set the
locationattribute:-
provide the argument
locationon the command line.
-
provide the argument
-
provide the argument
-
Location resource - The location in which to configure and deploy the server.
Format:
- REQUIRED FLAGS
-
-
Deployment target runtime. Exactly one target must be specified.
This must be specified.
- Apigee X runtime target.
--apigee-x-environment=APIGEE_X_ENVIRONMENT-
The specific Apigee X environment where the server will be deployed.
This flag argument must be specified if any of the other arguments in this group are specified.
--apigee-x-proxy=APIGEE_X_PROXY-
Name identifying the proxy resource in Apigee X. Standard alphanumeric format
(e.g. "mcp-discovery-server").
This flag argument must be specified if any of the other arguments in this group are specified.
--apigee-x-target-project=APIGEE_X_TARGET_PROJECT-
The runtime project that hosts the Apigee X organization. This must be one of
the runtime projects attached to the API Hub host project.
This flag argument must be specified if any of the other arguments in this group are specified.
--apigee-x-proxy-description=APIGEE_X_PROXY_DESCRIPTION- Description for the deployed proxy revision in Apigee X.
--apigee-x-proxy-display-name=APIGEE_X_PROXY_DISPLAY_NAME- Display name for the deployed proxy revision in Apigee X.
-
Server protocol configuration. Exactly one server type must be specified.
This must be specified.
-
MCP (Model Context Protocol) server configuration. Provide either --mcp-tools
(one or more) or --mcp-tools-from-file.
Exactly one of these must be specified:
--mcp-tools=[description=DESCRIPTION],[operation=OPERATION],[tool-id=TOOL-ID]-
A tool to expose on the MCP server. Repeatable. Each value is a comma-separated
dict with keys:
- tool-id (required) Unique identifier for the tool.
- description (required) What the tool does.
-
operation (required) Full API Hub operation resource name, e.g.
projects/{project}/locations/ {location}/apis/{api}/versions/{version}/ operations/{operation}.
For tools that reference an operation by spec + path + method, use --mcp-tools-from-file instead (this flag cannot express the http_operation oneof arm).
--mcp-tools-from-file=MCP_TOOLS_FROM_FILE-
Path to a YAML or JSON file containing a list of MCP tools. Each list item maps
1:1 to a tool, with keys:
- tool_id (required)
- description (required)
-
Exactly one of:
- operation: full API Hub operation resource name
- http_operation: { spec, path, method }
where
methodis one of GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE.
-
MCP (Model Context Protocol) server configuration. Provide either --mcp-tools
(one or more) or --mcp-tools-from-file.
-
Deployment target runtime. Exactly one target must be specified.
- OPTIONAL FLAGS
-
--async- Return immediately, without waiting for the operation in progress to complete.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - API REFERENCE
-
This command uses the
apihub/v1API. The full documentation for this API can be found at: https://cloud.google.com/apigee/docs/api-hub/what-is-api-hub - NOTES
-
This variant is also available:
gcloud alpha apihub locations configure-and-deploy-server
gcloud apihub locations configure-and-deploy-server
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-08-11 UTC.