Connect Gemini CLI to StackJack
Google's Gemini CLI connects to remote MCP servers over Streamable HTTP (MCP is the Model Context Protocol, the open standard AI tools use to call external tools). With just an httpUrl entry it defaults to dynamic discovery and signs you in through your browser.
Prerequisites
- Gemini CLI installed (a current build).
- A StackJack account that is a member of your workspace. Any team member can connect — no admin-created credentials needed for the sign-in path.
- Your StackJack MCP endpoint URL:
https://mcp.stackjack.io/mcp.
Connect with sign-in (recommended)
Add StackJack to
~/.gemini/settings.json(global) or.gemini/settings.json(project) with onlyhttpUrl:{ "mcpServers": { "stackjack": { "httpUrl": "https://mcp.stackjack.io/mcp", "timeout": 30000 } } }Run
/mcp auth stackjackinside the Gemini CLI to sign in via your browser — use the same email, password, and MFA you use for the StackJack Portal.
Important — httpUrl, not url: Gemini CLI uses httpUrl for Streamable HTTP servers. Using url would connect via the older SSE transport and fail against StackJack.
Manual credentials (fallback)
If discovery fails (some builds have reported errors like "no client ID provided / dynamic registration not supported"), an owner, co-owner, or Administrator creates an MCP client in the portal (see Managing MCP credentials). Base64-encode CLIENT_ID:CLIENT_SECRET and add a headers block:
{
"mcpServers": {
"stackjack": {
"httpUrl": "https://mcp.stackjack.io/mcp",
"headers": {
"Authorization": "Basic <BASE64_OF_CLIENT_ID:CLIENT_SECRET>"
},
"timeout": 30000
}
}
}
Tool limits
Gemini CLI does not publish a hard MCP tool cap, but StackJack can expose hundreds of tools depending on your connectors and plan, and large menus cost context and routing accuracy. Connect through a client with a restricted tool selection when your workflow is focused, or switch StackJack to compact catalog mode so it serves a small tool list and the model discovers the rest on demand. An admin must first enable catalog modes for your organization on Endpoints; until then StackJack serves the full tool list. See Choosing tools for each client and managing harness tool limits.
Troubleshooting
- Connection fails immediately — check you used
httpUrl, noturl(the latter selects SSE transport). - Sign-in / discovery errors — update the Gemini CLI, then fall back to manual credentials if needed.
- Sign-in says no account was found — sign up in the portal first, or ask your team admin for an invite.
- For anything else, see Connection troubleshooting.