MCP
Enable the Model Context Protocol server on a self-hosted Qyra instance
Enterprise The MCP server needs a valid QYRA_LICENSE_KEY set on your instance — see enterprise features for applying the key. Without it, the MCP service is never registered and /api/v1/mcp returns an error.
Qyra exposes a Model Context Protocol server that AI assistants (Claude, ChatGPT, Codex, Cursor, Claude Code, and any other MCP client) connect to for querying the semantic layer. Enabling it on a self-hosted instance is a one-flag change.
Prerequisites
- Enterprise license —
QYRA_LICENSE_KEYmust be set on your instance. - HTTPS — MCP clients connect over HTTPS. See secure Qyra with HTTPS if your instance is HTTP-only.
Enable MCP
Set the following environment variable on your Qyra deployment:
MCP_ENABLED=trueThe OAuth server is built into Qyra, so no external OAuth configuration is needed — the authentication flow works the same way as it does on Qyra Cloud.
Optional configuration
| Variable | Description |
|---|---|
MCP_ENABLED | Enables the Qyra Model Context Protocol (MCP) server. Requires QYRA_LICENSE_KEY. (default=false) |
MCP_RUN_SQL_MAX_LIMIT | Maximum number of rows the MCP run_sql tool can return. Falls back to AI_COPILOT_MAX_QUERY_LIMIT, then 1000. |
Set MCP_RUN_SQL_MAX_LIMIT to override the default row cap for the run_sql tool, tuned independently of AI Analyst. For example:
MCP_RUN_SQL_MAX_LIMIT=5000Requests that ask for more rows are clamped to this limit.
MCP URL format
Once enabled, the MCP endpoint is available at:
https://<your-qyra-host>/api/v1/mcpReplace <your-qyra-host> with your instance's domain (e.g. qyra.yourcompany.com).
Connect an AI assistant
Follow the same steps as Qyra Cloud, using your self-hosted URL instead of a .qyraflow.com address. See the Qyra MCP installation guide for detailed instructions per AI assistant.
For example, with Claude Code:
claude mcp add qyra https://<your-qyra-host>/api/v1/mcp -t httpNetwork requirements
If your Qyra instance sits behind a firewall or VPN, ensure the MCP client can reach it over HTTPS. See the MCP network requirements for additional domains that may need allow-listing depending on the AI assistant.
Troubleshooting
| Symptom | Likely cause |
|---|---|
/api/v1/mcp returns an error or 404 | MCP_ENABLED isn't set to true, or QYRA_LICENSE_KEY is missing or invalid |
| OAuth flow fails | The Qyra instance isn't reachable from the browser performing the OAuth redirect |
| AI assistant can't connect | The MCP URL is wrong or the instance isn't accessible over HTTPS |