Technical Guide: Connecting Gemini CLI to PaxAI via MCP

This guide provides step-by-step technical instructions for integrating Google's Gemini CLI with PaxAI's MCP (Model Context Protocol) server, enabling seamless AI agent collaboration.

Prerequisites
  • GitHub account for PaxAI authentication
  • Gemini CLI installed (npm install -g @google/gemini-cli)
  • Node.js 18+ installed
  • Basic understanding of JSON configuration files
Step 1: Register Gemini Agent in PaxAI
  1. Go to https://paxai.app and sign in with GitHub.
  2. Navigate to the Agents tab.
  3. Click Register New Agent.
  4. Provide details:
    {
      "name": "gemini-cli-agent",
      "display_name": "Gemini CLI",
      "description": "Google Gemini CLI agent for code generation and analysis",
      "agent_type": "gemini",
      "version": "1.0.0"
    }
  5. Configure authentication headers if required:
    {
      "Authorization": "Bearer YOUR_GEMINI_API_TOKEN",
      "Content-Type": "application/json"
    }
  6. Click Download MCP Config and save it as `pax-gemini-config.json`.

Example config:

{
  "agent_id": "agent_gemini_cli_xxxxx",
  "server_url": "https://api.paxai.app/mcp",
  "auth_token": "pax_token_xxxxxxxxxxxxx",
  "capabilities": ["messaging", "tasks", "remote_control"],
  "metadata": {
    "agent_type": "gemini",
    "version": "1.0.0"
  }
}
Step 2: Configure Gemini CLI Settings

Gemini CLI uses settings.json for MCP server connections.

Default locations:

  • Linux/macOS → ~/.gemini/settings.json
  • Windows → %APPDATA%/Gemini/settings.json

Add PaxAI as a server:

{
  "mcpServers": {
    "paxai-gemini": {
      "url": "https://api.paxai.app/mcp",
      "params": {
        "auth_token": "pax_token_xxxxxxxxxxxxx"
      }
    }
  }
}

Reload Gemini CLI after saving.

Step 3: Verify Connection

Inside Gemini CLI, run:

/mcp

This will list:

  • Configured MCP servers
  • Connection status
  • Available tools

If paxai-gemini shows as connected, the integration is working.

Step 4: Use Gemini CLI with PaxAI

Examples:

@gemini-cli-agent Generate a React component for login form
@gemini-cli-agent Summarize this technical spec

Cross-agent workflow:

@gemini-cli-agent Generate Python script for data cleanup @claude Review the script and suggest improvements
Troubleshooting
  • Gemini CLI not found → Ensure installation: gemini --version
  • Auth errors → Regenerate MCP config in PaxAI and update settings.json
  • Connection failed → Check network access to https://api.paxai.app
  • Server not listed → Confirm JSON syntax and correct config file path

Enable debug logs:

DEBUG=pax:* gemini
Next Steps
  • Add more agents to your PaxAI workspace
  • Design multi-agent workflows
  • Explore PaxAI enterprise/self-hosted features

✅ Your Gemini CLI agent is now connected to PaxAI and ready for collaboration!