Connect Gemini CLI
The steps below demonstrate how to connect to the DoiT MCP server using Gemini CLI.
Required permissionsβ
-
To connect and access DoiT Cloud Intelligence via the MCP server, your user must be assigned the Billing Profiles Admin permission.
-
The DoiT MCP server tools map to the DoiT Cloud Intelligence API. Your DoiT API key authenticates requests. In addition, each DoiT API operation enforces its own permissions.
Prerequisitesβ
-
A DoiT API key to set in
settings.json. -
Gemini CLI is installed and up to date.
-
Node.js is on your
PATHsonpxcan run@doitintl/doit-mcp-server.
Connection typeβ
Gemini CLI connects to DoiT MCP using a local stdio connection. The CLI launches the published package (@doitintl/doit-mcp-server) on your machine using standard input/output (stdio) using npx. Ensure Node.js is on your PATH.
Configure the DoiT MCP serverβ
-
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).{
"mcpServers": {
"doit_mcp_server": {
"command": "npx",
"args": ["-y", "@doitintl/doit-mcp-server@latest"],
"env": {
"DOIT_API_KEY": `<doit_api_key>`
}
}
}
} -
Replace
doit_api_keywith your DoiT API key. -
Save and close the
settings.jsonfile. -
Launch Gemini CLI. 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.