# Connect an MCP app

GitCafe runs an MCP server at `https://git.cafe/mcp`, so AI tools such as
Claude and ChatGPT can read repositories and, with your approval, work on
issues and pull requests. Each connection is limited to the repositories and
permissions you approve.

## Read public repositories without signing in

Add `https://git.cafe/mcp` to your MCP client as a remote server. Without
connecting an account, its read tools work on public repositories: code,
branches and tags, issues, pull requests, reviews and CI results.

A write tool, or `get_me`, asks the client to sign in, which starts the
connection steps below. Connect first if you want the tools to read private
repositories.

## Connect a client

You need a verified GitCafe account.

1. In your MCP client, add `https://git.cafe/mcp` as a remote MCP server.
2. Follow the sign-in link the client opens.
3. Check the app name on the consent screen; **Details** shows its client ID
   and return address. GitCafe does not verify app names, so only continue if
   you started this.
4. Review the permissions. They are granted as the app requested; if they are
   more than you want to give, cancel.
5. Choose the repository access: **All repositories you can access** (the
   default, including repositories you get access to later) or **Only select
   repositories…**, which lists your repositories to pick from. A selection
   does not grow: a repository you add later needs a new connection. Some
   permission sets limit how many you can select, and the screen says how
   many.
6. Choose **Authorize** and confirm it's you if asked. You return to the
   client.

Choose **Cancel** to refuse. Never paste a token or password into a
connector's settings: the browser flow handles sign-in.

### Claude

Open **Customize → Connectors → Add → Add custom connector**. Enter a name and
`https://git.cafe/mcp`, keep the detected sign-in and automatic registration
options, then choose **Add → Connect** and approve the connection. Leave the
tools on **Needs approval** to review each call.

### ChatGPT

With developer mode enabled, open **Plugins → Create app → Create MCP App**.
Enter a name and `https://git.cafe/mcp`, keep **OAuth**, acknowledge the
custom-server warning and choose **Create**. Approve the connection, then open
the app and choose **Try in chat**.

Menus vary by client version and plan.

## What a connected app can do

With the permissions you approved, an app can:

- read your identity and its approved repositories (`get_me`);
- read code, branches, tags and search results;
- read and write issues, pull requests, comments and reviews;
- resolve review threads;
- merge pull requests, if you approved **pr:merge:write**;
- read CI runs, checks, jobs and shared logs (`ci_read`).

An app cannot create branches or commits, push, start or cancel CI, or
administer or delete repositories. Repository rules apply to everything it
does.

A merge request returns `accepted` before the merge finishes. Have the app
check the merge status until it reports `completed` before it assumes the pull
request merged.

## Review or revoke access

Open **Settings → Authorized Apps** to see each connection: the app, the
audiences it covers (**API**, **MCP**, **Git**), its repositories by name or
**All repositories you can access**, its permissions, when you connected it
and when it last issued a token (**Last token issued**). Choose **Revoke** and
confirm to end a connection, with all its tokens, immediately. Tokens issued to
apps are listed there, not under **Tokens**, which lists only your personal
access tokens.

You have one connection per app. Connecting the same app again, for example
from another device or for another audience, updates it in place: your other
devices and audiences keep working, and the consent screen shows what changes
when you choose different repositories. A connection lasts until you revoke
it, and ends after 90 days without a new token; each time the app refreshes its
token, the 90 days start again.

An organization's owners and admins can see which apps their members connected
(**Organization settings → Connections**) and remove one person's connection
from that organization's repositories. The app then stops reaching that
organization's repositories at once, through every audience; your connection
keeps working elsewhere, and reconnecting does not undo the removal. Authorized
Apps shows **Removed from** the organization until an admin restores it.

Connections made before October 2026 lasted 30 days from approval. They keep
that end; approving the app again moves the connection to the 90-day rule.

## Connect an API client

