Skip to main content
The Gemini CLI provides command-line access to Google’s Gemini AI models with MCP server support for enhanced capabilities.
Platform Support: macOS, Linux, Windows Transport Modes: Stdio (local) and HTTP (remote) Configuration: ~/.gemini/settings.json

Configuration File Location

Gemini CLI stores its MCP server configuration at:
Where ~ is your home directory.

Local (Stdio) Setup

Step 1: Install Gemini CLI (if not already installed)
Step 2: Edit settings file Open ~/.gemini/settings.json and add the following to the mcpServers object:
The --tools path must be an absolute path, not relative.

Remote (HTTP) Setup

For connecting to a remote IBM i MCP Server: For a server running with MCP_AUTH_MODE=oauth (see OAuth Authentication), add the URL without an Authorization header to ~/.gemini/settings.json:
If your version of Gemini CLI supports OAuth for remote MCP servers, it opens a browser sign-in on first use. If it does not, add an Authorization: Bearer <token> header with an access token from your identity provider. See OAuth Remote Setup.

With IBM i Tokens (Deprecated)

IBM i HTTP token authentication is deprecated and will be removed in a future major release. See IBM i Authentication.
Step 1: Start remote server (configured for IBM i authentication; see IBM i Authentication)
Step 2: Obtain access token
Step 3: Edit settings file Add to ~/.gemini/settings.json:
Production: Replace http://localhost:3010 with your production server URL and use HTTPS.

Testing the Connection

After configuration:

Multiple Servers

You can configure multiple MCP servers for different purposes:

Troubleshooting

Solutions:
  • Verify ~/.gemini/settings.json exists and has valid JSON
  • Check that npx -y @ibm/ibmi-mcp-server@latest works from terminal
  • Ensure Node.js and npm are in PATH
  • Restart Gemini CLI after configuration changes
Solutions:
  • Verify tools path is absolute: /full/path/to/tools
  • Check YAML files are valid
  • Ensure IBM i credentials are correct
  • Verify Mapepire is running on IBM i
Solutions:
  • Confirm server is running with auth enabled
  • Verify token hasn’t expired
  • OAuth: sign in again, or replace an expired bearer token
  • IBM i tokens (deprecated): get a fresh token with node get-access-token.js --verbose
  • Check Authorization header format

Custom Toolsets

Load specific toolsets for focused workflows:

Next Steps

SQL Tools

Create custom SQL operations

Configuration

Explore all configuration options

Quick Start

Basic server setup

Other Clients

Explore other MCP clients

Additional Resources