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 endpoint, so external assistants (Claude, Cursor, …) can discover and call them. You define one with defineMcpServer.
Each member is passed by handle — the same rich refs an agent accepts:
mcp/crm.ts
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.", // One array — tools, agents, and data models (same surface as an agent): uses: [enrich, sdr, { ref: contacts, readOnly: true }],});