Get your token first — see Get your access token. You need it in hand, because it is shown only once.
On the MCP page, pick Gemini CLI as your client. The page then shows the endpoint URL of this server, ready to copy.
Gemini CLI runs on your machine, so localhost works here: unlike Claude's remote connector, the endpoint does not have to be public or reachable from the internet.
Add the server
Write this in ~/.gemini/settings.json for every project, or in .gemini/settings.json inside one project:
{
"mcpServers": {
"weblabor": {
"httpUrl": "<the endpoint the MCP page shows>",
"headers": { "Authorization": "Bearer ${WEBLABOR_ANALYZER_TOKEN}" },
"timeout": 30000
}
}
}
The timeout is in milliseconds.
httpUrl, not url
This is the one thing to get right here. The two fields are both addresses, and they mean different transports:
| Field | Transport |
|---|---|
httpUrl |
Streamable HTTP — what this server speaks |
url |
SSE |
Every other client calls its address field url, so the natural copy-paste lands the endpoint under url and points the wrong transport at it. Nothing connects, while the URL, the header and the token are all correct — which is what makes this one take an afternoon to find.
Keep the token out of the file
Gemini CLI substitutes $VAR and ${VAR} inside string values, so the header above reads the token from the environment instead of carrying it. ~/.gemini/.env is the tidiest home for it, because the variables in a .gemini/.env are never filtered out:
WEBLABOR_ANALYZER_TOKEN="<your-token>"
Apply a change
Restart the CLI after editing either file. That is the instruction that always works.
Do not restrict the tools
Leave the server with all of its tools. Cutting it down to validate_code blocks install_toolkit, get_standard and get_guide, which are what make the rest of this work.
Check the connection
Run /mcp: it lists the servers and the status of each one. Then ask for list_rules — it should come back with the configured rules, which confirms both that the token works and that the analyzer is set up.
To test the token before configuring the CLI at all, run this in your terminal. The response contains serverInfo:
curl -X POST <the endpoint the MCP page shows> \
-H "Authorization: Bearer <your-token>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'
When it does not connect
| What you see | Cause | Fix |
|---|---|---|
/mcp shows the server disconnected and everything in the file looks right |
the endpoint is under url, which means SSE |
move it to httpUrl |
| Every call fails as if the token were wrong | the variable is not set where the CLI can read it | put it in ~/.gemini/.env and restart the CLI |
| Nothing changes after you edit the file | the CLI is still running with what it read at launch | restart it |
What works from here
The analyzer, the standards and the guides work from Gemini CLI today: they are read through the server's tools, and nothing is written to your disk, so there is nothing to install for them.
The agents and the commands are files, and they are not written for Gemini CLI yet — see Install the toolkit for which clients get them.
Next
Analyse a file — what to ask for, and what comes back.
