> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# TeamCity

> Connect TeamCity so agents can investigate failed builds, queues, and agents, and change builds and pipelines after approval

Connect TeamCity to let CloudThinker agents read builds, test results, logs, queues, agents, and pipelines. The connection uses TeamCity's official MCP plugin and signs in with one **Access token**.

## Prerequisites

* TeamCity 2026.1 or later, with JetBrains' MCP plugin enabled.
* An HTTPS server address with a publicly trusted certificate.
* Permission to create an access token for a user.

## Setup

**1. Enable the MCP plugin**

On your TeamCity server, enable JetBrains' official MCP plugin. The server must answer at `/app/mcp`.

**2. Create an access token**

In TeamCity, open **Profile → Access Tokens** and create a token. Copy it right away. The agent gets the same permissions as this user.

**3. Add the connection in CloudThinker**

Open **Settings → Workspace → Connections**, open the **Discover** tab, and select **TeamCity**. Fill in **Server URL** and **Access token**, then click **Connect**.

**Success state:** TeamCity shows **Connected**.

## Connection details

| Field | Description | Example |
| - | - | - |
| **Server URL** | HTTPS address of your TeamCity server, with any context path but without `/app/mcp` | `https://teamcity.example.com` |
| **Access token** | Token from your TeamCity profile | `<your-access-token>` |

## Required permissions

Read only: a user who can view the projects and builds agents should read. A token inherits that user's TeamCity permissions.

Writes use the same user. Each change needs the matching TeamCity permission, such as running or cancelling builds, managing agents, or editing a project. The server's MCP mode can restrict writes further.

## Agent capabilities

| Capability | What agents can do | Approval |
| - | - | - |
| **Builds and tests** | Read build status, test results, and a bounded part of the build log | No |
| **Queue and agents** | Read the build queue and agent state | No |
| **Projects and configurations** | Read projects and build configurations | No |
| **Pipelines** | Read a pipeline | No |
| **Run a build** | Trigger a build, or rerun a failed one | Yes |
| **Cancel a build** | Cancel a running or queued build, or reorder the queue | Yes |
| **Comment on a build** | Add a comment to a build | Yes |
| **Manage an agent** | Enable, disable, or authorize one agent | Yes |
| **Change a build configuration** | Pause, unpause, or change a parameter | Yes |
| **Create or delete a project or configuration** | Create or delete one project or build configuration | Yes |
| **Change a pipeline** | Create, edit, or delete a pipeline | Yes |
| **Pin or tag a build** | Pin or unpin a build, or change its tags | Yes |

Changes run only after you approve them. The agent reads the exact target first, tells you the effect (a build uses runner time and may deploy), and reads it again afterward. A queued build means the request was accepted. It doesn't mean the build passed.

### Verify the connection

```text theme={null}
Show the current TeamCity user and the last 10 builds across my projects
```

Expect your user name and a short list of builds with their status.

### Example prompts

```text theme={null}
Why did the latest build of the api project fail?
Which builds are waiting in the TeamCity queue, and are any agents offline?
Rerun the failed build of the web project
```

## Troubleshooting

> [accordion] Connect fails or requests return 401
>
> The token is invalid or revoked. Create a new token, edit the connection, and paste it into **Access token**.

> [accordion] Requests return 404
>
> The URL, context path, or MCP plugin is wrong. Check **Server URL** has no `/app/mcp` at the end, and that the plugin is enabled on TeamCity 2026.1 or later.

> [accordion] A change returns 403
>
> The token's user lacks that permission, or the server's MCP mode blocks writes. Grant the permission in TeamCity.

> [accordion] TLS or certificate error
>
> CloudThinker doesn't trust your server's certificate. Use a publicly trusted certificate.

## Security

* **Least privilege** — grant only the permissions the agents need for your use case; start read-only and widen later.
* **Read-only by default** — use read-only credentials unless you want agents to make changes through this connection.
* **Rotate credentials** — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
* **Revoke on offboarding** — remove the credential at the provider when you delete a connection or a teammate leaves.

- **Least-privilege user**: use a user that can only see and run what agents need.
- **Approval for every change**: running, cancelling, and deleting stay behind your approval.

## Related

> [card] [Connections](https://docs.cloudthinker.io/guide/connections/overview.md)
>
> See every connection you can add.

> [card] [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md)
>
> Control which TeamCity changes wait for a person.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.