# Connect Claude Code

> One command adds the PromptGale MCP server to Claude Code, with OAuth sign-in, so you can ask AI answer engines from your terminal and read the sources.

Add PromptGale to Claude Code as a remote MCP server at `https://promptgale.com/mcp`. It signs in with OAuth in the browser, so there is no key to paste.

## How to connect Claude Code to PromptGale

1. Add the server from a terminal with claude mcp add --transport http promptgale and the URL.
2. In Claude Code, run /mcp, pick promptgale and choose Authenticate. Approve in the browser.

**Terminal**

```bash
claude mcp add --transport http promptgale https://promptgale.com/mcp
```

**Available in every project (optional)**

```bash
claude mcp add --transport http --scope user promptgale https://promptgale.com/mcp
```

## Where the config lives

- Without `--scope`, the server is saved for the current project only, in `~/.claude.json`.
- `--scope user` saves it in `~/.claude.json` for every project.
- `--scope project` writes `.mcp.json` in the project root, to share it with your team: `{"mcpServers":{"promptgale":{"type":"http","url":"..."}}}`.

## How sign-in works

- Run `/mcp` in Claude Code, pick `promptgale` and follow the browser sign-in. From a shell, `claude mcp login promptgale` does the same.
- Claude Code stores the tokens and refreshes them by itself. `claude mcp list` shows `Needs authentication` until you sign in.

## Check that it works

Ask Claude Code: "Use PromptGale to check who I am connected as, then list the engines." It should call `whoami` and `get_capabilities`. Neither costs credits.

## Try it

Then ask: "Use PromptGale to ask ChatGPT in the US: what is the best CRM for a small agency? List the sources it cited and tell me whether Acme is mentioned." That runs one task and costs ChatGPT's price in credits.

## What Claude Code can do with PromptGale

Once connected, Claude Code can ask ChatGPT, Gemini, Perplexity, Bing Copilot Search, Meta AI, Google AI Overview, and Google AI Mode a prompt from the country you pick, and read the answer, its cited sources and where each brand ranks. For example:

- "Ask ChatGPT and Perplexity in the US for the best CRM for a small agency, and tell me which brands they name first."
- "Check whether Gemini mentions Acme when asked for project management tools in Germany."
- "Run these 20 prompts on every engine as a batch and list the sites they cite most."

Running a prompt costs that engine's price in credits; reading results, credits and countries is free. The tools are listed in [Connect an agent](https://promptgale.com/docs/mcp.md).

## Troubleshooting

- Answers stop after about a minute: Claude Code times out requests to remote servers after 60 seconds by default. Start it with `MCP_TOOL_TIMEOUT=300000 claude`, or pass `waitSeconds` and poll `get_task`.
- `claude mcp list` shows whether the server is connected; `claude mcp get promptgale` shows its settings.
- To sign in again, run `/mcp` and choose Re-authenticate. `claude mcp logout promptgale` removes the stored tokens.
- For a detailed log, start Claude Code with `claude --debug-file /tmp/claude-debug.log`.

Checked against [Claude Code docs: MCP](https://code.claude.com/docs/en/mcp) on 2026-11-27. Menu names in Claude Code can change; the vendor page is the reference.

## Next

- Every tool and what it costs: [Connect an agent](https://promptgale.com/docs/mcp.md).
- What a result contains: [Results](https://promptgale.com/docs/results.md).
- The engines and their prices: [Engines](https://promptgale.com/docs/engines.md).

---

Docs index: https://promptgale.com/llms.txt · Full reference: https://promptgale.com/llms-full.txt · OpenAPI: https://promptgale.com/v1/openapi.json
