Before you start
You need Gemini CLI and a SocialRouter account. No API key: Gemini signs you in itself. Sign up at socialrouter.io if you have not yet. Gemini connects straight to the hosted endpoint, so there is nothing to install.1
Run one command
--scope user writes to ~/.gemini/settings.json and makes it available
everywhere. The default scope is the project, which writes to
.gemini/settings.json instead.2
Sign in
Inside a Gemini CLI session:Gemini opens your browser on the SocialRouter consent screen. Approve, and it keeps
the token from then on.
Using an API key instead
Using an API key instead
A key works everywhere a browser flow does not. Add the header when you create the
server:Or write Gemini expands
settings.json yourself:$VAR_NAME and ${VAR_NAME} from your environment, so a
project-level settings.json in this form is safe to commit: each teammate exports
their own key. Create keys in the
dashboard. With a header configured, no
sign-in ever runs.3
Check it is connected
Type
/mcp inside a Gemini CLI session to list the connected servers and their
tools.4
Ask for something
Get me Satya Nadella’s LinkedIn profile.If you are not sure what to ask, try “What social media data can you pull with SocialRouter?”
If something goes wrong
The server fails to connect
The server fails to connect
Call the endpoint yourself to see the real answer:A
401 means the credential is wrong, revoked, or missing from the header. Anything
else with "serverInfo" in it means the endpoint is fine and the problem is in
settings.json.The server shows as needing authentication
The server shows as needing authentication
Run
/mcp auth socialrouter to sign in again. A headers block in settings.json
takes precedence and skips the sign-in entirely, so remove it if you meant to log in.
Authentication has the rest.Nothing shows up under /mcp
Nothing shows up under /mcp
Check which scope you wrote to: a project-level
.gemini/settings.json only applies
when you launch Gemini from that folder. Re-run the command with --scope user to
have it everywhere.Next steps
Tools reference
What
list_services, run, get_extraction and get_account do.What you can pull
Every platform and service Gemini can call.