> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getsmartalex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use SmartAlex with Gemini

> Connect SmartAlex to Gemini CLI as an MCP client and operate your AI voice agents, campaigns, and deals from natural-language prompts.

SmartAlex ships a live Model Context Protocol (MCP) server, so any MCP-capable client can operate your workspace just by talking to it. This page shows how to wire up Gemini CLI as a SmartAlex Gemini MCP client, then drive real voice agents, campaigns, calls, and deals straight from the terminal.

<Note>
  Gemini here is the MCP **client** you prompt. SmartAlex runs the actual voice agents that place and answer calls. Our voice layer is curated, high-accuracy speech, language, and voice models, kept abstracted. So if you searched for "Gemini voice AI," the honest picture is simple: you talk to Gemini, and SmartAlex does the calling.
</Note>

## How the connection works

Gemini CLI speaks to the SmartAlex MCP server over stdio. Every tool call runs against your workspace, scoped to your API key, so the assistant only ever sees and touches your own data.

```mermaid theme={null}
flowchart LR
  A[You] -->|natural language| B[Gemini CLI]
  B -->|MCP over stdio| C[SmartAlex MCP server]
  C --> D[Voice agents]
  C --> E[Campaigns and calls]
  C --> F[Contacts and deals]
  D -->|places and answers calls| G[Your customers]
```

## Before you start

<Steps>
  <Step title="Add the Power Tools add-on">
    MCP API keys are gated behind the **Power Tools** add-on (\$29/month on Professional, included on Enterprise). See [add-ons](/essentials/add-ons) or [pricing](/pricing).
  </Step>

  <Step title="Have a super-admin role">
    Only a super-admin on the workspace can mint keys in the Developer Portal (the side nav in your dashboard).
  </Step>

  <Step title="Create an API key">
    Generate a key in the Developer Portal. Production keys start with `sa_live_`, test keys with `sa_test_`. The full key is shown once at creation (only a hash is stored), so copy it immediately. Lose it and you regenerate, you never recover it.
  </Step>
</Steps>

## Connect Gemini CLI

Gemini CLI reads its MCP servers from `~/.gemini/settings.json`. Add a `smartalex` entry that launches the SmartAlex MCP server locally over stdio, passing your key through the environment.

<CodeGroup>
  ```json ~/.gemini/settings.json theme={null}
  {
    "mcpServers": {
      "smartalex": {
        "command": "npx",
        "args": ["-y", "@smartalex/mcp-server"],
        "env": {
          "SMARTALEX_API_KEY": "sa_live_your_key_here"
        }
      }
    }
  }
  ```

  ```bash Try it standalone first theme={null}
  export SMARTALEX_API_KEY=sa_live_your_key_here
  npx @smartalex/mcp-server
  ```
</CodeGroup>

<Tip>
  On Windows, wrap the launcher in `cmd`: set `"command": "cmd"` and `"args": ["/c", "npx", "-y", "@smartalex/mcp-server"]`.
</Tip>

Restart Gemini CLI so it picks up the new server, then confirm the tools are live:

```text theme={null}
Prompt: List the SmartAlex tools you can call, then show my voice agents.
```

If SmartAlex responds with your agents, the connection is good. Every tool is prefixed `smartalex_`, so it is easy to spot which calls are hitting the platform.

## Example prompts

Once connected, you operate the account conversationally. Gemini interprets intent, then calls the right `smartalex_` tools in sequence.

```text theme={null}
Show my voice agents and which phone numbers each one answers.
```

```text theme={null}
Add a contact named Jordan Lee at +14155550142, then have my qualifier
agent call them and log the outcome.
```

```text theme={null}
Create an outbound campaign called "Spring promo" for the leads list,
use my Reception agent, and schedule it for weekday mornings.
```

```text theme={null}
Summarize yesterday's completed calls: who called, sentiment, and any
deals that changed stage.
```

```text theme={null}
Give me the widget install code for my website so I can paste it before
the closing body tag.
```

That last one returns the exact script tag you drop onto any site:

```html theme={null}
<script src="https://api.getsmartalex.com/storage/v1/object/public/widget-assets/smartalex-widget.js" data-tenant-id="YOUR_TENANT_ID" async></script>
```

## What the server exposes

The MCP server surfaces 28 tools, 7 read-only resources, and 5 prompts across 8 domains. 14 tools read, 14 write, and 3 are destructive (`smartalex_delete_agent`, `smartalex_delete_deal`, `smartalex_delete_webhook`).

| Domain               | Tools | Typical prompt                                         |
| -------------------- | ----- | ------------------------------------------------------ |
| Agents               | 5     | "Create a receptionist agent that books callbacks."    |
| Contacts             | 4     | "Add these five leads and tag them 'inbound'."         |
| Campaigns            | 5     | "Launch the reactivation campaign tomorrow at 9am."    |
| Calls                | 2     | "Show the transcript for the last failed call."        |
| Deals                | 4     | "Move the Acme deal to Negotiation."                   |
| Phone numbers        | 3     | "Which numbers are attached to which agents?"          |
| Webhooks             | 3     | "Subscribe to call.completed and deal.stage\_changed." |
| Platform and widgets | 2     | "Get my widget install code."                          |

Full argument reference: [tools reference](/mcp/tools-reference) and [agent capabilities](/mcp/agent-capabilities).

<Warning>
  Deletes are irreversible. When a prompt could trigger `smartalex_delete_*`, ask Gemini to confirm the exact record first. Requests are rate limited to 100 per minute per workspace, so batch large jobs rather than firing hundreds of single calls.
</Warning>

<Info>
  Webhook **subscriptions** are creatable through MCP today, and each returns an HMAC-SHA256 signing secret once at creation. Outbound event **delivery** is still in private beta, so do not build hard dependencies on real-time event push yet. For live event-driven automation, use [Custom HTTP Tools](/essentials/agent-tools) (Power Tools), which let an agent call your own HTTPS endpoint mid-call.
</Info>

## Related

<CardGroup cols={2}>
  <Card title="MCP getting started" icon="rocket" href="/mcp/getting-started">
    Every supported client, transport, and config file in one place.
  </Card>

  <Card title="Tools reference" icon="wrench" href="/mcp/tools-reference">
    All 28 tools with arguments and return shapes.
  </Card>

  <Card title="Build with Claude Code" icon="terminal" href="/build-with/claude-code">
    The cloud, OAuth-based connect flow for Claude Code.
  </Card>

  <Card title="What is MCP?" icon="circle-question" href="/guides/what-is-mcp">
    A plain-English primer on the Model Context Protocol.
  </Card>
</CardGroup>
