Gemini CLI - Connect the MCP
Declare the server in settings.json with OAuth enabled and authenticate with the /mcp auth command.
In Gemini CLI, the NicoChat server is declared in the settings.json file with HTTP transport and OAuth enabled. On the first session, the /mcp auth command opens the browser for authorization in NicoChat, and the token is stored locally for the next ones.
- Server URL:
https://mcp.nicochat.com/mcp. It is the only information the client asks for; there is no API key to copy. - A NicoChat account with a workspace on a paid or trial plan, and you as its owner or admin.
- Gemini CLI installed and authenticated (
geminiopens in the terminal).
~/.gemini/settings.json (user configuration) or .gemini/settings.json at the project root (that project only). Add the block below under mcpServers.gemini. Type /mcp to list the servers: NicoChat shows up asking for authentication./mcp auth nicochat. The browser opens the NicoChat authorization page. Log in, choose permissions and validity, and confirm./mcp shows the server connected and the list of tools.{
"mcpServers": {
"nicochat": {
"httpUrl": "https://mcp.nicochat.com/mcp",
"oauth": {
"enabled": true
}
}
}
}You can also register it from the command line, without editing the file by hand:
gemini mcp add --transport http nicochat https://mcp.nicochat.com/mcpIn that case, check that the generated block has oauth.enabled set to true; without it Gemini CLI does not start the authorization.
Whatever the client, authorization happens in the browser, on the NicoChat page. You log in, choose the permissions (read and analytics is always granted; configuration, contacts, integrations and campaigns are optional) and the validity of the connection: 1, 7, 30 or 90 days, or no expiration. The tools the assistant sees depend on what you check here — to expand later, just reconnect.
Once connected, ask Gemini in plain language. A few examples that use read only:
- "List my workspaces and the channels in each one."
- "How many contacts came into the WhatsApp channel in the last 7 days, and what is the average first response time?"
- "Summarize the structure of channel X: flows, triggers, AI agents and kanban boards."
- "Which keywords are set up in channel X and where does each one lead?"
If you granted configuration, the assistant also creates flows, triggers, tags and AI agents. Everything it creates inside a flow stays as a draft until you publish it in NicoChat.
- In the client: remove the
nicochatblock fromsettings.json, or rungemini mcp remove nicochat. The local token lives in~/.gemini/mcp-oauth-tokens.jsonand can be deleted. - In NicoChat: under Account Settings, revoke the authorization. It takes effect immediately, even if the server is still registered in the client.
oauth.enabled is true and that the key used is httpUrl, not url. Then run /mcp auth nicochat.
