# Connect an agent over MCP

StackIDE runs an MCP server, so the coding agent you already use can read and change your sites, their content and their deploys, with the permissions you give it.

| Setting | Value |
| --- | --- |
| Address | `https://www.stackide.com/terminal/api/mcp` |
| Transport | Streamable HTTP |
| Sign-in | Your Stacklumen account, or `Authorization: Bearer <key>` |

Connecting an agent is free on every plan. The agent runs on your own AI plan, so StackIDE bills nothing for model use.

## Connect by signing in

1. **Add the server** In your agent, add a remote MCP server (some call it a connector) with the address above.
2. **Sign in** Your agent opens a sign-in. Sign in with your Stacklumen account and choose **Allow**.
3. **Check it** The connection appears under **Signed-in agents** on **Agents & API**, where you can disconnect it.

> **Note:** Owners and admins connect agents to a workspace.

## Connect with a key

An agent that cannot sign in sends a key instead, in its server settings:

Header:

```http
Authorization: Bearer <your key>
```

JSON config:

```json
{
  "mcpServers": {
    "stackide": {
      "type": "http",
      "url": "https://www.stackide.com/terminal/api/mcp",
      "headers": {"Authorization": "Bearer <your key>"}
    }
  }
}
```

1. **Open Agents & API** Choose **Developer** in the Workspace group of the sidebar, or a site’s own **Agents & API**: a key made there reaches only that site.
2. **Press New key** Choose **API key**, give it a reach (**Whole workspace** or **One site**), a name and an expiry.
3. **Choose its permissions** Tick them one by one, or start from a preset: **Content editor**, **Designer**, **Developer**, **Read only** or **Full access**. Full access is every permission except keys and webhooks, GitHub and Cloud, which you tick on purpose.
4. **Copy it** Press **Create API key**. The key is shown once.

## Permissions

| Permission | Allows |
| --- | --- |
| `design:read` | Read sites, their settings and health |
| `design:write` | Change site settings, upload media, file form submissions |
| `collections:read` | Read CMS collections and items |
| `collections:write` | Change collections, fields and items; publish and unpublish items |
| `forms:read` | Read form submissions |
| `cloud:read` | Read the GitHub connection, repositories, branches, apps and deploys |
| `cloud:write` | Link repositories; deploy, roll back, pause and resume apps |
| `code:write`, `source:export` | Change the code a site holds in its settings, and read its source |
| `integrations:write` | Content keys and webhooks |
| `publish` | Publish without a person reviewing first |

> **Tip:** A change an agent makes waits for a person to review and publish it, unless its connection may publish.

## What an agent can do

| Area | Tools |
| --- | --- |
| Sites | `list_sites`, `get_site`, `get_site_settings`, `update_site_settings`, `get_site_health` |
| CMS | `list_collections`, `list_items`, `get_item`, `add_items`, `update_item`, `publish_items`, `create_collection`, `add_field` |
| Content API | `get_content_api`, `create_content_key`, `list_content_keys`, `revoke_content_key` |
| Forms | `list_forms`, `list_form_submissions`, `get_form_settings`, `mark_form_submissions` |
| Repositories | `get_github_connection`, `list_repositories`, `list_branches`, `link_repository` |
| Cloud | `list_cloud_apps`, `deploy_cloud_app`, `rollback_cloud_app`, `pause_cloud_app`, `get_cloud_deploy` |
| Jobs | `list_jobs`, `take_job`, `finish_job` |
| Webhooks | `create_webhook`, `list_webhooks`, `delete_webhook` |

A refused call names the permission it needed, so the fix is always one tick away.
