CX Agent Studio provides a Model Context Protocol (MCP) server which can be used by other AI applications to edit CX Agent Studio resources. For example, you can use the Gemini CLI or Antigravity to help design and build your CX Agent Studio agent application.
This feature enables AI-assisted development workflows, drastically reducing the friction of building and maintaining agent applications:
- Vibe Coding (Rapid Prototyping): Instead of manually clicking through the UI to create an agent, you can simply tell your AI-assisted IDE "Create a retail support agent that uses the Shopify API and speaks in a friendly tone." The coding agent uses the MCP server to construct the agent architecture for you.
- Mass Refactoring & Clean-up: The MCP server excels at bulk operations that are tedious in a UI. For example, you can command "Rename the 'customer_id' parameter across all 15 sub-agents" or "Find and delete all unused intents".
- Interactive Eval-Driven Development: You can run a failing evaluation and instruct the agent: "Modify the instructions until this specific evaluation passes".
- Self-Healing & Optimization: An automated "Helper Agent" can monitor an agent's performance (for example, failing a specific evaluation) and use the MCP server to autonomously tweak instructions or fix tool definitions to improve the score ("Hill Climbing").
- Contextual Awareness: The server allows coding assistants to "read" the current state of a deployed agent, making it easier for you to understand complex legacy configurations without digging through JSON files manually.
Limitations
The following limitations apply:
- Only the
usregion is supported. - Token Context Limits: Large agent configurations (with many tools and extensive instructions) may exceed the context window of some coding models when retrieving full agent definitions. We recommend fetching specific sub-components (for example, just one tool) rather than the entire app definition at once. Additionally, users should monitor their context window usage and restart their agent session periodically (every few requests) to clear the buffer.
- Latency:
"Direct Mutation" (API calls) are generally faster for small changes.
However, for massive architectural refactors
(renaming variables across 50 files),
we recommend the "Export -> Local Edit -> Import"
workflow to ensure data integrity,
which the MCP server also supports using
export_appandimport_apptools.
How it works
The server exposes the CX Agent Studio API, which is also used by the UI to build agents. Your AI application is configured to use the server and connect to it. The server advertises a list of available tools, such as:
list_agents()create_tool(name, python_code, ...)update_instruction(agent_name, new_instruction)run_evaluation(dataset)
When you provide a natural language command to your AI application, the AI application decides whether to use the CX Agent Studio MCP server and which tool to call.
Direct versus local mutations
You can use one of two distinct workflows depending on the complexity of the task:
- Direct Mutation (Best for Speed & Prototyping): Connect the MCP server directly to your coding environment to make real-time changes using API calls.
- Local Copies (Best for Scale & Control):
Use the MCP server's
export_apptool to download the agent to your local file system, edit the files with your coding assistant, and push changes back usingimport_app. This is useful for large-scale refactoring, version control integration, or merging team contributions.
Required roles
To get the permissions that you need to complete the tasks in this guide, ask your administrator to grant you the following IAM roles on your project:
-
Enable APIs and MCP servers in the project:
Service Usage Admin (
roles/serviceusage.serviceUsageAdmin) -
Make MCP tool calls:
MCP Tool User (
roles/mcp.toolUser)
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Enable the MCP server in a project
If you're using different projects for your client credentials,
such as service account keys, OAuth client ID or API keys,
and for hosting your resources,
then you must enable the ces.googleapis.com service
and the MCP server on both projects.
To enable the server in your Google Cloud project, run the following command:
gcloud beta services mcp enable ces.googleapis.com \
--project=PROJECT_ID
Disable the MCP server in a project
To disable the MCP server in your project, run the following command:
gcloud beta services mcp disable ces.googleapis.com \
--project=PROJECT_ID
Authentication and authorization
CX Agent Studio MCP servers use the OAuth 2.0 protocol with Identity and Access Management (IAM) for authentication and authorization. All Google Cloud identities are supported for authentication to MCP servers.
MCP OAuth scopes
OAuth 2.0 uses scopes and credentials to determine if an authenticated principal is authorized to take a specific action on a resource. For more information about OAuth 2.0 scopes at Google, read Using OAuth 2.0 to access Google APIs.
CX Agent Studio has the following MCP tool OAuth scopes:
https://www.googleapis.com/auth/ces
Configure an MCP client to use the CES MCP server
Host programs, such as Claude or Gemini CLI, can instantiate MCP clients that connect to a single MCP server. A host program can have multiple clients that connect to different MCP servers. To connect to an MCP server, the MCP client must know at a minimum the URL of the MCP server.
In your host, look for a way to connect to a MCP server. You're prompted to enter details about the server, such as its name and URL.
For the CX Agent Studio MCP server, enter the following as required:
- Server name: CES MCP server
- Server URL or Endpoint:
http://ces.us.rep.googleapis.com/mcp - Transport: HTTP
- Authentication details: your Google Cloud credentials, your OAuth Client ID and secret, or an agent identity and credentials. Which authentication details you choose depend on how you want to authenticate. For more information, see Authenticate to MCP servers.
For host-specific guidance, see the following:
For more general guidance, see Connect to remote MCP servers.
Optional security and safety configurations
MCP introduces new security risks and considerations due to the wide variety of actions that you can take with MCP tools. To minimize and manage these risks, Google Cloud offers defaults and customizable policies to control the use of MCP tools in your Google Cloud organization or project.
For more information about MCP security and governance, see AI security and safety.
Model Armor
Model Armor is a Google Cloud service designed to enhance the security and safety of your AI applications. It works by proactively screening LLM prompts and responses, protecting against various risks and supporting responsible AI practices. Whether you deploy AI in your cloud environment, or on external cloud providers, Model Armor can help you prevent malicious input, verify content safety, protect sensitive data, maintain compliance, and enforce your AI safety and security policies consistently across your diverse AI landscape.
Model Armor is only available in specific regional locations. If Model Armor is enabled for a project, and a call to that project comes from an unsupported region, Model Armor makes a cross-regional call. For more information, see Model Armor integration with Google Cloud MCP servers.