Skip to content

Gemini CLI

Prerequisites

Configuration

Add the DojoCode MCP server to your Gemini CLI configuration file.

Global configuration (~/.gemini/settings.json):

json
{
  "mcpServers": {
    "dojocode": {
      "type": "streamableHttp",
      "url": "https://api.dojocode.io/api/v1/mcp/stream"
    }
  }
}

Project-level configuration (.gemini/settings.json in your project root):

json
{
  "mcpServers": {
    "dojocode": {
      "type": "streamableHttp",
      "url": "https://api.dojocode.io/api/v1/mcp/stream"
    }
  }
}

Authentication

  1. After adding the configuration, start or restart Gemini CLI
  2. You can type /mcp to view the status of your MCP servers and trigger a connection
  3. On first connection, Gemini CLI opens your browser to the DojoCode authorization page
  4. Log in to DojoCode if you are not already logged in (you can use email/password, Google, or GitHub)
  5. Click Approve to grant access
  6. You will see a confirmation page — close the browser tab and return to Gemini CLI
  7. Gemini CLI is now connected and ready to use DojoCode tools

Usage Examples

Once connected, you can ask Gemini to interact with DojoCode naturally:

Browse challenges:

Find me beginner Python challenges about algorithms

Get challenge details:

Show me the details of challenge [challenge-id]

Create a challenge:

Create a new JavaScript challenge called "Reverse a String" with beginner difficulty

Run tests:

Run the tests for my current challenge variation

Join a contest:

Show me upcoming contests and join the next one

Troubleshooting

Connection fails

  • Ensure you have a stable internet connection
  • Verify the MCP server URL is correct: https://api.dojocode.io/api/v1/mcp/stream
  • Use /mcp to check server status and reconnect
  • Restart Gemini CLI after editing the configuration file

Authorization expired

  • The access token is valid for 90 days
  • If you see authentication errors, use /mcp to trigger re-authorization
  • Simply approve the connection again in your browser

Tools not appearing

  • Check that the configuration JSON is valid (no trailing commas, correct syntax)
  • Use /mcp to verify the server is listed and connected
  • Restart Gemini CLI after adding the configuration