# Connect an agent with MCP

Point an MCP client at the yaya-mcp server so an agent can publish and manage your site.

Source: https://yaya.page/support/articles/developers/connect-an-agent-with-mcp
Last updated: 2026-10-02

## Before you start
- The `yaya-mcp` binary from the `@yaya/mcp` package.
- A key saved by `yaya login key`. See [Use the yaya CLI](/support/articles/developers/use-the-yaya-cli).

## Connect your agent
1. Run `yaya login key` once and save a key.
2. Add `yaya-mcp` to your MCP client as a stdio server.
3. Restart the client.
4. Ask the agent to call `yaya_get_openapi`. A response means it is connected.

The server reads the same credentials file as the CLI. One login covers both.

## What the agent can do
The server has tools for these jobs:

- Publish a folder, or a site draft, to a workspace.
- List, read and check the live files of a site.
- List, restore and delete site versions.
- Read and update your profile and vanity subdomain.
- Search and check domains, and manage mounts.
- Read analytics, change account email and manage payment methods, when the key has the scope.

Each tool needs a key with the matching scope. See [MCP tool reference](/support/articles/developers/mcp-tool-reference) for every tool and [API scopes and rate limits](/support/articles/developers/api-scopes-and-rate-limits).

## Errors
A failed tool call returns JSON with the HTTP status and the error `code`. A rate limit includes `retryAfterSeconds`, so the agent can wait instead of retrying at once.
