The Parts of Connect AI
Architecture Diagram
How an MCP Request Flows
1
The agent connects. It connects to the Connect AI MCP server at
https://mcp.cloud.cdata.com/mcp, or to the agent URL of a tool server. It authenticates with OAuth, or with Basic Authentication that uses your email address and a personal access token. Connect AI checks your identity, then uses a short-lived internal token for the rest of the request, so your own token never goes past the MCP server.2
The agent finds the right data. It calls the
search_context tool with the question. The tool returns the relevant datasets with their fully qualified names, field descriptions, and join hints. On its first call, the agent also requests your user context.The search_context tool searches only your context. It doesn’t call the connectors or the query engine, and Data Security rules don’t currently apply to its results.3
The agent runs a query. It calls the
queryData tool with a SQL query that uses the fully qualified table names. Writes use the execute_insert and execute_update tools.4
Connect AI checks access and runs the query. It checks the rate limit and your permissions, then loads the connection and its encrypted credentials. Data Security rules for inbound data check the query just before it runs. The query engine runs the query, and the connector calls the source live, or reads cached data if you turned on caching for that table.
5
Results return to the agent. Data Security rules for outbound data check the results before Connect AI writes the response, which returns the results in CSV format. Connect AI doesn’t store the rows. It records the query text, user, row counts, duration, and any error in the query log, and counts queries and rows for billing. Features that store data on purpose, such as caching and replication jobs, keep their own copy.
How an LLM Request Flows
1
The application sends a request. Your application (an agent, a script, or a tool such as
Claude Code) sends a request to
https://cloud.cdata.com/gateway/v1 with a virtual key, either
as the bearer token or in the x-api-key header. The endpoint is OpenAI-compatible and also
accepts requests in the Anthropic format, so the OpenAI and Anthropic SDKs both work against the
same URL. The endpoint doesn’t accept a personal access token.2
The gateway applies the routing rule. The virtual key identifies the project and the user or
service account that it was issued to. The project’s routing rule, or the workspace default if
the project inherits it, selects the provider: a single provider, a priority failover chain, or
a model allowlist. The gateway then checks the project’s budget and rate limits, and refuses the
request if it exceeds a hard budget or a rate limit.
3
The gateway forwards the request. Connect AI forwards the request with the provider API key
that an administrator registered. The provider key stays in Connect AI, so your application
needs only its virtual key. If Prompt Enrichment is on for the routing rule, the gateway
appends context to your message: matching global context, which it searches on every message,
and your user context, which it adds once at the start of each conversation.
4
The response returns. The provider’s response comes back to your application through the
gateway, including streamed responses. Connect AI records usage and a trace for each request
(model, provider, tokens, estimated cost, user, project, status, and timing). It doesn’t store
prompt or completion text.
Other Ways to Connect
The same connections also serve BI, ETL, and developer tools:- Virtual Databases and the SQL Server endpoint let tools query Connect AI as a SQL Server database.
- The REST, OData, and OpenAPI interfaces serve applications and integration platforms.
- Integrations lists setup guides for each supported tool.
Next Steps
Quick Start
Connect an agent and query live data.
Context Overview
How context improves answers.