You can connect Pie to Gemini Enterprise so people in your company can ask Gemini about their Pie projects and tasks, and make changes to them.
This works only with Gemini Enterprise, Google's business version of Gemini. The free and personal versions of Gemini can't connect to Pie.
Note: PieMatrix hasn't yet tested this connection with Gemini Enterprise. These steps follow Google's published requirements and Pie's own setup. If a step doesn't work, contact Pie support.
Before you start
You need:
- A Pie organization on the Enterprise plan. Gemini connects to one Pie organization.
- AI connections allowed in that organization. This is on by default. A Pie organization admin can check it in the organization's settings, on the Integration tab, under AI connections: "Allow members to connect AI assistants to this organization."
-
A Google Cloud admin for your company's Gemini Enterprise. Some of the steps below need special Google Cloud roles.
Step 1: Prepare Google Cloud
Your Google Cloud admin does these steps once. For more detail, see Google's guide, Set up your custom MCP server data store.
-
Allow custom connections. Google blocks them by default. Someone with the Organization Policy Administrator role lifts the block for your project:
- In the Google Cloud console, open Organization Policies and select your project.
- Filter for Disable custom MCP server connector for Gemini Enterprise and select it.
- Choose Manage Policy, then Override parent's policy.
- Add a rule, set enforcement to Off, and choose Set Policy.
For more detail, see Google's page Override the constraint for custom MCP data stores.
-
Allow Pie's address, if your company limits outside connections. If your project restricts which domains data connectors can reach, add
my.pie.me(the domain only, not a full web address). If your project uses VPC Service Controls or project enforcement, also addcustom_mcpto the allowed data sources. -
Give the right role. The person who creates the connection needs the Discovery Engine Editor role.
Step 2: Get a client ID and secret from Pie
Gemini needs a client ID and client secret, which work like a username and password for the connection itself. You create them once by sending a single request to Pie.
Copy this command into a terminal, such as Terminal on Mac or Google Cloud Shell, and run it:
curl -X POST https://my.pie.me/oauth/register \
-H "Content-Type: application/json" \
-d '{"client_name":"Gemini Enterprise","redirect_uris":["https://vertexaisearch.cloud.google.com/oauth-redirect"],"grant_types":["authorization_code","refresh_token"],"token_endpoint_auth_method":"client_secret_basic"}'
Pie answers with a short block of text. Copy two values from it:
client_idclient_secret
Save the client secret somewhere safe right away. Pie shows it only once. If you lose it, run the command again to get a new client ID and secret.
Step 3: Add Pie to Gemini Enterprise
- In the Google Cloud console, open Gemini Enterprise, then Apps, and select your app.
- Open Connected Data Stores and choose New data store.
- In Search sources, type
Custom MCP Server, then select the Custom MCP Server card. -
Choose Add MCP server.
Create the connection from inside your app, as described here. A connection created on its own can't be linked to an app later.
-
Under Authentication settings, choose OAuth 2.0 and fill in these fields:
Field What to enter MCP Server URL https://my.pie.me/mcpAuthorization URL https://my.pie.me/oauth/authorizeAuthorization URL Parameters Leave empty Token URL https://my.pie.me/oauth/tokenClient ID The client_idfrom Step 2Client Secret The client_secretfrom Step 2Scopes queries mutationsEnable PKCE Support Selected Use HTTP Basic Authentication Selected (Google's default) Important
-
Scopes: Enter only
queries mutations. Don't addoffline_access, even though Google's guide suggests it: Pie doesn't accept it, and sign-in will fail. Pie keeps people signed in without it. - Enable PKCE Support must be selected. Pie requires it.
- Use HTTP Basic Authentication must stay selected to match the command in Step 2.
-
Scopes: Enter only
- Optionally, open Advanced options and add an MCP Server Description, such as "Pie projects, tasks and time."
- Choose Verify Auth. A Pie sign-in page opens. Sign in, choose your organization, and approve.
- Choose Continue.
- Pick a Multi-region location, enter a name for the data connector, and choose Create.
- Select the new data store in the list and wait until its status changes from Creating to Active.
Step 4: Turn on Pie's actions
Gemini calls Pie's features "actions." They start out turned off.
- Open the new data store and choose Actions, then Reload custom actions.
- Select all five Pie actions and choose Enable actions:
search_operationsdescribe_operationrun_queryrun_mutationexecute_operations
Gemini reads from Pie without asking first. Before it changes anything in Pie, it asks the person to confirm.
Step 5: Each person connects their own Pie account
Each person signs in to Pie with their own account, usually the first time they use Pie in Gemini. On Pie's sign-in page, they choose your organization and choose one of these options:
- read + write: Gemini can read their Pie data and make changes.
- read only: Gemini can read their Pie data but can't change anything.
Gemini can see and do only what that person can see and do in Pie.
A connection stays signed in for up to 30 days. After that, Gemini asks the person to sign in to Pie again.
Troubleshooting
| Problem | What to do |
|---|---|
| Sign-in fails with "invalid scope" | In Scopes, remove offline_access and leave only queries mutations. |
| Sign-in fails with "invalid client" | Check that Use HTTP Basic Authentication is selected and that you copied the client ID and secret correctly. If it still fails, run the command in Step 2 again and use the new values. |
| Sign-in fails with "invalid request" | Select Enable PKCE Support. |
| Pie asks you to pick an organization on the Enterprise plan | Gemini can connect only to a Pie organization on the Enterprise plan. |
| Pie says AI connections are off | Ask a Pie organization admin to turn on AI connections on the organization's Integration tab. |
Comments
0 comments
Article is closed for comments.