> ## Documentation Index
> Fetch the complete documentation index at: https://handbook.aiql.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP

> Agent access to workspace knowledge over the Model Context Protocol

The **MCP** server is the [Middleware API](/products/middleware) offered over the [Model Context Protocol](https://modelcontextprotocol.io). Compatible agents and clients call the same workspace, ingestion, query, and knowledge tools without a custom integration.

The endpoint is [api.aiql.io/mcp](https://api.aiql.io/mcp). Developer setup lives at [docs.aiql.io/mcp/overview](https://docs.aiql.io/mcp/overview).

Authentication is an API key, or OAuth for interactive clients. The same key works on the HTTP API and on MCP. OAuth binds the session to a workspace. An API key is scoped to a workspace per request.

## Pipeline

The same four steps as convert, split, shape, and extract on the Middleware API. An agent can chain them, or run them as one ingestion.

| Tool    | What it does                                                              |
| ------- | ------------------------------------------------------------------------- |
| Convert | Normalize a source URL into clean text.                                   |
| Split   | Break that text into structure-preserving pieces.                         |
| Shape   | Infer classes, properties, and relationships, or apply a supplied schema. |
| Extract | Pull entities and relationships as structured records.                    |

## Workspaces

| Tool             | What it does                                     |
| ---------------- | ------------------------------------------------ |
| List workspaces  | Workspaces the authenticated account can access. |
| Create workspace | Open a new workspace.                            |
| Get workspace    | Retrieve one workspace.                          |
| Update workspace | Rename or describe a workspace.                  |
| Delete workspace | Remove a workspace.                              |

## Ingestions

A managed job that runs the four pipeline steps and loads the result into the session workspace.

| Tool             | What it does                           |
| ---------------- | -------------------------------------- |
| List ingestions  | Ingestions in the workspace.           |
| Create ingestion | Start an ingestion from a source URL.  |
| Get ingestion    | Retrieve one ingestion and its status. |
| Cancel ingestion | Stop a running ingestion.              |
| Retry ingestion  | Retry a failed ingestion.              |
| Delete ingestion | Remove an ingestion.                   |

## Queries

Natural-language questions over already ingested workspace data. The same [answer](/products/models-answers) models as Explore in [Observatory](/products/observatory). Modes are ask, reason, and build.

| Tool              | What it does                                                        |
| ----------------- | ------------------------------------------------------------------- |
| List queries      | Queries in the workspace.                                           |
| Create query      | Run a natural-language query.                                       |
| Get query         | Retrieve a query and its result.                                    |
| Get query sources | Sources cited in a query, ranked by how often they were referenced. |
| Delete query      | Remove a query.                                                     |

## Sources and knowledge

Inspection of ingested sources and the structured records extracted from them. Retrieval fuses exact, lexical, and semantic match. See [Embeddings](/products/models-embeddings).

| Tool              | What it does                                                 |
| ----------------- | ------------------------------------------------------------ |
| List documents    | Rank workspace sources against a question.                   |
| Explain document  | Title, summary, counts, and classes for one source.          |
| Explain documents | Summaries for a set of sources.                              |
| Table of contents | Headings recovered from a source.                            |
| Get schema        | Classes, properties, and relationships for a source.         |
| Search knowledge  | Hybrid search over extracted facts.                          |
| List instances    | Entities of named classes.                                   |
| Count instances   | How many instances of named classes exist.                   |
| Related classes   | Classes that match a set of concepts across sources.         |
| Related records   | Neighbors of known records, optionally ranked by a question. |
| Node properties   | Full properties of named records.                            |
| Source passages   | The passage a record was extracted from, with page numbers.  |
| Profile columns   | Fill rate, ranges, and top values for source columns.        |
| Structured query  | A structured query against one source's knowledge.           |

## Artifacts

Work products on top of workspace knowledge. The same kinds of output as the [Artifacts API](/products/artifacts-api).

| Tool                  | What it does                                          |
| --------------------- | ----------------------------------------------------- |
| Generate canvas       | Create a canvas of nodes, edges, and optional frames. |
| Generate document     | Author a structured document from a topic.            |
| Generate presentation | Author a slide deck.                                  |

## Terminology

Clinical coding against the [Terminology API](/products/terminology-api).

| Tool               | What it does                                     |
| ------------------ | ------------------------------------------------ |
| Lookup terminology | Map a free-text term to standard clinical codes. |

## Preferences, rules, and knowledge

Workspace memory that later queries follow. The same kinds of record as Studio setup.

| Tool               | What it does                                   |
| ------------------ | ---------------------------------------------- |
| Suggest preference | Remember a preference for later conversations. |
| Suggest rule       | Store a rule the model should follow.          |
| Suggest knowledge  | Store a domain fact on the workspace.          |
