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
-
Gemini CLI is installed and up to date.
-
For stdio, Node.js is on your
PATHsonpxcan run@doitintl/doit-mcp-server, and a personal API token to set asDOIT_API_KEY. -
For Streamable HTTP, a supported web browser to complete the DoiT sign-in flow when you connect.
Supported connection methods
Gemini CLI supports stdio and Streamable HTTP. See Connection methods for authentication details. The examples below show both.
Configure with stdio
-
Create or edit the Gemini CLI
settings.jsonin one of these locations.-
All sessions (user):
~/.gemini/settings.jsonon macOS and Linux, or%USERPROFILE%\.gemini\settings.jsonon Windows. -
One project:
.gemini/settings.jsonat the root of the project where you run Gemini CLI. Create the.geminidirectory if it does not exist.
-
-
In a text editor, open the
settings.jsonfile. -
Add or merge the following JSON (if the file already has other keys, add the
mcpServersobject without removing existing content). Replaceyour_doit_api_keywith 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"}}}} -
Save and close the
settings.jsonfile. -
Launch Gemini CLI. Local stdio authenticates with
DOIT_API_KEY; it does not open a browser sign-in flow. -
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
-
Create or edit the same
settings.jsonfile described under Configure with stdio. -
Use an HTTP URL entry (Gemini CLI uses
httpUrlfor Streamable HTTP):{"mcpServers": {"doit_mcp_server": {"httpUrl": "https://mcp.doit.com/mcp"}}} -
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.