WEIR

Gemini CLI MCP Setup: Add a Remote Server and Sign In

Add a remote MCP server to Gemini CLI with gemini mcp add, avoid the folder-trust and include-tools traps, sign in with /mcp auth and check a real call.


Published · Updated · 6 min read

Cover image: X data in the Gemini CLI

Gemini CLI MCP setup for a remote server takes one gemini mcp add command, a trusted folder and /mcp auth to sign in.

This guide adds Weir, so Gemini CLI can search X (Twitter) and read posts, threads and profiles. Weir only reads, so it never posts as you. We run Weir.

gemini mcp add --transport http -s user weir https://api.weirapp.io/mcp

Gemini CLI MCP setup: add Weir and sign in

Gemini CLI has its own MCP client, so you install nothing beyond a free Weir account.

  1. Add WeirRun the command above. -s user loads it in every project.
  2. Trust the folderStart gemini in your project and choose Trust folder.
  3. Sign inType /mcp auth weir, then approve Weir in your browser.
  4. Check itType /mcp. Weir should show as CONNECTED.
  5. Ask the free question"What's my Weir usage?" calls get_usage, which is free.

We ran it with Gemini CLI 0.65.0 on 22 October 2026, with no Google login. It wrote:

{
  "mcpServers": {
    "weir": { "url": "https://api.weirapp.io/mcp", "type": "http" }
  }
}

Then gemini mcp list, first in an untrusted folder and then with trust set:

Warning: MCP servers are configured but disabled because this folder is untrusted.
○ weir: https://api.weirapp.io/mcp (http) - Disabled

✗ weir: https://api.weirapp.io/mcp (http) - Disconnected

Disconnected is normal before sign-in. Weir answers 401 until you sign in, and gemini mcp list never starts a sign-in. Gemini CLI's source tells you to run /mcp auth weir instead.

httpUrl or url? Gemini CLI MCP configuration keys

Use url with "type": "http", as the command writes it.

Gemini CLI's docs still say url means SSE and httpUrl means streamable HTTP. But its 0.65.0 source calls httpUrl deprecated, and both reach Weir.

Other keys, as Gemini CLI's docs spell them:

  • headers sends a key with each request, as the next section shows.
  • timeout is in milliseconds. The default is 10 minutes.
  • trust: true skips every confirmation. Leave it off: the prompt shows the limit, which sets the cost.
  • includeTools and excludeTools filter tools, and excludeTools wins when a name is in both.

Gemini CLI MCP config with an API key

Use a key when no browser can open. Gemini CLI's docs say sign-in fails over SSH, in containers and in headless setups.

Create a key under API keys in your Weir dashboard, export it as WEIR_API_KEY, then:

gemini mcp add --transport http -s user -H 'Authorization: Bearer $WEIR_API_KEY' weir https://api.weirapp.io/mcp

Keep the single quotes. In our test, Gemini CLI saved Bearer $WEIR_API_KEY exactly as typed. Its docs say it fills in $VAR values when it loads settings, so the key never sits in the file. Double quotes let your shell paste the key itself.

In CI, trust the folder too. Gemini CLI's docs say a headless run in an untrusted folder exits with an error. Set GEMINI_CLI_TRUST_WORKSPACE=true or pass --skip-trust.

How do you limit Gemini CLI MCP tools?

Use includeTools with Weir's own tool names. Weir lists 44 tools on a default sign-in, Reddit included, and a shorter list leaves the model less to read.

gemini mcp add --transport http -s user weir https://api.weirapp.io/mcp --include-tools search_x get_x_thread get_usage

Gemini CLI shows the tools as mcp_weir_search_x and so on, but the filter takes the plain names. When a call needs approval, you can allow it once, allow that tool always, or allow the whole server.

Can Gemini CLI read X (Twitter)? A worked task

Yes. With Weir connected, Gemini picks the tool and its arguments itself.

Use Weir to find @GoogleDevs posts about Gemini from the last 30 days.
Skip reposts. Save them with likes and links to notes/gemini-news.md.

The tool it needs is mcp_weir_search_x, with fromUsers, query and since. X search returns reposts by default, so the agent should add -filter:nativeretweets to query.

Before a loop, check your ceiling. We ran the free get_limits call through Weir's MCP server on 22 October 2026:

→ get_limits {}
← 0 credits
  tier: free · rateLimitPerMinute: 30 · maxMonitors: 1 · hourlySchedules: false

Thirty requests a minute is the free tier's cap. A faster loop gets 429, which is safe to retry after the stated wait. Weir's billing docs say a $5 purchase raises it to 120.

0credits for get_limits
11credits for a 10-post X search
30requests a minute on the free tier
5,000free Weir credits every month

Weir bills 1 credit per call plus 1 per X post, and failed calls are free. Packs start at $5 for 25,000 credits and never expire, as of October 2026. See every rate on our pricing page.

Can you still use Gemini CLI?

Only on some plans. Google's developer blog says Gemini CLI stopped serving Google AI Pro, Ultra and free Code Assist users on 18 June 2026.

Enterprise Code Assist licenses keep it, and so do paid Gemini API keys. If your plan lost it, Google points you to Antigravity CLI, so follow our Antigravity MCP guide.

If it doesn't work

  • Weir shows as Disabled. The folder isn't trusted. Run /permissions to change that.
  • "requires authentication using: /mcp auth weir". Run that command, then approve in your browser.
  • The browser can't reach localhost. The sign-in callback runs on your machine, so use the key setup over SSH.
  • Weir shows no tools. Check includeTools for commas or the mcp_weir_ prefix.
  • Sign-in fails. We haven't tested Weir's sign-in inside Gemini CLI, since we didn't log in to Google. Use the key setup instead.
  • A tool returns 402. Your Weir credits ran out, and retrying won't help. Add credits or wait for next month's grant.

When not to use Weir

  • Gemini has to post or DM on X. Weir is read-only, so pick a tool with write access to your account.
  • You want your private data. Weir reads public posts, not your bookmarks, DMs or home timeline.
  • Price per post matters most. TwitterAPI.io lists $0.15 per 1,000 tweets as of October 2026, less than our $5 pack.
  • You need a guarantee. Weir isn't licensed by X or affiliated with it, so access can change.

FAQ

How do I add an MCP server to Gemini CLI?

Run gemini mcp add --transport http <name> <url> for a remote server, or gemini mcp add <name> <command> for a local one. Add -s user to save it in ~/.gemini/settings.json. Without it, Gemini CLI writes .gemini/settings.json in the current project.

Where is the Gemini CLI MCP configuration?

Under mcpServers in settings.json. The user file is ~/.gemini/settings.json, and a project file at .gemini/settings.json overrides it. On managed machines, a system settings file overrides both.

How do I list MCP servers in Gemini CLI?

Run gemini mcp list in your shell, or /mcp inside a session, which lists tools too. gemini mcp remove <name> deletes an entry.

Can Gemini CLI post to X through Weir?

No. Weir only reads public X data, so nothing can post, like or follow through it. To post, you need a tool that holds your own X account's access.

Sources