> For the complete documentation index, see [llms.txt](https://adiom.gitbook.io/data-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adiom.gitbook.io/data-api/tutorials/connecting-ai-agents.md).

# Connecting AI Agents

Data API offers native integration with any AI agent that supports [Model Context Protocol](https://modelcontextprotocol.io/introduction), such as Claude. It offers secure and controlled access to your data infrastructure without the risks associated with unpredictable and non-deterministic access patterns.

To access Data API via MCP you will need the [grpcmcp](https://github.com/adiom-data/grpcmcp) tool. It exposes an MCP-compatible server with *tools* that correspond to endpoints that were defined in the Data API proto file. You can read more about how it works in [this blog post](https://medium.com/@adkomyagin/how-to-connect-claude-ai-to-enterprise-services-with-mcp-8783c1dd7b61).

After downloading the **grpcmcp** tool, you can connect Claude to Data API by adding it to Claude configuration file that would like like the following:

```json
// Claude Desktop config file
{
  "mcpServers": {
    "movies": {
      "command": "<FULL PATH>/grpcmcp",
      "args": [
        "--bearer=<MY TOKEN>",            // authentication token
        "--header="Dapi-Key: <DAPI_KEY>", // for hosted DAPI only
        "--url=<GRPC SERVER>",            // backend grpc service
        "--reflect"                       // use reflection to get the endpoints
      ]
    }
  }
}
```

Tools descriptions are automatically generated based on endpoint comments in the protobuf file, for example:

```
service MovieService {
    // List available movies
    rpc List(ListRequest) returns (ListResp);
}
```

<figure><img src="https://4211308970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB2xwJ3fa5RUPg0ZyxPiH%2Fuploads%2FayWNe6aE1vNhhfzZnn4a%2Fimage.png?alt=media&amp;token=d232bd4e-30ba-490c-a4dc-71c13adf64f1" alt=""><figcaption></figcaption></figure>
