# Agent setup > Connect your coding agent to Orchard, then deploy and debug from your editor or terminal. Source: https://docs.orchard.hackclub.com/agent-setup/ Paste this prompt into your coding agent: ```text Connect to my Orchard instance over MCP. Follow https://docs.orchard.hackclub.com/agent-setup.md. Ask me for my Orchard domain first. ``` ## Find your MCP URL Replace `your-orchard-domain` in the examples with your domain. To get the exact URL, select **Account settings** > **MCP** from the account menu. ```text https://mcp.your-orchard-domain/ ``` ## Pick your client ### Claude Code 1. Add the server: ```sh claude mcp add --transport http orchard https://mcp.your-orchard-domain/ ``` 2. Run `/mcp` in Claude Code. Sign in to Orchard and approve the connection. 3. To share the server with a project, add `.mcp.json` instead: ```json { "mcpServers": { "orchard": { "type": "http", "url": "https://mcp.your-orchard-domain/" } } } ``` ### Codex 1. Add the server: ```sh codex mcp add orchard --url https://mcp.your-orchard-domain/ ``` 2. Sign in to Orchard and approve the connection: ```sh codex mcp login orchard ``` ### Cursor 1. Add `.cursor/mcp.json` to a project, or `~/.cursor/mcp.json` for every project: ```json { "mcpServers": { "orchard": { "url": "https://mcp.your-orchard-domain/" } } } ``` 2. Sign in to Orchard and approve the connection when Cursor asks. ### VS Code 1. Add `.vscode/mcp.json` to your project: ```json { "servers": { "orchard": { "type": "http", "url": "https://mcp.your-orchard-domain/" } } } ``` 2. Sign in to Orchard and approve the connection when VS Code asks. ### Claude.ai 1. In Claude, open **Settings** > **Connectors** and select **Add custom connector**. 2. Paste the server URL: ```sh https://mcp.your-orchard-domain/ ``` 3. Sign in to Orchard and approve the connection. ### Other clients - **Amp:** Run this command, then sign in to Orchard and approve the connection. ```sh amp mcp add orchard 'https://mcp.your-orchard-domain/' ``` - **Clients without OAuth:** Create an API token. ```sh orchard auth token create --name ci-agent --scope deploy ``` - Send the token as a bearer token. ```json { "mcpServers": { "orchard": { "type": "http", "url": "https://mcp.your-orchard-domain/", "headers": { "Authorization": "Bearer " } } } } ``` ## Limit what an agent can do Add parameters to the server URL. They can only lower what a connection gets. - Read-only tools: `https://mcp.your-orchard-domain/?scope=read` - No `exec_in_pod`: `https://mcp.your-orchard-domain/?scope=deploy` - Selected toolsets: `https://mcp.your-orchard-domain/?toolsets=databases,domains` - The whole API in three tools: `https://mcp.your-orchard-domain/compact` ## Example prompts Paste these into a connected agent. Each prompt names the tools it uses. ### Deploy a repository Requires a linked GitHub account. ```text Deploy https://github.com/owner/repo to Orchard. Check access with list_github_deploy_targets, deploy with deploy_from_github_url, then wait on get_deployment_rollout and give me the URL. ``` Tools: `list_github_deploy_targets`, `deploy_from_github_url`, `get_deployment_rollout` ### Find out why an app is failing Read-only. Works with `?scope=read`. ```text The api app is failing. Call diagnose_deployment, then read get_deployment_logs and get_killed_container_logs. Tell me the cause. Do not change anything. ``` Tools: `diagnose_deployment`, `get_deployment_logs`, `get_killed_container_logs` ### Create a database Stores the connection string as a secret variable. ```text Create a Postgres database named app-db with create_database. Get its connection string with get_database_connection, then add it to the api app as a secret DATABASE_URL with add_env_vars. ``` Tools: `create_database`, `get_database_connection`, `add_env_vars` ### Roll back a bad deploy Asks before it changes anything. ```text The latest release of the api app is failing. List recent releases with list_releases. Ask me before you run rollback_to_previous, then confirm with get_deployment_rollout. ``` Tools: `list_releases`, `rollback_to_previous`, `get_deployment_rollout` ### Check app resources Read-only. Works with `?scope=read`. ```text Check whether the api app has the right CPU and memory. Use get_resource_recommendation and get_deployment_metrics. Do not change anything. ``` Tools: `get_resource_recommendation`, `get_deployment_metrics` ### Check a domain Run this before you create an ingress. ```text Run validate_dns for app.example.com and tell me which records to create. ``` Tools: `validate_dns` ## More - [MCP for agents](/mcp.md) - [MCP tools](/reference/mcp-tools.md) - [Code mode for agents](/agents-code-mode.md)