1. Create a workspace key
In Plainrouter, select your workspace and open Settings → Workspace keys. Create a Read key for analysis; use Write for Actions previews and proposals. A new Read key can also inspect Actions records and policy. Copy it once into your protected credential configuration. Select the intended workspace under Workspaces. A key can cover a fixed set of workspaces; for more than one, calllist_workspaces and pass workspace_id on later tool calls. Workspace selection. Never put keys in prompts or source control. Key permissions and replacement.
2. Add Plainrouter to the client
Merge this entry into~/.gemini/settings.json, preserving other settings:
PLAINROUTER_WORKSPACE_KEY through your local secret manager in the environment that starts Gemini CLI. Leave the variable reference in the file. Restart the client, check /mcp, and select plainrouter for production reads.
3. Verify the connection
Start with this read-only request:4. Troubleshooting
- Disconnected: use
httpUrlor--transport http;urlconfigures the older SSE transport. - Tools appear but calls return 401: discovery can be public. Confirm the key variable is available to the client and has not expired or been revoked.
- Wrong server is used: remove a retired
plainrouter-testentry and select the authenticatedplainrouterconnection in your request.