# Data Access (MCP)

{% hint style="warning" %}
**Deprecated.** Data-MCP is being replaced by two alternatives: [platform functions](/agent/platform-functions.md) for agent-side data access during conversations, and a new MCP endpoint built into the Platform API for external tool integrations. New integrations should use platform functions (`fn_query`) for agent workflows or the Platform API MCP endpoint for coding agents and external clients. Data-MCP remains available during the transition.
{% endhint %}

The Data-MCP service is a Model Context Protocol (MCP) server that gives MCP-compatible clients direct query access to workspace data. Any MCP client can connect to your workspace and run SQL queries, inspect schemas, and profile data without building custom integrations.

## How It Works

Data-MCP exposes workspace data through a set of SQL-based tools. Clients connect over stateless HTTP transport - no session affinity or sticky connections required. The server works behind load balancers without special configuration.

Authentication uses a standard Bearer token in the Authorization header plus an `X-Workspace-Id` header to scope queries. Every query runs within the boundaries of the authenticated workspace. There is no cross-workspace data access.

## Available Tools

Data-MCP provides seven tools:

| Tool                | What It Does                                                                                                                                                  |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **sql\_query**      | Run a SELECT query against workspace data. Results are capped and queries are time-bounded to prevent runaway operations. Write operations are not permitted. |
| **describe\_query** | Analyze a query and return the result schema (column names and types) without executing it. Useful for validating queries before running them.                |
| **tables**          | List available tables in the workspace. Supports filtering by name pattern.                                                                                   |
| **table\_schema**   | Return column names and data types for a specific table.                                                                                                      |
| **sample\_data**    | Preview rows from a table without writing a full query.                                                                                                       |
| **table\_detail**   | Extended metadata for a table including row counts, storage statistics, and partitioning information.                                                         |
| **profile\_column** | Statistical profile of a single column: min, max, null count, distinct count, and value distribution.                                                         |

## Regional Deployment

Data-MCP runs in every supported region alongside the Platform API. Queries execute within the same region as the workspace's data, so no data crosses regional boundaries during query processing. This applies to all seven tools - schema inspection, sampling, and full SQL queries all run locally within the workspace's region.

For details on available regions and data sovereignty controls, see [Data Residency](/platform-overview/data-residency.md).

## Workspace Isolation

All queries are scoped to the authenticated workspace. The MCP server enforces this at the query layer - there is no way for a client to access data from another workspace, even with a valid API key. This follows the same isolation model described in [Workspaces](/data/workspaces.md).

## Connecting an MCP Client

Point your MCP client at the Data-MCP server endpoint with your API key and workspace ID. The server uses standard HTTP transport, so any client that supports the Model Context Protocol can connect without custom adapters or plugins.

{% hint style="info" %}
Data-MCP only supports read operations. All queries are SELECT-only. If you need to write data, use the Platform API's data source endpoints or the connector runner's inbound pipeline.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.amigo.ai/data/data-mcp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