OAuth clients can also call the [REST API](https://staging.git.cafe/docs/reference/api.md). Use
`https://git.cafe/api` as the OAuth resource; a token issued for the API does
not work for MCP, and the reverse is also true. Consent screens and
**Authorized Apps** show the audiences as **API** and **MCP** chips.

- Use the authorization-code flow with PKCE (`S256`), and send the resource
  ([RFC 8707](https://www.rfc-editor.org/rfc/rfc8707)) in the authorization,
  token and refresh requests.
- One connection covers every resource it was approved for. The token and
  refresh requests each name one resource and get a token for that resource
  only; naming a resource the connection does not cover returns
  `invalid_target`. A client that connected for MCP and then for the API holds
  one connection covering both.
- Access tokens last up to 15 minutes. Each refresh rotates the refresh token.
  The connection ends after 90 days without a token request, or when revoked.
  Each device's refresh tokens form their own family: reusing an old refresh
  token, or revoking one, ends that device's tokens only.
- API OAuth covers repository operations on the selected repositories. It does
  not grant organization, team or profile access, or Git credentials.
- To revoke a token, send it with the connection's `client_id` to the
  revocation endpoint.

For the other ways to authenticate, see
[choose how to authenticate](https://staging.git.cafe/docs/agent-workflows.md#choose-how-to-authenticate).

## Connect a GitCafe app as yourself

Some apps, such as coding agents in the apps pilot, are registered GitCafe apps
that can act as you, including cloning and pushing over Git. They work only in
organizations that installed the app, and only on repositories that
installation selected.

- You have one connection to the app across organizations. The consent screen
  lists each organization you belong to that installed it (up to 25), and you
  choose, for each one you connect it in, **All repositories you can access in**
  that organization (the installation's repositories that you can reach) or
  **Only select repositories…**, which lists those of its repositories you can
  read. Nothing is chosen for you. Organizations you leave unchosen are not
  connected, and ones already connected keep their access.
- One consent covers every audience the installations approved for their
  members (for example **API**, **MCP** and **Git**), so you see one row in
  Authorized apps. The app asks for a token for one audience in one
  organization at a time: the token request may name an `installation_id`, and
  otherwise uses the organization you approved most recently; the token
  response says which. The app can request only
  the permissions that installation allows apps to use for its members. The
  app's own bot permissions never apply to you.
- The app acts with your own current access: if you lose a role on a
  repository, the app loses it too. It never gets more than you have. The
  consent screen and Authorized apps name only the repositories you can still
  read and the installation still selects; one you lost, or one moved out of
  the organization, is left out.
- Your actions through the app are recorded as yours, via the app's
  installation: your comments, reviews and pull requests show as, for example,
  **Alice via Hoplite**.
- The consent screen names the app and its publisher, and says whether it can
  clone, or clone and push, with Git.
- **Authorized apps** lists the connection under the app's name with its
  audience chips and publisher, and each organization it acts in with its
  repositories and permissions there. **Disconnect** an organization to stop
  the app acting as you there only, or **Revoke all** to end the connection.
- For Git, the app requests a token for the `https://git.cafe/git` resource.
  That token works only for Git, sent as the password of HTTPS Git credentials
  or as a bearer token; API and MCP tokens do not work for Git, and a Git token does not work for the
  API or MCP. Cloning needs **repo:contents:read**, pushing needs
  **repo:contents:write**, your own write access and the repository's rules.
  Git LFS and SSH do not accept these tokens.
- Access stops at once when an organization admin pauses or uninstalls the app,
  removes a repository from its installation or removes your connection from
  the organization, and when you disconnect that organization or revoke the
  connection. A paused installation cannot renew tokens until it resumes.

Ordinary OAuth clients, including ones registered dynamically, cannot use the
Git resource.

## Connect an agent using auth.md

An agent without a registered OAuth client can connect through the flow
described at `https://git.cafe/auth.md`. It grants REST API access for up to one
hour; it does not grant MCP or Git access.

1. Give the agent your GitCafe account's email address. The agent registers and
   shows you a verification link and a six-digit code.
2. Open the link, sign in, and enter the code. Only continue if you asked the
   agent to connect.
3. Choose the repositories and permissions, then choose **Authorize**. The
   agent's request names every permission, so here you choose which to grant;
   write and admin permissions start off.

The code expires after ten minutes and locks after five wrong attempts. Access
tokens last 15 minutes and the agent can renew them until the connection ends
after one hour. For longer access, use API OAuth, MCP or the CLI instead.

To stop the agent, revoke **Agent registration (auth.md)** in **Settings →
Authorized Apps**.
