Skip to main content

Connect Gemini CLI to Backstory

Access your Backstory sales intelligence directly in Gemini.

The Backstory: You are using Gemini to prepare for a customer meeting and you need account details to give it the right context. Rather than switching to Backstory or your CRM to gather that information, you connect Gemini CLI to Backstory using the MCP integration so it can access your data directly. This lets you ask about your accounts and opportunities in plain language and get informed, up-to-date answers without leaving your AI chat.


The Backstory MCP integration connects Gemini command line interface (CLI) to your Backstory instance so Gemini can securely access your sales and customer data during conversations. It uses MCP (Model Context Protocol), a secure connection method that lets Gemini retrieve account information, communication history, and opportunity insights based on your existing Backstory permissions.


Connect Gemini CLI to Backstory

Prerequisites: You need Gemini CLI installed and authenticated and an active Backstory account.

  1. Open your terminal and add the People.ai MCP server:

    gemini mcp add pai https://mcp.backstory.ai/mcp/ -t http --scope user
  2. Launch Gemini CLI:

    gemini
  3. Inside the Gemini CLI, authenticate with Backstory:

    /mcp auth pai

    This triggers OAuth login. You'll only need to do this once—Gemini will remember your credentials.

  4. Verify the tools are installed by running:

    /mcp

    You should see the full list of Backstory MCP tools.


Test Your Connection

Try asking Gemini about a familiar account and explore different question types like:

  • "Find account [Company Name]"

  • "Show recent activity for [Account Name]"

  • "Show me open opportunities for [Account Name]"

  • "What are the risks for [Opportunity Name]?"


Frequently Asked Questions

Authentication failed. What should I do?

First, verify that Gemini CLI is properly installed and you've run Gemini init to authenticate with Google. Then make sure your Backstory account is active and has the necessary permissions. If issues persist, try removing and re-adding the MCP server by running gemini mcp remove pai followed by the add command from Step 1.

Gemini says it can't find my account data. Why?

This usually means the account name is misspelled, the account doesn't exist in your Backstory instance, or you don't have permission to view that account. Try searching with a different account name you know exists, or check with your Backstory administrator about your data access permissions.

Is my data secure when using this integration?

Yes. Your Backstory data never leaves the secure People.ai environment. Gemini CLI only sends queries, not your actual data. The integration respects your existing Backstory permissions, so you can only access accounts and data you already have permission to view. All communication uses HTTPS/TLS encryption, and OAuth 2.0 is used for secure authentication.

Can I disconnect the integration later?

Yes. Run gemini mcp remove pai in your terminal to disconnect. Your Backstory data remains secure and unchanged. You can reconnect at any time by following the setup steps again.

What kind of questions can I ask Gemini about my accounts?

You can ask about account information, recent emails and meetings, open opportunities, deal risks, next steps, and get AI-powered insights. Natural language works best. For example: "Show me high-risk opportunities closing this quarter." See the Backstory MCP article for a full list of tools available.

Can I use this in scripts or automation?

Yes. Once authenticated, you can incorporate Gemini CLI commands into shell scripts, CI/CD pipelines, or other automation workflows. Just remember that the first run requires interactive OAuth authentication—after that, credentials are cached. For high-volume automation, consider using the Backstory REST API alongside MCP for optimal performance.

How do I update the integration?

To update the connection, remove it and re-add it using gemini mcp remove pai followed by the add command from Step 1. Your Backstory data remains secure and unchanged when you disconnect.


Need Help?

Contact your Customer Success Manager or support@people.ai.

Did this answer your question?