Google Gemini CLI MCP Authentication Issue

 "directus": {

  "type": "http",

  "httpUrl": "https://xx.xx/mcp",

  "headers": {

    "Authorization": "**token**",

    "Content-Type": "application/json"

  }

}

Hi, I installed directus into my gcp server with in docker nginx reverse proxy.

I also implement gemini cli inside of server trying to connection of mcp server

but it says

✕ Error during discovery for server ‘directus’: Connection failed for ‘directus’: Error POSTing to endpoint
(HTTP 403): {“errors”:[{“message”:“You don’t have permission to access
this.”,“extensions”:{“code”:“FORBIDDEN”}}]}

can someone help me ? I’m sorry for my bad england (:

I think you’d probably need to add Bearer before the token like this

  "type": "http",
  "httpUrl": "https://xx.xx/mcp",
  "headers": {
    "Authorization": "Bearer **token**",
    "Content-Type": "application/json"
  }
}

I’m not a Gemini CLI user but I downloaded it to test this.

I was also able to connect using this configuration in my user root ~/.gemini/settings.json.

{
  "security": {
    "auth": {
      "selectedType": "oauth-personal"
    }
  },
  "mcpServers": {
    "directus": {
      "httpUrl": "http://localhost:8055/mcp?access_token=my_access_token"
    }
  }
}