Connect Gemini CLI to Backstory to ask natural language questions and get AI-powered answers about your accounts, deals, and opportunities using real-time data from Backstory. MCP (Model Context Protocol) lets Gemini CLI securely access your Backstory data during command-line interactions, so you can query accounts and get insights without leaving your terminal.
To connect Gemini CLI to Backstory, you will need Gemini CLI installed and authenticated, and an active Backstory account with Data Foundation and SalesAI enabled.
What You Can Do
Save hours of research time by querying accounts from the command line instead of manually searching through your CRM
Get instant AI-powered insights using your actual sales data
Access 30 days of communications for any account
Ask natural language questions and get accurate, data-backed answers
Automate sales intelligence workflows by combining Gemini commands with shell scripts and other tools
How to Connect Gemini CLI to Backstory
Once connected, Gemini CLI will have secure access to your Backstory sales data.
Open your terminal and add the Backstory MCP server:
gemini mcp add pai https://mcp.people.ai/mcp/ -t http --scope user
Launch Gemini CLI:
gemini
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.
Verify the tools are installed by running:
/mcp
You should see the full list of Backstory MCP tools including account search, activity tracking, and SalesAI insights.
How to 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
What are Data Foundation and SalesAI?
Data Foundation provides the unified CRM data layer—accounts, opportunities, clean activity data, and identity resolution—that all MCP tools depend on. Without it, Gemini CLI cannot retrieve verified CRM data. SalesAI adds AI-powered insights on top: deal risks, relationship intelligence, recommended next steps, topic extraction, and AI-generated summaries. Together, they enable Gemini to provide accurate, intelligence-rich responses to your sales queries.
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. Still stuck? Contact support@backstory.ai with details about the error message you're seeing.
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 Backstory 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." The integration includes nine tools for searching accounts, analyzing opportunities, viewing communications, accessing company news, and getting AI insights.
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?
Reach out to your CSM or email support@backstory.ai.
