AiQL exposes a Model Context Protocol (MCP) server so AI agents and MCP-compatible clients can call the AiQL tools directly. The server speaks the streamable HTTP transport and is available at the /mcp endpoint.

Endpoint

https://api.aiql.io/mcp
The MCP server exposes the same tools as the API: the convert, split, shape, and extract pipeline tools, plus tools to manage workspaces, ingestions, and queries. See Tools for each tool’s parameters.

Authentication

The MCP server supports two ways to authenticate, both presented as a Bearer token in the Authorization header:
  • OAuth — for interactive clients, with AiQL as the authorization provider.
  • API key — for programmatic access from scripts and services.

OAuth

The MCP server is an OAuth 2.1 protected resource, with AiQL acting as the authorization server. Compatible clients discover the authorization server automatically: when a request arrives without a valid token, the server responds with 401 Unauthorized and a WWW-Authenticate header pointing at the protected resource metadata.
https://api.aiql.io/.well-known/oauth-protected-resource/mcp
The client reads that metadata, sends you through the AiQL sign-in and consent flow, and uses the issued access token on every request. You do not paste a key into the client — the OAuth flow handles it.

API key

For programmatic access, pass an AiQL API key as the Bearer token. API keys are prefixed with aiql_. Generate one in the Dashboard and keep it in an environment variable rather than committing it to source control.
Authorization: Bearer aiql_your_api_key
The same key works across the AiQL API and the MCP server.

Connect a client

How you connect depends on the credential you use.

With OAuth

Point an OAuth-capable MCP client at the endpoint and let it run the sign-in flow. No key goes in the config.
{
  "mcpServers": {
    "aiql": {
      "url": "https://api.aiql.io/mcp"
    }
  }
}

With an API key

For clients or automation that authenticate with a key, send it in the Authorization header.
{
  "mcpServers": {
    "aiql": {
      "url": "https://api.aiql.io/mcp",
      "headers": {
        "Authorization": "Bearer aiql_your_api_key"
      }
    }
  }
}
The MCP server uses the streamable HTTP transport. Make sure your client supports HTTP-based MCP servers rather than only stdio.

Next steps

Tools

See the tools the MCP server exposes and their parameters.

Authentication

Learn how Bearer tokens secure your requests.