Skip to main content
Gemini CLI reads its MCP servers from a settings.json file, or adds them through its own mcp subcommand.

Global or per project?

A project-level .gemini/settings.json may end up committed. Do not put a real API key in it - add the file to .gitignore, or use the user-level file instead.

Add the server

The quickest route is the CLI. -s user writes to your user-level file; without it, the server is added to the current project:
Or edit settings.json directly:
settings.json
Already have servers configured? Add 2extract as another key inside the existing mcpServers object.
Use httpUrl, not url. In Gemini CLI, httpUrl selects Streamable HTTP, while url selects the older SSE transport.

Verify

2extract should be listed as connected. Then start Gemini CLI and ask:
What is my 2extract balance?
A number comes back, and no proxy was created. Inside a session, /mcp lists the server with its tools and prompts.

Troubleshooting

Check the key is httpUrl and the URL keeps the /mcp path. https://mcp.2extract.com on its own serves a web page, not the protocol.
The Authorization header must read Bearer 2xt_... - the word, a space, the key. The server shows as connected even with a wrong key; the error appears on the first tool call.
A scope problem rather than a connection problem. The key is missing the scope those tools need - see Overview.

Next steps

Tools

Everything the agent can call.

Other clients

Any other MCP client.