MCP¶
MCP (Model Context Protocol) describes capabilities and calls between an agent and a tool service. AI Studio can connect to a remote MCP service, select from the tools exposed by that service, and bind the selected tools to an agent.
The fully documented direction in this repository is AI Studio connecting to an MCP service. Product terminology also allows an agent to act as an MCP server. Whether a publishing action is available, and which transports and authentication methods it supports, depends on the agent page in the current deployment.
Integration roles¶
Role |
Responsibility |
|---|---|
MCP service |
Exposes discoverable tools and their input descriptions |
AI Studio tool configuration |
Stores the service address and transport, and selects tools to import |
Agent |
Uses tool names, descriptions, and task context to decide when to call a tool |
An MCP tool connects directly through its service address and generally does not need an external-platform channel instance. A built-in tool that accesses a third-party platform may still require a channel instance; do not conflate the two configurations.
Prepare the MCP service¶
Before connecting it, confirm that:
the service offers a transport selectable on the AI Studio configuration page;
its endpoint is a valid HTTP or HTTPS URL reachable from the AI Studio runtime;
exposed tool names are stable and include clear purpose and input descriptions;
network access, TLS certificates, and server-side authentication meet deployment requirements;
side effects, permission scope, and failure behavior are clear to tool users.
What localhost means depends on where AI Studio runs. Do not use a loopback address unless the MCP service shares the network environment from which AI Studio makes the connection.
Create a tool from an MCP service¶
Open the Tools section for the target agent.
Select New tool, then choose the MCP service option.
Enter a name and description that a maintainer can identify.
Enter the MCP service address and select a transport offered by the page.
Test the connection. After it succeeds, select the tools to import from the service.
Review each tool name and input description, then finish creating the tool.
Bind the new tool to the target agent and save the configuration.
The tool name must match the name provided by the MCP service. Its description should say when to use it, what inputs it needs, and what effect it can have. Vague descriptions make incorrect tool selection more likely.
Verify the integration¶
A successful connection test is not sufficient acceptance. Check at least:
Discovery: The page lists the expected tools and does not expose unintended administrative tools.
Parameters: Displayed inputs match the current service definition and required inputs are clear.
Call: A predictable, non-destructive input produces the expected result.
Failure: An invalid input returns an error that an agent or maintainer can act on.
Authorization: The actual runtime identity can access only the required resources.
Upgrade: After updating the MCP service, discovery and invocation still work and tool definitions have not changed unexpectedly.
For tools that write, delete, or send messages, state the action explicitly in the description and use the run-confirmation policy offered by the product, when available. The service must still enforce authorization itself; cautious agent behavior is not a security boundary.
Design the service for agents¶
Give each tool one clear action instead of accepting free-form text for arbitrary administration.
Document formats, ranges, and constraints in the input description; do not rely on the agent to infer hidden defaults.
Keep results compact and structurally stable, and distinguish recoverable from terminal failures.
For writes to external systems, use an idempotency key or business-level deduplication when the service supports it.
Log connection state, call duration, and server errors without recording credentials or complete sensitive inputs.
Version tool lists and parameter definitions. For a breaking change, prefer a new tool name or migrate callers first.
Authentication and credentials¶
This repository does not define a universal authentication header or token field between AI Studio and every MCP service. Use only the methods explicitly supported by the tool configuration page and the current deployment. Do not put credentials in a tool name, description, or URL query string. Prefer the deployment’s secret configuration and give each credential only the permissions its tool needs.
If the page does not offer the required authentication method, do not assume that AI Studio forwards arbitrary headers. Place a compatible gateway in a controlled network or confirm the supported options with the administrator.
Troubleshoot a connection¶
Symptom |
Check |
|---|---|
Address validation fails |
Complete HTTP(S) URL and matching transport |
Connection times out |
DNS, routing, firewall, proxy, and reachability from the AI Studio runtime |
TLS error |
Certificate expiration, hostname, and trust chain |
Connection works but a tool is missing |
Exposed tool list, permissions, and exact tool name on the MCP service |
Tool parameters are stale |
Whether the server definition changed and the tool needs to be refreshed or recreated |
Agent does not call the tool, or picks the wrong one |
Tool name, purpose, input description, and overlap with other tools |
For the complete UI workflow, see Tool configuration. You can also create a custom tool from an existing platform workflow without MCP.