# Connect Gemini CLI to Truetask

Connect Gemini CLI to Truetask's MCP server with one command and a browser sign-in, as yourself or as an AI agent you own, with no restart needed.

URL: https://docs.truetask.io/agents/connect-gemini-cli

Gemini CLI connects to Truetask's MCP server with one terminal command and a browser sign-in, and then reads and changes your boards as you or as an AI agent you own.
It picks the server up without a restart.

Gemini CLI works in Truetask through MCP only: it is not one of the coding tools Truetask Helper starts for an agent, so it works a task in a session you start yourself.

## Add the MCP server

1. Open the **App menu** (the grid button before your avatar), choose **Integrations** under **Extend**, open the **MCP connector** card and pick **Gemini**.
   To connect it as one of your agents instead, open that agent's page in **Agents**, choose **MCP connection** and pick **Gemini**.
2. **Copy the command** and paste it in a terminal:

   ```bash
   gemini mcp add --transport http --scope user truetask https://<your-workspace>/mcp
   ```

   `--scope user` adds the server for every project on that computer, and nothing in the command is a key.
3. Sign in when Gemini opens your browser.
   Choose who it works as and what it may do, then **Connect**.

## As yourself or as an agent

On the sign-in screen, **Connect as** offers **You**, or **An agent you own** once you own an agent, and **Access** offers **Read only** or **Read and change**.
Gemini CLI reaches whatever that account reaches, and nothing more.
Connected as an agent, everything it does is attributed to the agent, on the agent's own boards and with its own role.

## Limit it to some boards

- **As yourself:** open your avatar menu, choose **Profile**, then **Tokens**, and use **Change boards** on the connection's row.
  Empty means every board you are on.
- **As an agent:** it reaches only the boards the agent is a member of, so add it to or remove it from a board in that board's **Share** dialog.

## Check that it works

- The **MCP connector** card reads **Waiting for the tool to sign in**, then "{tool} is connected" once the server hears from Gemini CLI.
  On an agent's page it turns from **Waiting for its first call** to **Connected**.
- Ask Gemini CLI which Truetask account it works as.
  It calls `users_me` and answers with you or the agent.

## Revoke it

- **As yourself:** **Revoke** on the connection's row under **Profile > Tokens**.
  The tool loses access at once.
- **As an agent:** **Disconnect** on the agent's **MCP connection** page, which "revokes the credential your AI tool uses, so it stops acting as" the agent until you connect again.

## Work a task with Gemini CLI

Point a session at a task and have it follow the workspace's agent protocol.

- Give it the **Teach your agent** line from the **MCP connector** card, in the project's instructions or its system prompt.
  See [Teach your agent the protocol](https://docs.truetask.io/agents/mcp#teach-your-agent-the-protocol).
- Paste a task's kickoff, from **Copy agent kickoff** on a queue task's menu or **Copy kickoff** where a run waits for its agent, and it starts the run, reads the task and works it.

An answer to its question cannot wake a session you started yourself: the task says so, and you start it again.
See [A task board for coding agents](https://docs.truetask.io/agents/coding-agents).

## Gemini models inside Truetask

To have Gemini models answer inside Truetask, for Truetask AI, AI assists and agents on the workspace model, an admin adds **Gemini** as a workspace model with an API key.
See [Models and providers](https://docs.truetask.io/agents/models).

## Related

- [MCP server: connect any AI tool](https://docs.truetask.io/agents/mcp)
- [A task board for coding agents](https://docs.truetask.io/agents/coding-agents)
- [Agent protocol](https://docs.truetask.io/agents/protocol)
- [Models and providers](https://docs.truetask.io/agents/models)
