# MCP Server > Connect Claude, ChatGPT, Claude Code, Codex, Cursor and other MCP clients to your QwryAI workspace over OAuth The QwryAI MCP server lets an AI assistant work directly in your QwryAI workspace. It can read and update your agents, manage their sources, search conversations, handle tickets and build Actions and Procedures, without you copying data between tools. It's a remote [Model Context Protocol](https://modelcontextprotocol.io) server. There's nothing to install or host yourself. > [card] Endpoint | /docs/developer-guides/mcp#how-sign-in-works | `https://api.qwryai.com/mcp-oauth` > [card] Authentication | /docs/developer-guides/mcp#how-sign-in-works | OAuth 2.1, with no API key to create or paste. > [!NOTE] > > The endpoint isn't a page to open in your browser. Add it to an MCP client, and the client opens the sign-in page for you. ## Find your MCP URL Open **Workspace settings › AI tools**. The **MCP URL** card shows the endpoint with a copy button, and the page lists every client QwryAI has setup steps for. Select **Install** on a client to see its steps and the exact command or configuration to copy. ![The AI tools page under Workspace settings, with the MCP URL card and its copy button, the Chat apps list and the start of Coding agents, each client with an Install button.](annotated/01-ai-tools.webp "Workspace settings › AI tools") ## Claude and ChatGPT Add QwryAI as a custom connector, then approve access when asked. > [tab] Claude > > In Claude, open **Settings → Connectors** and choose **Add custom connector**. Name it QwryAI, paste the MCP URL, select **Add**, then **Connect** and sign in when asked. Works in Claude.ai and the Claude desktop app. > [tab] ChatGPT > > In ChatGPT, open **Settings → Apps & Connectors**, turn on **Developer mode** under **Advanced settings**, then choose **Create**. Name it QwryAI, paste the MCP URL, choose **OAuth**, select **Create** and sign in when asked. ![The Install dialog for Claude, with the steps to add a custom connector and the MCP URL to copy.](annotated/02-install-claude.webp "Install › Claude") > [!TIP] > > **AI tools** also has steps for Mistral Vibe, Perplexity and Grok under **Chat apps**. ## Claude Code, Codex, Cursor and other clients Point the client at the endpoint. Don't add an `Authorization` header: the client handles OAuth itself and opens the sign-in page for you. > [tab] Claude Code > > ```bash > claude mcp add --transport http qwryai https://api.qwryai.com/mcp-oauth > ``` > > Then run `/mcp` in Claude Code and choose **Authenticate**. > [tab] Codex > > ```bash > codex mcp add qwryai --url https://api.qwryai.com/mcp-oauth > codex mcp login qwryai > ``` > > The second command opens your browser to sign in. > [tab] Cursor > > On **AI tools**, select **Install** on Cursor, then **Open in Cursor**. Or merge this into `~/.cursor/mcp.json`, then open **Cursor Settings → MCP** and select **Connect** for qwryai: > > ```json > { > "mcpServers": { > "qwryai": { > "url": "https://api.qwryai.com/mcp-oauth" > } > } > } > ``` > [tab] VS Code > > On **AI tools**, select **Install** on VS Code, then **Open in VS Code**. Or merge this into `.vscode/mcp.json`, then run **MCP: List Servers** from the Command Palette and start qwryai: > > ```json > { > "servers": { > "qwryai": { > "type": "http", > "url": "https://api.qwryai.com/mcp-oauth" > } > } > } > ``` > [tab] Other clients > > **AI tools** has ready-made steps for Gemini CLI, GitHub Copilot CLI, opencode, Windsurf, Grok Build, Goose, Zed, Amp, Cline, Kilo Code, Hermes, OpenClaw and LM Studio. Select **Install** on your client and copy what it shows. For example, Gemini CLI: > > ```bash > gemini mcp add --transport http --scope user qwryai https://api.qwryai.com/mcp-oauth > ``` > > Then run `/mcp auth qwryai` in Gemini CLI to sign in. > [!NOTE] > > For a server-to-server setup with no browser, use `https://api.qwryai.com/mcp` with an API key from **Workspace settings › API keys** in an `Authorization: Bearer` header. The key's permissions decide which tools it sees. See [Authentication](/docs/api-reference/v2/authentication). ## How sign-in works **1. Your client registers itself** The first time a client connects, it registers with QwryAI on its own using Dynamic Client Registration. You don't create anything in advance. **2. You approve access in the browser** QwryAI shows a consent screen with the workspace and the permissions the app asks for. Choose the workspace, keep the permissions you want and select **Approve connection**. **3. The client receives a token** Access goes to that one client, for that one workspace, limited to the permissions you approved. > [!NOTE] > > An app never gets more than your own role allows, now or later. If your role can't change sources, no app you approve can either, even if it asks. ### Token lifetime | | | | - | - | | Access token | Expires after 1 hour; the client refreshes it silently | | Approval | Expires after 90 days | | Revocation | Takes effect right away | ## Permissions An app asks for a set of permissions, and on the consent screen you choose which to approve. | Permission | What it allows | | - | - | | Chat with agents | List agents, start customer conversations, send customer messages, and search knowledge and product documentation. | | Manage conversations and helpdesk | Read conversations, tickets and analytics; reply as a human agent, add notes, resolve, and pause the AI. | | Read agent settings | Instructions, model, chat interface, sources, knowledge gaps, integrations, webhooks and deploy status. | | Change agent settings | Instructions, model, chat interface, styles, spam and country rules, and deploy channels. | | Change sources and training | Add, edit, delete and restore sources, answer knowledge gaps, and start training. | | Read actions and procedures | Actions, procedures, drafts, publication state, widgets and templates. | | Change actions and procedures | Create, edit, enable, disable and delete actions, procedures and webhooks. | | View plan and credits | Plan, credit balance and credit usage. | To give an app read-only access, approve only the read permissions. A client sees only the tools its permissions cover, so a short tool list usually means a narrow approval rather than a missing feature. Ask the assistant to call `get_account_context`, which reports the workspace, your role, the plan and the permissions in use. ## What the assistant can do The server exposes the same tools as [Backstage](/docs/user-guides/chatbot/backstage), the Tools API and the CLI, grouped by area. > [accordion] Agents and settings > > List agents, read and change instructions, the model, the chat interface and styles, deploy channels and voice settings. > > `list_agents` · `agent_configuration` · `update_instructions` · `update_model` · `update_chat_interface` · `toggle_deploy_channel` > [accordion] Sources > > Add, edit, remove and restore the knowledge an agent learns from, answer knowledge gaps and start training. > > `list_sources` · `get_sources_summary` · `add_url_source` · `add_qna_pairs` · `update_source` · `delete_source` · `start_training` > [accordion] Conversations > > Search and read conversations, start one with an agent, send messages, and resolve or pause the AI. > > `query_conversations` · `search_conversations` · `get_conversation_detail` · `create_conversation` · `send_message` · `resolve_conversation` > [accordion] Helpdesk > > Search and read tickets, reply as a teammate, add internal notes, and manage rules, teams, shifts and macros. > > `query_tickets` · `get_ticket_detail` · `send_agent_message` · `add_internal_note` · `save_helpdesk_rule` · `save_macro` > [accordion] Actions and procedures > > Build, test and publish Actions, create and update Procedures, and manage webhooks. > > `list_action_catalog` · `build_action` · `create_procedure` · `update_procedure` · `publish_draft` · `create_webhook` ## Reviewed changes Tools that change something don't change it right away. They return a review instead: ```json { "status": "review_required", "reviewId": "", "changes": [ "…what will change…" ], "expiresAt": "2026-12-01T10:15:00.000Z" } ``` The assistant shows you the changes, and only after you agree does it call `apply_change` with the `reviewId`. A review expires after 15 minutes and works only once. > [!WARNING] > > Some changes can't be undone. Deleting an Action or a Procedure removes it from the live agent, and editing a source overwrites its content. Read each review before you approve it. ### Limits * The workspace needs a paid plan: **Starter**, **Growth** or **Enterprise**. On **Free**, the consent screen shows **Paid plan required**. * Each connection can make 2,000 requests every 15 minutes. * Tools that return lists are paged. See [Pagination](/docs/api-reference/v2/pagination). ### Errors A failed tool call returns a tool error with a code, such as `REVIEW_EXPIRED` or `INVALID_ARGUMENTS`. The review codes: | Code | Meaning | | - | - | | `REVIEW_NOT_FOUND` | No review has that `reviewId`. | | `REVIEW_ALREADY_USED` | The review was already applied. | | `REVIEW_EXPIRED` | More than 15 minutes passed. Call the tool again for a fresh review. | | `STALE_REVIEW` | What the review would change has changed since. Call the tool again. | | `NOTHING_TO_CHANGE` | The change matches what's already there. | | `INVALID_ARGUMENTS` | The tool's input was rejected. | These errors come from the MCP endpoint itself, before any tool runs: | Status | Code | Meaning | | - | - | - | | 401 | `OAUTH_REQUIRED` | No token was sent. The `WWW-Authenticate` header points the client to sign-in. | | 401 | `INVALID_OAUTH_TOKEN` | The token has expired or was revoked. Sign in again. | ## Manage connected apps Every app you approve appears under **Workspace settings › General › Connected apps**, with when it connected, when it was last used and when its approval expires. Select **Revoke**, then confirm in **Revoke access?**, to cut off an app. The app has to ask for your approval again before it can reconnect. > [!NOTE] > > An app chooses its own name when it registers, and QwryAI can't verify it. Treat the name as a label, not proof of who made the app, and revoke anything you don't recognise. ## Troubleshooting > [accordion] The client says the server needs authentication > > That's expected before you sign in. Run your client's sign-in step (`/mcp` in Claude Code, `codex mcp login qwryai` in Codex) and approve the consent screen. > [accordion] A tool the assistant needs is missing > > The approval was narrower than the task needs. Ask the assistant to call `get_account_context` to see the permissions in use, then revoke the app under **Connected apps** and reconnect, approving the permissions it needs. > > If a permission isn't offered on the consent screen at all, your own role doesn't include it. A workspace admin has to give you a role that does. > [accordion] A change didn't happen > > Changes wait for review. If the assistant didn't call `apply_change` within 15 minutes, the review expired and nothing changed. Ask it to run the tool again and apply the new review. > [accordion] A source isn't live yet > > Training runs in the background. Ask the assistant to call `check_training_status` instead of assuming the change finished.