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

# MCP servers

> Bundle tools, agents, and data models behind a single Model Context Protocol endpoint with defineMcpServer.

An **MCP server** exposes a curated set of your tools, agents, and data models behind one [Model Context Protocol](https://modelcontextprotocol.io/) endpoint, so external assistants (Claude, Cursor, …) can discover and call them. You define one with `defineMcpServer`.

## Define an MCP server

Each member is passed by handle — the same rich refs an agent accepts:

```ts mcp/crm.ts theme={null}
import { defineMcpServer } from "@cargo-ai/cdk";
import { sdr } from "../agents/sdr";
import { contacts } from "../models/contacts";
import { enrich } from "../tools/enrich";

export const crmServer = defineMcpServer("crm", {
  description: "CRM tools and data for assistants.",
  tools: [enrich],
  agents: [sdr],
  models: [{ ref: contacts, readOnly: true }],
});
```

## Deploy and connect

```bash theme={null}
cargo-ai cdk deploy
cargo-ai ai mcp-server list
```

Point your MCP client at the deployed endpoint to use the bundled tools and agents as native actions.

## From the CLI

```bash theme={null}
cargo-ai ai mcp-server create --name "GTM tools"
cargo-ai ai mcp-server update --uuid <uuid> --name "GTM tools"
```
