How to allow users to connect their own Gmail accounts through Agent Builder (OAuth / MCP integration)

Hi everyone,

I’m currently integrating Agent Builder (the new one available in the OpenAI Playground) into my own app, and I’ve successfully connected it with ChatKit — everything works fine for general conversation and tool use.

Now, I want to let each of my app users connect their own Gmail accounts so that the agent can read, send, and manage their emails through the Gmail MCP integration.

At the moment, when I add the Gmail tool to my agent, I only see these authentication options:

  • None

  • Access Token / API Key

  • Custom Header

However, there doesn’t seem to be any built-in way for a user to log in with their own Google account (via OAuth or similar). Ideally, I’d like something like a “Connect your Gmail” button or widget, so that the user can authenticate directly — and then the agent can use that connection securely for their session.

Does anyone know if this is already possible with Agent Builder or MCP, or if there are custom MCPs or services that handle OAuth for each user?
I’m trying to find the cleanest, most maintainable way to make this work without manually managing tokens for every user.

Thanks in advance for any insight or examples!

— JC

1 Like

However, there doesn’t seem to be any built-in way for a user to log in with their own Google account (via OAuth or similar). Ideally, I’d like something like a “Connect your Gmail” button or widget, so that the user can authenticate directly — and then the agent can use that connection securely for their session.

Well, just my opinion, but this seems like a huge security issue that may concern your users. With all due respect, if I was one of your users, I would be concerened.

Thanks for your concern, but just to clarify — I never said that I had already built or deployed anything like this. I only asked a technical question to understand how (or if) such a flow could be implemented properly using the current OpenAI Agent Builder tools.

I appreciate you sharing your opinion, but I was really looking for technical insight or documentation references that could help answer the question. Thanks anyway for taking the time to respond.

1 Like

I tried with Oauth key for gmail and got the same issue.