Gemini CLI
Connect Moonlit to Gemini CLI with one command or a settings entry, then sign in from inside a session.
- Sign in: Moonlit account
- Where: gemini mcp add, or ~/.gemini/settings.json
- Help: Gemini CLI MCP documentation
Before you start
- A Moonlit account. Sign in at app.moonlit.ai with your email and the one-time code it sends you, or with Google or Microsoft. Organizations can use single sign-on. Signing in creates the account if you do not have one.
The server URL:
https://mcp.moonlit.ai/mcpAdd the server
gemini mcp add --transport http moonlit https://mcp.moonlit.ai/mcpOr add it to ~/.gemini/settings.json. Remote servers use the httpUrl key:
{
"mcpServers": {
"moonlit": {
"httpUrl": "https://mcp.moonlit.ai/mcp"
}
}
}Sign in
Inside a session, run /mcp auth moonlit. Sign in with your Moonlit account and click Allow.
Check it works
/mcp inside a session shows Moonlit as connected with its nine tools. Then ask:
Find the official text of Article 6 of the EU AI Act.
A good answer cites CELEX 32024R1689, links to the official publication, and quotes the article.
Use an MCP key instead
For a configuration shared with your team, or a machine that cannot open a browser, an organization MCP key replaces the sign-in. Keys come from Organizations; keep them in an environment variable, never in the file itself.
gemini mcp add --transport http moonlit https://mcp.moonlit.ai/mcp \
--header "Authorization: Bearer $MOONLIT_MCP_KEY"Or in settings.json:
{
"mcpServers": {
"moonlit": {
"httpUrl": "https://mcp.moonlit.ai/mcp",
"headers": {
"Authorization": "Bearer $MOONLIT_MCP_KEY"
}
}
}
}If something fails
- Check that the URL ends in
/mcp. - Remove the server entry, add it again, and sign in once more.
- Ask for your Moonlit account status. The check is free and shows your remaining calls.
For the app's own steps, see the Gemini CLI MCP documentation. Still stuck? Email support@moonlit.ai with what you see.