Tool type: CLI agent Website: geminicli.com Transport support: stdio, SSE, Streamable HTTP
| Scope | Path |
|---|---|
| User (global) | ~/.gemini/settings.json |
| Workspace | YOUR_PROJECT/.gemini/settings.json |
Workspace settings override user settings.
Gemini CLI uses mcpServers as the root key. For HTTP servers, use httpUrl; for SSE servers, use url.
Recommended when PiecesOS and Gemini CLI are on the same machine.
{
"mcpServers": {
"pieces": {
"httpUrl": "http://localhost:39300/model_context_protocol/2025-03-26/mcp",
"timeout": 30000
}
}
}{
"mcpServers": {
"pieces": {
"url": "http://localhost:39300/model_context_protocol/2024-11-05/sse",
"timeout": 30000
}
}
}Use this when Gemini CLI is running on a different machine from PiecesOS. For setup, see: Connecting to PiecesOS from the Outside World via Ngrok.
{
"mcpServers": {
"pieces": {
"httpUrl": "https://YOUR_NGROK_URL.ngrok.app/model_context_protocol/2025-03-26/mcp",
"timeout": 30000
}
}
}{
"mcpServers": {
"pieces": {
"httpUrl": "http://localhost:39300/model_context_protocol/2025-03-26/mcp",
"timeout": 30000,
"enabled_tools": ["ask_pieces_ltm", "workstream_summaries_full_text_search"],
"disabled_tools": []
}
}
}timeout— in millisecondsenabled_tools— allowlist of specific toolsdisabled_tools— denylist (applied afterenabled_tools)bearer_token_env_var— env var containing a bearer token for authenv_http_headers— map of env vars to HTTP headers
Edit ~/.gemini/settings.json, update the URL, and start a new Gemini CLI session.
- Start a Gemini CLI session:
gemini - Gemini discovers and registers tools from MCP servers on startup
- Ask: "What Pieces tools are available?"
| Issue | Solution |
|---|---|
| Settings file not found | Create ~/.gemini/settings.json manually |
| HTTP key vs SSE key | Use httpUrl for HTTP/Streamable HTTP, url for SSE — they are different fields |
| Tools not discovered | Restart Gemini CLI after editing settings |
| OAuth prompt | Pieces doesn't require OAuth; dismiss if prompted |
- Pieces MCP and LTM Tools Reference — Complete reference for all 39 tools available to your agents
- Connecting to PiecesOS via Ngrok — Expose your local Pieces server for remote access
| ← Back to All Agent Setup Guides |