Appearance
Connect to Gemini
Once your MCP server is running (see Setup MCP Server), follow these steps to connect it to Gemini with the Gemini CLI.
INFO
Google's documented MCP setup flow for Gemini is through the Gemini CLI. The CLI opens your browser locally when it needs you to complete OAuth.
Install Gemini CLI
bash
npm install -g @google/gemini-cliConfigure the MCP Server
Add your FeynmanLM server from Terminal:
bash
gemini mcp add --transport http --scope user feynman "<your MCP URL>"Replace <your MCP URL> with the MCP URL from the app in Studio → Connect MCP.
This is the most reliable setup path because Gemini CLI writes the correct transport config for you.
If you prefer editing ~/.gemini/settings.json manually, use:
json
{
"mcpServers": {
"feynman": {
"httpUrl": "<your MCP URL>"
}
}
}Gemini CLI supports OAuth discovery for remote HTTP MCP servers. It discovers the OAuth endpoints automatically and opens a browser window when authentication is needed, so you do not need to paste a client ID or client secret into Gemini.
First Connection
- Run
gemini mcp listto confirm the server is configured. - You should see
feynmanlisted with statusConnected. - Start Gemini with
gemini. - If Gemini needs authorization, it opens your browser so you can approve the connection.
WARNING
OAuth requires local browser access and a working callback to http://localhost:7777/oauth/callback, so this flow will not complete in a headless shell or remote-only terminal session.
Try It Out
- "What sources do I have?"
- "Read my latest paper and explain the key findings."
- "Quiz me on transformer attention mechanisms."
See Learning with MCP for more detailed learning workflows.
Disconnecting
Remove the feynman entry from ~/.gemini/settings.json.