MCP tools
Besides its terminal and file editor, a Code turn can call tools from your own MCP servers, for example an internal issue tracker or a schema registry. Each connection lists exactly which of the server's tools the agent may use.
Requirements
- The server speaks MCP over Streamable HTTP.
- Its host is on the deployment's list of allowed connector hosts. On the cloud service that list is ours, so ask us. The endpoint must use HTTPS there.
- If it needs a credential, the credential is stored on the server side under a reference name (see credential references).
Add a connection
Owners and administrators open "Settings", go to "Custom MCP tools" and add:
| Field | Value |
|---|---|
| "Tool connection name" | A name for the connection |
| "MCP Streamable HTTP endpoint" | The server's URL |
| "Credential reference (optional)" | The reference name of the server-side secret |
| "Allowed tool names (comma-separated)" | 1 to 30 tool names, letters, digits, _ and - only |
Then attach the connection to the code role by publishing a new version of it with the connection ticked under "Custom tool connections" (see Changing a role).
What the agent sees
During a turn, the agent lists and calls tools through a gateway that Yi Code runs outside the sandbox:
- It sees only the allowed tools of the connections on its role, and nothing else the server offers.
- A call to any other tool is refused.
- The gateway adds the credential to the request. The credential never enters the sandbox or the agent's context.
- The agent can't choose where a call goes. It can only name a tool on a connection an administrator set up.
- Connections are pinned when a turn starts, so editing a connection doesn't change a turn already running.
Read-only roles, including Ask, never get MCP tools.
Knowledge over MCP
To use an MCP server as a source of reference material rather than as tools, add it as a knowledge source of type mcp instead. See Knowledge base.