> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up Azure Repos in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/microsoft-azure-repos
Last updated: 2026-11-24

Share Azure Repos with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or personal access token sign-in, 15 tools (7 read-only).

---

To give your team Azure Repos in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Azure Repos integration in a Metorial portal, and each person signs in to Azure Repos with their own account. Agents can manage Git repositories, branches, and pull requests in Azure DevOps. The integration has 15 tools, 7 read-only, 6 write and 2 destructive, plus 3 triggers.

**What you will learn**

- How an admin shares Azure Repos in a portal and how each person connects
- The 6 OAuth scopes Azure Repos can request, and what each one allows
- How to keep the 7 read-only tools and reject the other 8

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An account with Azure Repos for each person who connects
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in methods

| Method | Type | What a person provides |
| --- | --- | --- |
| **Personal Access Token** | API token | `token` |
| **Work & Personal** (default) | OAuth | Signs in to Azure Repos |
| **Work Only** | OAuth | Signs in to Azure Repos |

The portal and `metorial setup` use **Work & Personal** unless someone picks another method.

### Personal Access Token

To connect, a person enters:

- `token`: Azure DevOps Personal Access Token (PAT)

### Work & Personal

People sign in to Azure Repos and approve the scopes you allow. The integration can request:

| Scope | Name | What it allows |
| --- | --- | --- |
| `vso.code` | Code Read | Read source code, metadata about commits, branches, and other version control artifacts. |
| `vso.code_write` | Code Read & Write | Read, update, and delete source code; create and manage pull requests. |
| `vso.code_manage` | Code Manage | Full repository management including creating/deleting repositories. |
| `vso.code_full` | Code Full | Full access to all source code operations. |
| `vso.code_status` | Code Status | Read and write commit and pull request status. |
| `vso.profile` | Profile | Read user profile information. |

### Work Only

It requests the same scopes as **Work & Personal**.

### Setup settings

Whichever method you pick, setup also asks for:

- `organization`: Azure DevOps organization name (e.g., "myorg" for dev.azure.com/myorg)
- `project`: Azure DevOps team project name or ID

## Use your own Azure Repos OAuth app

With your own OAuth app, people see your company's name on the Azure Repos consent screen, and the client ID and secret belong to you.

1. **Start the credentials in Metorial**

   In the dashboard, select **Settings**, then **Organization Settings**. Under **Integrations and MCP**, select **Provider Auth**, then **Create Auth Credentials**. Choose Azure Repos and copy the **Redirect URI**.

2. **Register the app**

   In the Microsoft Entra admin center, go to **Entra ID**, **App registrations** and select **New registration**. Under **Authentication**, add a redirect URI on the **Web** platform and paste the one from Metorial. Create a client secret under **Certificates & secrets** and copy its **Value**, which Microsoft shows only once.

   The [Microsoft 365 guide](https://metorial.com/docs/platform/integrations/microsoft-365) covers the app registration, client secret and admin consent in Microsoft Entra step by step.

3. **Finish in Metorial**

   Copy the app's client ID and client secret. Back in Metorial, enter a **Name**, the **Client ID** and the **Client Secret**, review **Scopes**, and select **Create**. Then pick these credentials for the Azure Repos integration.

## Admin: share Azure Repos in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose Azure Repos. Under **Auth Method**, keep **Work & Personal** or pick another. For how members connect, choose **Each person connects**, so everyone signs in to Azure Repos as themselves.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from Azure Repos.

4. **Choose who gets it**

   Add the access groups that should see Azure Repos. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user Azure Repos integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search "azure repos"
```

## Employee: connect Azure Repos

### In the portal

1. **Open Azure Repos in the catalog**

   Sign in to your portal and open Azure Repos. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. An Azure Repos sign-in tab opens. Sign in and approve the permissions listed.

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search "azure repos"
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **Work & Personal**. To connect with **Personal Access Token** instead, find its ID with `metorial catalog get <catalog-item-id>` and add `--auth-method <auth-method-id>`.

### Add it to your AI client

`metorial install` adds your Azure Repos connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list "azure repos"
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 7 read-only tools, such as `search_code` and `list_commits`, and lose the 6 write tools, such as `create_branch` or `create_repository`, and the 2 destructive tools, such as `delete_branch` or `delete_repository`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list "azure repos"
metorial tools <integration-id>
metorial call <integration-id> list_repositories -d '{}'
```

`metorial tools` lists the 15 tools, minus any you rejected. `list_repositories` takes no input. 

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (7)

- `list_branches`: Lists branches (Git refs) in a repository. Needs `repositoryId`.
- `search_code`: Searches for code across repositories in the project. Needs `searchText`.
- `get_pull_request`: Gets detailed information about a specific pull request, including reviewers, vote status, completion options, labels, and comment threads. Needs `repositoryId` and `pullRequestId`.
- `list_pull_requests`: Lists pull requests in a repository with filtering by status, creator, reviewer, and branches. Needs `repositoryId`.
- `get_file_content`: Retrieves the content of a file from a repository at a specific version (branch, tag, or commit). Needs `repositoryId` and `path`.
- `list_commits`: Lists commits in a repository with filtering by branch, author, date range, and file path. Needs `repositoryId`.
- `list_repositories`: Lists all Git repositories in the configured Azure DevOps project.

### Write tools (6)

- `create_branch`: Creates a new branch in a repository from a specified source commit SHA. Needs `repositoryId`, `branchName` and `sourceObjectId`.
- `comment_on_pull_request`: Adds a comment to a pull request. Needs `repositoryId`, `pullRequestId` and `content`.
- `update_repository`: Updates an existing Git repository's settings. Needs `repositoryId`.
- `create_repository`: Creates a new Git repository in the Azure DevOps project. Needs `name`.
- `create_pull_request`: Creates a new pull request in a repository. Needs `repositoryId`, `title`, `sourceBranch` and `targetBranch`.
- `update_pull_request`: Updates a pull request's properties. Needs `repositoryId` and `pullRequestId`.

### Destructive tools (2)

- `delete_repository`: Permanently deletes a Git repository from the Azure DevOps project. Needs `repositoryId`.
- `delete_branch`: Deletes a branch from a repository. Needs `repositoryId`, `branchName` and `objectId`.

## Triggers

Azure Repos has 3 triggers, which fire on events in Azure Repos:

- `repository_event`: Triggers on repository lifecycle events: created, deleted, forked, renamed, and status changed (enabled/disabled).
- `pull_request_event`: Triggers on pull request lifecycle events: created, updated (status/reviewer/vote changes), merge attempted, and commented.
- `code_push`: Triggers when code is pushed to a Git repository.

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use Azure Repos there
- [Create custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials): the Provider Auth screens in more detail
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Microsoft 365 guide](https://metorial.com/docs/platform/integrations/microsoft-365): the app registration, client secret and admin consent in Microsoft Entra
- [Azure Repos on metorial.com](https://metorial.com/integrations/microsoft-azure-repos): the integration overview