Skip to main content

Connect Gemini CLI

The steps below demonstrate how to connect to the DoiT MCP server using Gemini CLI. Before you connect, confirm you meet the Required permissions.

Prerequisites

Supported connection methods

Gemini CLI supports stdio and Streamable HTTP. See Connection methods for authentication details. The examples below show both.

Configure with stdio

  1. Create or edit the Gemini CLI settings.json in one of these locations.

    • All sessions (user): ~/.gemini/settings.json on macOS and Linux, or %USERPROFILE%\.gemini\settings.json on Windows.

    • One project: .gemini/settings.json at the root of the project where you run Gemini CLI. Create the .gemini directory if it does not exist.

    See Gemini CLI configuration.

  2. In a text editor, open the settings.json file.

  3. Add or merge the following JSON (if the file already has other keys, add the mcpServers object without removing existing content). Replace your_doit_api_key with your personal API token.

    {
    "mcpServers": {
    "doit_mcp_server": {
    "command": "npx",
    "args": ["-y", "@doitintl/doit-mcp-server@latest"],
    "env": {
    "DOIT_API_KEY": "your_doit_api_key"
    }
    }
    }
    }
  4. Save and close the settings.json file.

  5. Launch Gemini CLI. Local stdio authenticates with DOIT_API_KEY; it does not open a browser sign-in flow.

  6. Gemini CLI automatically detects and connects to the DoiT MCP server. If your client lists available MCP tools, confirm the DoiT server appears before you rely on it in a session.

    You can now open a new chat to start asking questions or make requests related to DoiT Cloud Intelligence data.

Configure with Streamable HTTP

  1. Create or edit the same settings.json file described under Configure with stdio.

  2. Use an HTTP URL entry (Gemini CLI uses httpUrl for Streamable HTTP):

    {
    "mcpServers": {
    "doit_mcp_server": {
    "httpUrl": "https://mcp.doit.com/mcp"
    }
    }
    }
  3. Save the file, launch Gemini CLI, complete the DoiT sign-in and consent flow when prompted, then confirm the DoiT server appears in the MCP tool list.