cargo-ai
Build and configure AI agents inside Cargo — create an agent, choose its model and temperature, write its prompt, attach knowledge for retrieval (RAG), connect MCP tool servers, manage memories, and deploy releases. Triggers: "create an agent", "make an agent that", "give the age
Install
npx skills add https://github.com/getcargohq/cargo-skills/tree/main/cargo-ai
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install getcargohq-cargo-skills@llmmart
git clone https://github.com/getcargohq/cargo-skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole getcargohq/cargo-skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Cargo CLI — AI
Agent resource management: creating and configuring agents, attaching knowledge for retrieval-augmented generation (RAG), connecting MCP servers, and managing agent memories.
For using agents (sending messages, multi-turn chat, polling), use
cargo-orchestration. For uploading knowledge files and building knowledge libraries (thecontentdomain), usecargo-content. This skill covers how that knowledge attaches to an agent. For workspace administration — folders (used to organize agents and files), users, API tokens, roles, and submitting reports when the CLI fails — usecargo-workspace-management.
See
references/response-shapes.mdfor full JSON response structures. Seereferences/troubleshooting.mdfor common errors and how to fix them. Seereferences/examples/agents.mdfor agent CRUD and configuration examples. Seereferences/examples/mcp-servers.mdfor MCP server creation and management examples.
Bootstrap
Already signed in (cargo-ai whoami returns a workspace)? Skip to the next section.
npm install -g @cargo-ai/cli # no global install? prefix every command with `npx @cargo-ai/cli`
cargo-ai login --email you@company.com # emailed code, no browser; creates the account on first use
# alternatives: --oauth (browser) · --token <api-token> (CI)
cargo-ai whoami # confirm the active workspace before any write
Every command prints JSON to stdout; failures exit non-zero with {"errorMessage": "..."}. Anything that creates a run or a batch is async — pass --wait-until-finished or poll the matching get. When the full skill bundle is installed, ../cargo/references/prerequisites.md adds the CLI version pin, token scopes, and the admin-only surface.
Discover resources first
cargo-ai ai agent list # all agents (uuid, name, description)
cargo-ai ai template list # all AI agent templates (slug, name)
cargo-ai ai mcp-server list # all MCP servers (uuid, name)
cargo-ai ai memory list --scope agent --agent-uuid <uuid> # agent memories
# Knowledge files & libraries live in the content domain — see cargo-content:
# cargo-ai content file list / cargo-ai content library list
Retrieve in the UI: agents live at app.getcargo.io/workspaces/<WORKSPACE_UUID>/agents/<AGENT_UUID>. Get <WORKSPACE_UUID> from cargo-ai whoami under workspace.uuid.
Quick reference
cargo-ai ai agent list
cargo-ai ai agent get <agent-uuid>
cargo-ai ai agent create --name <name> --icon-color blue --icon-face 🤖
cargo-ai ai agent update --uuid <agent-uuid> --name <name>
cargo-ai ai agent remove <agent-uuid>
cargo-ai ai release list --agent-uuid <uuid>
cargo-ai ai release get <release-uuid>
cargo-ai ai release get-draft --agent-uuid <uuid>
cargo-ai ai release update-draft --agent-uuid <uuid> --language-model-slug gpt-4o
cargo-ai ai release deploy-draft --agent-uuid <uuid>
cargo-ai ai template list # full detail; there is no `template get`
cargo-ai ai mcp-server list
cargo-ai ai mcp-server create --name "Internal Tools"
cargo-ai ai mcp-server update --uuid <mcp-server-uuid> --name "Updated Name"
cargo-ai ai mcp-server remove <mcp-server-uuid>
cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse
cargo-ai mcp # serve the platform MCP over stdio
cargo-ai mcp --server <mcp-server-uuid> # serve a curated workspace MCP server instead
cargo-ai ai memory list --scope agent --agent-uuid <uuid>
cargo-ai ai memory update --mem0-id <id> --scope agent --agent-uuid <uuid> --content "Updated memory"
cargo-ai ai memory remove --mem0-id <id> --scope agent --agent-uuid <uuid>
Agents
Agents are AI resources with configured instructions, a language model, actions, and optional resources.
Before creating an agent from scratch, check existing templates — they capture proven patterns for common use cases (lead research, classification, email drafting) and give you a ready-made system prompt, model, and temperature to start from:
cargo-ai ai template list # browse patterns — full detail, not a summary
# there is no `template get`: `list` already returns systemPrompt, temperature,
# languageModelSlug, actions and resources, so select the one you want
cargo-ai ai template list | jq '.templates[] | select(.slug == "<slug>")'
# List all agents
cargo-ai ai agent list
# Get a single agent (includes deployed release details)
cargo-ai ai agent get <agent-uuid>
# Create an agent
cargo-ai ai agent create \
--name "Lead Researcher" \
--icon-color blue --icon-face 🤖 \
--description "Researches leads and enriches data"
# Update an agent
cargo-ai ai agent update --uuid <agent-uuid> \
--name "Senior Lead Researcher" \
--description "Updated description"
# Move to a folder (find folder UUIDs via cargo-workspace-management)
cargo-ai ai agent update --uuid <agent-uuid> --folder-uuid <folder-uuid>
# Remove an agent
cargo-ai ai agent remove <agent-uuid>
Agent icon: --icon-color must be one of: grey, green, purple, yellow, blue, red. --icon-face is an emoji string.
Folders: Folder creation, listing, and management lives in cargo-workspace-management (cargo-ai workspaceManagement folder list/create/...). Use that skill to discover or create the <folder-uuid> you pass to --folder-uuid here.
Releases
Releases are versioned snapshots of an agent's configuration (system prompt, actions, resources, model, temperature). Agents execute against their deployed release.
# List releases for an agent
cargo-ai ai release list --agent-uuid <uuid>
# Get a specific release
cargo-ai ai release get <release-uuid>
# Get the current draft release (editable)
cargo-ai ai release get-draft --agent-uuid <uuid>
# Update the draft release
cargo-ai ai release update-draft --agent-uuid <uuid> \
--system-prompt "You are a lead research assistant..." \
--language-model-slug gpt-4o \
--temperature 0.3 \
--max-steps 10
# Deploy the draft release (makes it live)
cargo-ai ai release deploy-draft --agent-uuid <uuid> \
--integration-slug openai \
--language-model-slug gpt-4o \
--actions '[]' \
--mcp-clients '[]' \
--resources '[]' \
--capabilities '[]' \
--suggested-actions '[]' \
--description "Added research actions"
Structured output & heartbeat — not yet exposed as CLI flags
The release API payload (both draft/update and draft/deploy) accepts two fields that release update-draft / release deploy-draft do not surface as flags (verified against the CLI source — there is no --output / --output-schema or --heartbeat):
| Field | Shape | Purpose |
|---|---|---|
output |
{"type":"text"} or {"type":"jsonSchema","jsonSchema": <standard JSON Schema object>} |
Force the agent to return structured output matching a JSON Schema. |
heartbeat |
{"intervalMinutes": number, "maxMessages": number, "prompt": string \| null} |
Periodically re-wake the chat (intervalMinutes) until it reaches maxMessages; prompt is the wake message (null = generic "continue"). |
The generic --options flag does not carry these — the API's options only holds {connectorUuidsByIntegrationSlug, modelUuidsByIntegrationSlug}. Until the flags ship, set these with a direct API call against the same endpoints the CLI uses:
# Structured (JSON Schema) output on the draft release
curl -sS -X PUT "$CARGO_API_BASE/v1/ai/releases/draft/update" \
-H "Authorization: Bearer $CARGO_TOKEN" -H "Content-Type: application/json" \
-d '{"agentUuid":"<uuid>","output":{"type":"jsonSchema","jsonSchema":{"type":"object","properties":{"score":{"type":"number"}},"required":["score"]}}}'
# Deploy carries the same fields — POST .../v1/ai/releases/draft/deploy
Send these payloads alongside the other fields you're updating (the endpoint replaces the draft config). File a workspaceManagement report (see ../cargo-workspace-management/SKILL.md) to request first-class --output / --heartbeat flags — this is the documented feedback channel for CLI/UI parity gaps.
Agent configuration workflow:
- Browse templates for inspiration:
cargo-ai ai template list— it returns each template in full (system prompt, model, temperature, actions), so pick the one closest to your use case straight out of that response - Create the agent:
cargo-ai ai agent create --name "..." --icon-color blue --icon-face 🤖 - Get the draft release:
cargo-ai ai release get-draft --agent-uuid <uuid> - Update the draft with configured actions, resources, prompt, model:
cargo-ai ai release update-draft --agent-uuid <uuid> ... - Deploy:
cargo-ai ai release deploy-draft --agent-uuid <uuid> ...
Templates
Templates are pre-built agent configurations that capture proven patterns for common use cases. Always check templates before designing an agent from scratch — they give you a ready-made system prompt, recommended language model, temperature, and tool configuration that you can adopt as-is or adapt.
# List available agent templates — each entry is complete, so this is the only
# call you need. There is no `template get` subcommand.
cargo-ai ai template list
# Inspect one by slug: filter the same response
cargo-ai ai template list | jq '.templates[] | select(.slug == "<slug>")'
Templates include a system prompt, actions, resources, and recommended model settings. Use them as a starting point and customize via release update-draft. See references/examples/templates.md for the full guide including an end-to-end example of creating an agent from a template.
Model and temperature guidance
| Use case | Recommended model | Temperature |
|---|---|---|
| Classification, extraction, scoring | gpt-4o-mini or claude-3-5-haiku |
0.0 – 0.2 |
| Research, summarization, analysis | gpt-4o or claude-3-5-sonnet |
0.2 – 0.5 |
| Copywriting, personalization | gpt-4o or claude-3-5-sonnet |
0.5 – 0.8 |
| Brainstorming, creative ideation | gpt-4o or claude-opus |
0.7 – 1.0 |
Low temperature (0.0–0.2) = deterministic, consistent outputs. High temperature (0.7+) = creative, varied outputs. For production workflows processing thousands of records, prefer low temperature.
Knowledge for RAG (files & libraries)
Knowledge that grounds agent responses (retrieval-augmented generation, RAG) comes from the content domain — see cargo-content:
- Files — uploaded binaries (PDFs, CSVs, text).
- Libraries — collections that group files, either
native(workspace-managed) orconnector-backed (synced from an external source via an unstructured-data extractor).
Files and libraries moved out of
aiinto the top-levelcontentdomain in CLI ≥ 1.0.19 (cargo-ai content file …/cargo-ai content library …). The oldai file …commands are gone. Everything content-related now lives incargo-content.
Attaching knowledge to an agent
A file or library is inert until attached to an agent via the draft release's resources array and deployed. Upload files / build libraries in cargo-content, then wire them in here with release update-draft --resources … followed by release deploy-draft. See ../cargo-content/references/examples/files.md for the full upload → attach → deploy sequence.
MCP — two directions, don't mix them up
MCP (Model Context Protocol) runs both ways in Cargo, and the two surfaces are unrelated:
Publish — ai mcp-server |
Consume — ai mcp-client |
|
|---|---|---|
| What it is | A server your workspace exposes: the tools, agents, and data you choose to make callable | A connection to someone else's MCP server |
| Who calls it | Any MCP client — Claude Code, Claude Desktop, Cursor, ChatGPT | Your Cargo agents, during a chat or a workflow run |
| Wired via | cargo-ai mcp --server <uuid> (stdio bridge, below) |
release update-draft --mcp-clients … |
Before building one, check whether the platform MCP already covers it. Cargo now serves a first-party MCP at https://mcp.getcargo.io/mcp — every workspace member, nothing to deploy — with a small fixed toolset for operating the workspace (whoami, get_usage, search_actions, get_action_schema, autocomplete_action, execute_action, execute_action_batch, get_run, get_batch, list_runs, list_models, describe_model, query_models). Hosted clients (ChatGPT connectors, Claude.ai, Cursor over HTTP) point at that URL and sign in with OAuth; the consent screen picks the workspace when the user belongs to several. ai mcp-server is for the other job: a curated, named subset — this tool, that agent, this filtered model — for a client that should see exactly that and nothing else.
Publishing a workspace MCP server
cargo-ai ai mcp-server list
cargo-ai ai mcp-server create --name "CRM tools" \
--actions '[{"slug":"<tool-uuid>","kind":"tool","name":null,"description":null,"isBulkAllowed":false,"config":{}}]' \
--resources '[{"kind":"model","slug":"<slug>","name":"Accounts","description":null,"integrationSlug":"hubspot","modelUuid":null,"filter":null,"selectedColumnSlugs":null,"limit":null,"prompt":null,"isReadOnly":true}]'
cargo-ai ai mcp-server update --uuid <mcp-server-uuid> --name "Updated name"
cargo-ai ai mcp-server remove <mcp-server-uuid>
- Actions take
kind: "tool"orkind: "agent"— an agent can be exposed as a callable MCP tool, not just a tool.waitUntilFinishedcontrols whether the call blocks on the run. - Resources take
kind: "model"(a filtered, column-selected view of a model — keepisReadOnly: trueunless the client is meant to write) orkind: "file"(workspace files by UUID, see../cargo-content/SKILL.md). - Capabilities (
--capabilities, CLI ≥ 1.0.86) expose Cargo's own built-in tools on the server, alongside your actions and resources. JSON array of{slug, config}:
The nine slugs arecargo-ai ai mcp-server create --name "Research" \ --capabilities '[{"slug":"webSearch","config":{}}]'sandbox,memory,context,app,document,webSearch,model,file, anddocumentationSearch— the same set an agent release takes in its own--capabilities, which is why the examples above pass'[]'rather than omitting it. In a CDK project the same field accepts a bare slug (capabilities: ["webSearch"]). updatereplaces--actions/--resources/--capabilitieswholesale rather than merging — read the current server withmcp-server listand pass the full array back.
Serving it to a coding agent — cargo-ai mcp
Either server reaches any stdio MCP client through the CLI, using the credentials already on the machine. No token is copied into client config.
claude mcp add cargo -- cargo-ai mcp # the platform MCP (no setup)
cargo-ai ai mcp-server list # find a curated server's UUID
claude mcp add cargo -- cargo-ai mcp --server <uuid> # that curated server instead
# Cursor, Windsurf, and other stdio clients: same command as the server entry
With no --server, the bridge uses CARGO_MCP_SERVER_UUID when set, otherwise the platform /mcp. This changed: older CLIs resolved "the workspace's only MCP server" and failed with InvalidUsage when the workspace had none or several — a bare cargo-ai mcp now always has something to serve. stdout carries the MCP protocol and all logs go to stderr, so never print anything to stdout around it.
When to reach for this instead of the skills: the skills give an agent the whole CLI; an MCP surface gives it a bounded set with no shell. Use the bridge for in-conversation lookups and one-off actions, and the CLI for batches, workflows, schema changes, and anything with a cost gate. Full routing rule: ../cargo/SKILL.md → "These skills vs Cargo's MCP surfaces".
Consuming an external MCP server
cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse
cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse \
--disabled-tool-slugs "dangerous_tool,other_tool"
--authentication takes {"issuedAt": "...", "accessToken": "..."} or "null". Connected clients are attached to an agent through its release: release update-draft --mcp-clients …, then release deploy-draft.
Memories
Memories are pieces of information an agent stores from conversations for future reference. They can be scoped to a workspace, user, or specific agent.
# List agent memories
cargo-ai ai memory list --scope agent --agent-uuid <uuid>
# List workspace-wide memories
cargo-ai ai memory list --scope workspace
# List user-scoped memories
cargo-ai ai memory list --scope user
# Update a memory
cargo-ai ai memory update \
--mem0-id <id> \
--scope agent --agent-uuid <uuid> \
--content "Updated memory content"
# Remove a memory
cargo-ai ai memory remove \
--mem0-id <id> \
--scope agent --agent-uuid <uuid>
Help
Every command supports --help:
cargo-ai ai agent create --help
cargo-ai ai release update-draft --help
cargo-ai ai mcp-server create --help
cargo-ai ai memory list --help
Files (cargo-skills)
-
references
-
examples
-
agents.md 3.3 KB
# Agent examples ## List all agents ```bash cargo-ai ai agent list ``` ## Find an agent by name ```bash cargo-ai ai agent list # → Scan the "name" fields in the response to find the target agent UUID ``` ## Create an agent ```bash cargo-ai ai agent create \ --name "Lead Researcher" \ --icon-color purple --icon-face 🔍 \ --description "Researches and qualifies leads using web data" ``` ## Create an agent in a folder Folders are managed by the [`cargo-workspace-management`](../../../cargo-workspace-management/SKILL.md) skill — see its `references/examples/folders.md` for create/list/update. ```bash cargo-ai workspaceManagement folder list # → Find the folder UUID (kind: "agent") cargo-ai ai agent create \ --name "Lead Researcher" \ --icon-color purple --icon-face 🔍 \ --folder-uuid <folder-uuid> ``` ## Configure and deploy an agent (full workflow) ```bash # 1. Create the agent cargo-ai ai agent create \ --name "Company Scorer" \ --icon-color green --icon-face 📊 # → agent.uuid # 2. Get the draft release cargo-ai ai release get-draft --agent-uuid <agent-uuid> # → release.uuid # 3. Configure the draft: set model, temperature, prompt cargo-ai ai release update-draft --agent-uuid <agent-uuid> \ --language-model-slug gpt-4o-mini \ --temperature 0.0 \ --max-steps 5 \ --system-prompt "You are a company scoring assistant. Given a company record, score it from 1-10 based on fit criteria." # 4. Deploy the draft cargo-ai ai release deploy-draft --agent-uuid <agent-uuid> \ --integration-slug openai \ --language-model-slug gpt-4o-mini \ --actions '[]' \ --mcp-clients '[]' \ --resources '[]' \ --capabilities '[]' \ --suggested-actions '[]' \ --description "Initial deployment with scoring prompt" ``` ## Update an agent's name and description ```bash cargo-ai ai agent update --uuid <agent-uuid> \ --name "Senior Lead Researcher" \ --description "Advanced lead research with enrichment capabilities" ``` ## Move an agent to a different folder ```bash cargo-ai ai agent update --uuid <agent-uuid> --folder-uuid <folder-uuid> ``` ## Remove an agent ```bash cargo-ai ai agent remove <agent-uuid> ``` ## Create an agent from a template ```bash # 1. Browse templates — the response is complete, not a summary cargo-ai ai template list # 2. Pick one out of that same response (there is no `template get`) cargo-ai ai template list | jq '.templates[] | select(.slug == "<template-slug>")' # → Copy the systemPrompt, actions, resources, model settings # 3. Create the agent cargo-ai ai agent create \ --name "My Custom Agent" \ --icon-color blue --icon-face 🤖 # 4. Apply template settings to the draft cargo-ai ai release update-draft --agent-uuid <agent-uuid> \ --system-prompt "<from template>" \ --language-model-slug <from template> \ --temperature <from template> # 5. Deploy cargo-ai ai release deploy-draft --agent-uuid <agent-uuid> \ --integration-slug <from template> \ --language-model-slug <from template> \ --actions '[]' \ --mcp-clients '[]' \ --resources '[]' \ --capabilities '[]' \ --suggested-actions '[]' ``` ## List releases for an agent ```bash cargo-ai ai release list --agent-uuid <agent-uuid> ``` ## View the current live configuration ```bash cargo-ai ai agent get <agent-uuid> # → .deployedRelease contains the full live config (prompt, model, actions, resources) ``` -
mcp-servers.md 2 KB
# MCP server examples ## List all MCP servers ```bash cargo-ai ai mcp-server list ``` ## Create an MCP server ```bash cargo-ai ai mcp-server create --name "Internal Tools" ``` ## Connect an MCP server to an agent MCP servers are connected to agents as MCP clients on the release: ```bash # 1. Create or find the MCP server cargo-ai ai mcp-server list # → mcp-server-uuid # 2. Add as an MCP client on the agent's draft release cargo-ai ai release update-draft --agent-uuid <agent-uuid> \ --mcp-clients '[{"kind":"custom","name":"Internal Tools","url":"https://mcp.example.com","authentication":null,"disabledToolSlugs":[]}]' # 3. Deploy cargo-ai ai release deploy-draft --agent-uuid <agent-uuid> \ --language-model-slug gpt-4o \ --integration-slug openai ``` **MCP client kinds:** - `custom` — URL-based MCP server. Requires `name`, `url`, and optionally `authentication`. - `connector` — Integration-backed MCP client. Requires `name`, `connectorUuid`, `integrationSlug`. ## Connect a connector-backed MCP client ```bash # 1. Find the connector cargo-ai connection connector list # → connector-uuid, integrationSlug # 2. Add as an MCP client cargo-ai ai release update-draft --agent-uuid <agent-uuid> \ --mcp-clients '[{"kind":"connector","name":"HubSpot Tools","connectorUuid":"<connector-uuid>","integrationSlug":"hubspot","disabledToolSlugs":[]}]' # 3. Deploy cargo-ai ai release deploy-draft --agent-uuid <agent-uuid> \ --language-model-slug gpt-4o \ --integration-slug openai ``` ## Disable specific actions from an MCP server Use `disabledToolSlugs` to prevent the agent from using specific MCP actions: ```bash cargo-ai ai release update-draft --agent-uuid <agent-uuid> \ --mcp-clients '[{"kind":"custom","name":"Internal Tools","url":"https://mcp.example.com","authentication":null,"disabledToolSlugs":["dangerous_tool","admin_tool"]}]' ``` ## Update an MCP server name ```bash cargo-ai ai mcp-server update --uuid <mcp-server-uuid> --name "Production Tools" ``` ## Remove an MCP server ```bash cargo-ai ai mcp-server remove <mcp-server-uuid> ``` -
templates.md 4.6 KB
# AI template examples ## What is an AI template? An **AI template** is a pre-built agent configuration — a ready-to-use agent blueprint with instructions, model settings, and action configuration already defined. Templates capture common agent patterns (lead research, company classification, email drafting) so you don't have to configure an agent from scratch. **Always check templates before creating an agent.** Even if no template is a perfect match, they provide: - A proven system prompt structure for the use case - A recommended language model and temperature setting - A list of actions and resources to consider attaching AI templates are read-only. You discover them by listing, then use their configuration as a starting point when creating or updating an agent. ## List all AI templates ```bash cargo-ai ai template list ``` Response: ```json { "templates": [ { "slug": "lead-researcher", "name": "Lead Researcher", "description": "Researches a prospect's company, role, and contact details", "languageModelSlug": "gpt-4o", "temperature": 0.3 }, { "slug": "company-classifier", "name": "Company Classifier", "description": "Classifies a company by industry, size, and ICP fit", "languageModelSlug": "gpt-4.1-mini", "temperature": 0.1 }, { "slug": "email-drafter", "name": "Email Drafter", "description": "Drafts personalised outbound emails based on enrichment data", "languageModelSlug": "gpt-4o", "temperature": 0.7 } ] } ``` Key fields: - **`slug`** — identifier for reference - **`name`** — human-readable name - **`description`** — what the agent does - **`languageModelSlug`** — recommended model for this use case - **`temperature`** — recommended temperature setting ## Use a template to create an agent The standard pattern: 1. List templates to find the right one 2. Create a new agent using the template's recommended settings 3. Attach any files or MCP servers the agent needs 4. Start chatting or embed the agent in a workflow ```bash # 1. Find the right template cargo-ai ai template list # → Find "lead-researcher" # 2. Create an agent cargo-ai ai agent create \ --name "Lead Researcher" \ --icon-color purple --icon-face 🔍 # → Extract agent.uuid # 3. Configure the draft release with template settings cargo-ai ai release update-draft --agent-uuid <agent-uuid> \ --system-prompt "You are a research assistant. Given a company domain and a contact name, find their role, LinkedIn profile, and email address. Be concise and structured." \ --language-model-slug gpt-4o \ --temperature 0.3 # 4. Attach a knowledge file (optional) cargo-ai content file upload --file ./icp-criteria.pdf # → Extract file.uuid — attach to agent via release update-draft --resources # 5. Test with a message cargo-ai ai chat create \ --trigger '{"type":"draft"}' \ --agent-uuid <agent-uuid> \ --name "Test session" # → Extract chat.uuid cargo-ai ai message create \ --chat-uuid <chat-uuid> \ --parts '[{"type":"text","text":"Research the VP of Sales at acme.com"}]' # → Poll with: cargo-ai ai message get <assistant-msg-uuid> ``` ## Use a template to configure an agent in a workflow node AI templates also inform how to configure an inline `agent` node inside a workflow node graph. Use the template's `languageModelSlug` and `temperature` in the node's `advancedSettings`: ```json { "uuid": "ab12cd34-ab12-4ab1-aab1-ab12cd34ef56", "slug": "research_lead", "kind": "native", "actionSlug": "agent", "config": { "prompt": { "kind": "templateExpression", "expression": "Research the person {{nodes.start.first_name}} {{nodes.start.last_name}} at {{nodes.start.domain}}. Return their role, LinkedIn URL, and a 2-sentence summary.", "instructTo": "none", "fromRecipe": false }, "advancedSettings": { "languageModelSlug": "gpt-4o", "temperature": 0.3, "maxSteps": 5 } }, "childrenUuids": ["cd34ef56-cd34-4cd3-acd3-cd34ef567890"], "fallbackOnFailure": false, "position": { "x": 0, "y": 166 } } ``` See `cargo-orchestration/references/nodes.md` for the full node creation guide. ## Template-to-agent quick reference | Template slug | Use case | Recommended model | Temperature | | --------------------- | ---------------------------- | ------------------ | ----------- | | `lead-researcher` | Prospect research | `gpt-4o` | 0.3 | | `company-classifier` | Industry / ICP classification| `gpt-4.1-mini` | 0.1 | | `email-drafter` | Personalised outbound emails | `gpt-4o` | 0.7 |
-
-
response-shapes.md 7.4 KB
# Response shapes JSON response structures returned by Cargo CLI commands used in the `cargo-ai` skill. ## cargo-ai ai agent list ```json { "agents": [ { "uuid": "agent-uuid", "workspaceUuid": "...", "name": "Sales Research Agent", "icon": { "color": "blue", "face": "🤖" }, "description": "Researches leads and enriches data", "triggers": [], "deployedRelease": { "uuid": "release-uuid", "version": "3", "description": "Added email step", "systemPrompt": "You are a sales research assistant...", "languageModelSlug": "gpt-4o", "integrationSlug": "openai", "temperature": 0.3, "maxSteps": 10, "actions": [], "resources": [], "capabilities": [], "mcpClients": [], "deployedAt": "2025-01-10T09:00:00Z", "createdAt": "2025-01-10T09:00:00Z" }, "folderUuid": null, "template": null, "isReadOnly": false, "createdAt": "2025-01-01T00:00:00Z", "updatedAt": "2025-01-15T00:00:00Z" } ] } ``` **Key fields:** `uuid` (needed for chat create, release operations), `name` (match by name), `deployedRelease` (current live config — `null` if never deployed). **Agent icon colors:** `grey`, `green`, `purple`, `yellow`, `blue`, `red`. ## cargo-ai ai agent get Same structure as a single item from `agent list`, nested under `agent`: ```json { "agent": { "uuid": "agent-uuid", "name": "Sales Research Agent", "icon": { "color": "blue", "face": "🤖" }, "deployedRelease": { ... }, ... } } ``` ## cargo-ai ai release list ```json { "releases": [ { "uuid": "release-uuid", "agentUuid": "agent-uuid", "version": "3", "status": "deployed", "description": "Added research actions", "systemPrompt": "You are a sales research assistant...", "languageModelSlug": "gpt-4o", "integrationSlug": "openai", "temperature": 0.3, "maxSteps": 10, "withReasoning": false, "actions": [], "resources": [], "capabilities": [], "suggestedActions": [], "mcpClients": [], "deployedAt": "2025-01-10T09:00:00Z", "createdAt": "2025-01-10T09:00:00Z", "updatedAt": "2025-01-10T09:00:00Z" } ] } ``` **Status values:** `draft`, `deployed`, `archived`. Supports `--agent-uuid`, `--limit`, `--offset`. ## cargo-ai ai release get ```json { "release": { "uuid": "release-uuid", "agentUuid": "agent-uuid", "version": "3", "status": "deployed", "description": "Added research actions", "systemPrompt": "You are a sales research assistant...", "languageModelSlug": "gpt-4o", "integrationSlug": "openai", "connectorUuid": null, "temperature": 0.3, "maxSteps": 10, "withReasoning": false, "actions": [ { "kind": "connector", "integrationSlug": "clearbit", "connectorUuid": "connector-uuid", "actionSlug": "company_enrich", "slug": "enrich_company", "name": "Enrich Company", "description": "Enriches company data", "isBulkAllowed": false, "config": {} } ], "resources": [ { "kind": "file", "slug": "knowledge_base", "name": "Knowledge Base", "description": null, "prompt": null, "items": [{ "kind": "file", "fileUuid": "file-uuid" }] } ], "capabilities": [], "suggestedActions": [], "mcpClients": [ { "kind": "custom", "name": "Internal Tools", "url": "https://mcp.example.com", "authentication": null, "disabledToolSlugs": [] } ], "deployedAt": "2025-01-10T09:00:00Z", "createdAt": "2025-01-10T09:00:00Z", "updatedAt": "2025-01-10T09:00:00Z" } } ``` **Key fields:** `actions` (array of tool/connector/agent actions), `resources` (file or model resources), `mcpClients` (MCP server connections), `systemPrompt`, `languageModelSlug`, `temperature`, `maxSteps`. **Action kinds:** `tool` (workflow tool), `connector` (integration action), `agent` (sub-agent). **Resource kinds:** `file` (uploaded files/folders), `model` (data model reference). **MCP client kinds:** `custom` (URL-based), `connector` (integration-backed). ## cargo-ai ai template list ```json { "templates": [ { "slug": "lead-researcher", "name": "Lead Researcher", "description": "Researches and qualifies leads using web data", "scope": "public", "isPreset": true, "kind": "agent", "icon": { "color": "purple", "face": "🔍" }, "languageModelSlug": "gpt-4o", "temperature": 0.3, "categories": ["prospecting"], "author": { "name": "Cargo", "title": "Platform", "company": { "name": "Cargo", "url": "https://getcargo.ai" } }, "createdAt": "2025-01-01T00:00:00Z", "updatedAt": "2025-01-15T00:00:00Z" } ] } ``` **Key fields:** `slug` (the handle you filter this list by), `name`, `languageModelSlug`, `temperature`. **Template categories:** `prospecting`, `ops`, `enablement`, `outreach`, `expansion`, `public`, `private`. ## `cargo-ai ai template list` — one entry Each element of `templates[]` is returned in full. There is no `template get` subcommand; filter this response by `slug` instead. ```json { "template": { "slug": "lead-researcher", "name": "Lead Researcher", "kind": "agent", "description": "...", "systemPrompt": "You are a lead research assistant...", "languageModelSlug": "gpt-4o", "integrationSlug": "openai", "temperature": 0.3, "maxSteps": 10, "withReasoning": false, "actions": [...], "resources": [...], "capabilities": [], "suggestedActions": [], "icon": { "color": "purple", "face": "🔍" }, "scope": "public", "isPreset": true, "categories": ["prospecting"], "author": { ... }, "createdAt": "2025-01-01T00:00:00Z", "updatedAt": "2025-01-15T00:00:00Z" } } ``` > **Content files & libraries** (`cargo-ai content file …` / `content library …`) live in the [`cargo-content`](../../cargo-content/SKILL.md) skill — see `cargo-content/references/response-shapes.md` for their shapes. ## cargo-ai ai mcp-server list ```json { "mcpServers": [ { "uuid": "mcp-server-uuid", "workspaceUuid": "...", "name": "Internal Tools", "actions": [ { "kind": "tool", "slug": "search_docs", "name": "Search Docs", "description": "Searches internal documentation", "isBulkAllowed": false, "config": {} } ], "createdAt": "2025-01-01T00:00:00Z", "updatedAt": "2025-01-15T00:00:00Z" } ] } ``` **Key fields:** `uuid`, `name`, `actions` (discovered actions from the MCP server). ## cargo-ai ai memory list ```json { "memories": [ { "mem0Id": "memory-id", "content": "The user prefers concise responses with bullet points", "scope": "agent", "agentUuid": "agent-uuid", "workspaceUuid": "...", "createdAt": "2025-01-15T10:00:00Z", "updatedAt": "2025-01-15T10:00:00Z" } ] } ``` **Memory scopes:** - `workspace` — shared across all agents and users in the workspace. Has `workspaceUuid`. - `user` — specific to a user. Has `userUuid`. - `agent` — specific to an agent. Has `agentUuid` and `workspaceUuid`. **Key field:** `mem0Id` (needed for update and remove operations). -
troubleshooting.md 3.8 KB
# Troubleshooting Common errors and solutions for `cargo-ai` commands. ## General **`{"errorMessage": "..."}`** All failed commands exit non-zero and return an error JSON. Read the `errorMessage` for the specific issue. **`Unauthorized` / `403`** Your API token may lack the required permissions. Verify with `cargo-ai whoami` and check that your role includes `ai:agent:*` or `ai:agent:write` actions. ## Agents **`agentNotFound`** The agent UUID does not exist or has been deleted. Re-run `cargo-ai ai agent list` to get the current list of agents. **`folderNotFound`** The folder UUID passed to `--folder-uuid` does not exist. Folders are managed by the [`cargo-workspace-management`](../../cargo-workspace-management/SKILL.md) skill — run `cargo-ai workspaceManagement folder list` to find valid folder UUIDs, or `cargo-ai workspaceManagement folder create --kind agent ...` to create one. **Agent has no deployed release** If `agent get` shows `deployedRelease: null`, the agent has never been deployed. Follow the release workflow: 1. `cargo-ai ai release get-draft --agent-uuid <uuid>` 2. `cargo-ai ai release update-draft --agent-uuid <uuid> --language-model-slug gpt-4o --system-prompt "..."` 3. `cargo-ai ai release deploy-draft --agent-uuid <uuid> --language-model-slug gpt-4o --integration-slug openai` ## Releases **`draftReleaseNotFound`** The agent does not have a draft release. This can happen if the agent was just created. Try `cargo-ai ai release get-draft --agent-uuid <uuid>` first — it may auto-create the draft. **`invalidParent`** The `--parent-uuid` passed to `release update-draft` does not match a valid release. Omit it or use a UUID from `release list`. **`invalidReleaseVersion`** The version string is invalid. Version must be a non-empty string (not a number). **`invalidConnector`** A connector UUID referenced in the release actions or configuration does not exist. Verify connector UUIDs with `cargo-ai connection connector list`. **`failedToReconciliateAgentAiTools`** The actions configuration in the release is invalid — a referenced tool, agent, or connector UUID may not exist. Verify all UUIDs in the actions array. **Can't set structured (JSON Schema) output or a heartbeat from the CLI** `release update-draft` / `release deploy-draft` have no `--output` / `--output-schema` or `--heartbeat` flag, even though the release API payload accepts `output` and `heartbeat`. The generic `--options` flag won't carry them. See the "Structured output & heartbeat" section in [`../SKILL.md`](../SKILL.md) for the shapes and the direct-API workaround, and file a `workspaceManagement report` to request the flags. ## Templates **`templateNotFound`** The template slug does not exist. Run `cargo-ai ai template list` to see available templates. ## Files & libraries Knowledge files and libraries moved to the `content` domain (CLI ≥ 1.0.19). For `fileNotFound`, `folderNotFound`, upload failures, and the `unknown command` error on the old `ai file …` path, see [`cargo-content`](../../cargo-content/SKILL.md) → `references/troubleshooting.md`. ## MCP Servers **`mcpServerNotFound`** The MCP server UUID does not exist or has been deleted. Run `cargo-ai ai mcp-server list` to get the current list. **MCP actions not appearing in agent** MCP servers are connected to agents via MCP clients on the release. After creating an MCP server, add it as an MCP client to the agent's draft release using `release update-draft`, then deploy. ## Memories **`memoryNotFound`** The `mem0Id` does not match any existing memory. Run `cargo-ai ai memory list` with the correct `--scope` and `--agent-uuid` to find valid memory IDs. **Wrong scope** Memory operations require the correct scope. An agent-scoped memory needs `--scope agent --agent-uuid <uuid>`. A workspace-scoped memory needs `--scope workspace`. Mismatched scopes return not-found errors.
-
-
skill-metadata.json 1020 B
{ "$comment": "Generated by .github/scripts/skills-metadata.mjs — do not hand-edit. Regenerate with: node .github/scripts/skills-metadata.mjs --write .", "name": "cargo-ai", "version": "2.4.0", "documents": [ { "path": "SKILL.md", "kind": "entrypoint", "title": "Cargo CLI — AI" }, { "path": "references/examples/agents.md", "kind": "example", "title": "Agent examples" }, { "path": "references/examples/mcp-servers.md", "kind": "example", "title": "MCP server examples" }, { "path": "references/examples/templates.md", "kind": "example", "title": "AI template examples" }, { "path": "references/response-shapes.md", "kind": "reference", "title": "Response shapes" }, { "path": "references/troubleshooting.md", "kind": "reference", "title": "Troubleshooting" } ], "contentHash": "430beb88a52f8b9b5e979cda75166243e53c93618f163d27f15812a59436a48d" } -
SKILL.md 18.8 KB
--- name: cargo-ai description: "Build and configure AI agents inside Cargo — create an agent, choose its model and temperature, write its prompt, attach knowledge for retrieval (RAG), connect MCP tool servers, manage memories, and deploy releases. Triggers: \"create an agent\", \"make an agent that\", \"give the agent our docs\", \"attach this knowledge base\", \"attach this library to the agent\", \"add resources to the agent release\", \"connect an MCP server\", \"expose our tools as an MCP server\", \"use Cargo from Claude Desktop or ChatGPT\", \"change the agent model\", \"what does the agent remember\", \"deploy the agent\", \"the agent is answering wrong\". Skip when: uploading the knowledge files themselves — use cargo-content; sending the agent a message or running it over records — use cargo-orchestration." version: "2.4.0" compatibility: Requires @cargo-ai/cli (npm). Sign in or create an account with `cargo-ai login --email` (emailed code, no browser), `--oauth`, or an API token homepage: https://github.com/getcargohq/cargo-skills metadata: author: getcargo openclaw: requires: bins: - cargo-ai install: - kind: node package: "@cargo-ai/cli@latest" bins: - cargo-ai homepage: https://github.com/getcargohq/cargo-skills --- # Cargo CLI — AI Agent resource management: creating and configuring agents, attaching knowledge for retrieval-augmented generation (RAG), connecting MCP servers, and managing agent memories. > For *using* agents (sending messages, multi-turn chat, polling), use `cargo-orchestration`. > For uploading knowledge **files** and building knowledge **libraries** (the `content` domain), use [`cargo-content`](../cargo-content/SKILL.md). This skill covers how that knowledge attaches to an agent. > For workspace administration — folders (used to organize agents and files), users, API tokens, roles, and submitting reports when the CLI fails — use [`cargo-workspace-management`](../cargo-workspace-management/SKILL.md). > See `references/response-shapes.md` for full JSON response structures. > See `references/troubleshooting.md` for common errors and how to fix them. > See `references/examples/agents.md` for agent CRUD and configuration examples. > See `references/examples/mcp-servers.md` for MCP server creation and management examples. ## Bootstrap Already signed in (`cargo-ai whoami` returns a workspace)? Skip to the next section. ```bash npm install -g @cargo-ai/cli # no global install? prefix every command with `npx @cargo-ai/cli` cargo-ai login --email you@company.com # emailed code, no browser; creates the account on first use # alternatives: --oauth (browser) · --token <api-token> (CI) cargo-ai whoami # confirm the active workspace before any write ``` Every command prints JSON to stdout; failures exit non-zero with `{"errorMessage": "..."}`. Anything that creates a run or a batch is async — pass `--wait-until-finished` or poll the matching `get`. When the full skill bundle is installed, [`../cargo/references/prerequisites.md`](../cargo/references/prerequisites.md) adds the CLI version pin, token scopes, and the admin-only surface. ## Discover resources first ```bash cargo-ai ai agent list # all agents (uuid, name, description) cargo-ai ai template list # all AI agent templates (slug, name) cargo-ai ai mcp-server list # all MCP servers (uuid, name) cargo-ai ai memory list --scope agent --agent-uuid <uuid> # agent memories # Knowledge files & libraries live in the content domain — see cargo-content: # cargo-ai content file list / cargo-ai content library list ``` **Retrieve in the UI:** agents live at `app.getcargo.io/workspaces/<WORKSPACE_UUID>/agents/<AGENT_UUID>`. Get `<WORKSPACE_UUID>` from `cargo-ai whoami` under `workspace.uuid`. ## Quick reference ```bash cargo-ai ai agent list cargo-ai ai agent get <agent-uuid> cargo-ai ai agent create --name <name> --icon-color blue --icon-face 🤖 cargo-ai ai agent update --uuid <agent-uuid> --name <name> cargo-ai ai agent remove <agent-uuid> cargo-ai ai release list --agent-uuid <uuid> cargo-ai ai release get <release-uuid> cargo-ai ai release get-draft --agent-uuid <uuid> cargo-ai ai release update-draft --agent-uuid <uuid> --language-model-slug gpt-4o cargo-ai ai release deploy-draft --agent-uuid <uuid> cargo-ai ai template list # full detail; there is no `template get` cargo-ai ai mcp-server list cargo-ai ai mcp-server create --name "Internal Tools" cargo-ai ai mcp-server update --uuid <mcp-server-uuid> --name "Updated Name" cargo-ai ai mcp-server remove <mcp-server-uuid> cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse cargo-ai mcp # serve the platform MCP over stdio cargo-ai mcp --server <mcp-server-uuid> # serve a curated workspace MCP server instead cargo-ai ai memory list --scope agent --agent-uuid <uuid> cargo-ai ai memory update --mem0-id <id> --scope agent --agent-uuid <uuid> --content "Updated memory" cargo-ai ai memory remove --mem0-id <id> --scope agent --agent-uuid <uuid> ``` ## Agents Agents are AI resources with configured instructions, a language model, actions, and optional resources. **Before creating an agent from scratch, check existing templates — they capture proven patterns for common use cases (lead research, classification, email drafting) and give you a ready-made system prompt, model, and temperature to start from:** ```bash cargo-ai ai template list # browse patterns — full detail, not a summary # there is no `template get`: `list` already returns systemPrompt, temperature, # languageModelSlug, actions and resources, so select the one you want cargo-ai ai template list | jq '.templates[] | select(.slug == "<slug>")' ``` ```bash # List all agents cargo-ai ai agent list # Get a single agent (includes deployed release details) cargo-ai ai agent get <agent-uuid> # Create an agent cargo-ai ai agent create \ --name "Lead Researcher" \ --icon-color blue --icon-face 🤖 \ --description "Researches leads and enriches data" # Update an agent cargo-ai ai agent update --uuid <agent-uuid> \ --name "Senior Lead Researcher" \ --description "Updated description" # Move to a folder (find folder UUIDs via cargo-workspace-management) cargo-ai ai agent update --uuid <agent-uuid> --folder-uuid <folder-uuid> # Remove an agent cargo-ai ai agent remove <agent-uuid> ``` **Agent icon:** `--icon-color` must be one of: `grey`, `green`, `purple`, `yellow`, `blue`, `red`. `--icon-face` is an emoji string. **Folders:** Folder creation, listing, and management lives in [`cargo-workspace-management`](../cargo-workspace-management/SKILL.md) (`cargo-ai workspaceManagement folder list/create/...`). Use that skill to discover or create the `<folder-uuid>` you pass to `--folder-uuid` here. ## Releases Releases are versioned snapshots of an agent's configuration (system prompt, actions, resources, model, temperature). Agents execute against their deployed release. ```bash # List releases for an agent cargo-ai ai release list --agent-uuid <uuid> # Get a specific release cargo-ai ai release get <release-uuid> # Get the current draft release (editable) cargo-ai ai release get-draft --agent-uuid <uuid> # Update the draft release cargo-ai ai release update-draft --agent-uuid <uuid> \ --system-prompt "You are a lead research assistant..." \ --language-model-slug gpt-4o \ --temperature 0.3 \ --max-steps 10 # Deploy the draft release (makes it live) cargo-ai ai release deploy-draft --agent-uuid <uuid> \ --integration-slug openai \ --language-model-slug gpt-4o \ --actions '[]' \ --mcp-clients '[]' \ --resources '[]' \ --capabilities '[]' \ --suggested-actions '[]' \ --description "Added research actions" ``` ### Structured output & heartbeat — not yet exposed as CLI flags The release API payload (both `draft/update` and `draft/deploy`) accepts two fields that **`release update-draft` / `release deploy-draft` do not surface as flags** (verified against the CLI source — there is no `--output` / `--output-schema` or `--heartbeat`): | Field | Shape | Purpose | |---|---|---| | `output` | `{"type":"text"}` **or** `{"type":"jsonSchema","jsonSchema": <standard JSON Schema object>}` | Force the agent to return structured output matching a JSON Schema. | | `heartbeat` | `{"intervalMinutes": number, "maxMessages": number, "prompt": string \| null}` | Periodically re-wake the chat (`intervalMinutes`) until it reaches `maxMessages`; `prompt` is the wake message (null = generic "continue"). | The generic `--options` flag does **not** carry these — the API's `options` only holds `{connectorUuidsByIntegrationSlug, modelUuidsByIntegrationSlug}`. Until the flags ship, set these with a direct API call against the same endpoints the CLI uses: ```bash # Structured (JSON Schema) output on the draft release curl -sS -X PUT "$CARGO_API_BASE/v1/ai/releases/draft/update" \ -H "Authorization: Bearer $CARGO_TOKEN" -H "Content-Type: application/json" \ -d '{"agentUuid":"<uuid>","output":{"type":"jsonSchema","jsonSchema":{"type":"object","properties":{"score":{"type":"number"}},"required":["score"]}}}' # Deploy carries the same fields — POST .../v1/ai/releases/draft/deploy ``` Send these payloads alongside the other fields you're updating (the endpoint replaces the draft config). **File a `workspaceManagement report`** (see [`../cargo-workspace-management/SKILL.md`](../cargo-workspace-management/SKILL.md)) to request first-class `--output` / `--heartbeat` flags — this is the documented feedback channel for CLI/UI parity gaps. **Agent configuration workflow:** 1. **Browse templates for inspiration**: `cargo-ai ai template list` — it returns each template in full (system prompt, model, temperature, actions), so pick the one closest to your use case straight out of that response 2. Create the agent: `cargo-ai ai agent create --name "..." --icon-color blue --icon-face 🤖` 3. Get the draft release: `cargo-ai ai release get-draft --agent-uuid <uuid>` 4. Update the draft with configured actions, resources, prompt, model: `cargo-ai ai release update-draft --agent-uuid <uuid> ...` 5. Deploy: `cargo-ai ai release deploy-draft --agent-uuid <uuid> ...` ## Templates Templates are pre-built agent configurations that capture proven patterns for common use cases. **Always check templates before designing an agent from scratch** — they give you a ready-made system prompt, recommended language model, temperature, and tool configuration that you can adopt as-is or adapt. ```bash # List available agent templates — each entry is complete, so this is the only # call you need. There is no `template get` subcommand. cargo-ai ai template list # Inspect one by slug: filter the same response cargo-ai ai template list | jq '.templates[] | select(.slug == "<slug>")' ``` Templates include a system prompt, actions, resources, and recommended model settings. Use them as a starting point and customize via `release update-draft`. See `references/examples/templates.md` for the full guide including an end-to-end example of creating an agent from a template. ## Model and temperature guidance | Use case | Recommended model | Temperature | |---|---|---| | Classification, extraction, scoring | `gpt-4o-mini` or `claude-3-5-haiku` | `0.0` – `0.2` | | Research, summarization, analysis | `gpt-4o` or `claude-3-5-sonnet` | `0.2` – `0.5` | | Copywriting, personalization | `gpt-4o` or `claude-3-5-sonnet` | `0.5` – `0.8` | | Brainstorming, creative ideation | `gpt-4o` or `claude-opus` | `0.7` – `1.0` | Low temperature (`0.0`–`0.2`) = deterministic, consistent outputs. High temperature (`0.7`+) = creative, varied outputs. For production workflows processing thousands of records, prefer low temperature. ## Knowledge for RAG (files & libraries) Knowledge that grounds agent responses (retrieval-augmented generation, RAG) comes from the **`content`** domain — see [`cargo-content`](../cargo-content/SKILL.md): - **Files** — uploaded binaries (PDFs, CSVs, text). - **Libraries** — collections that group files, either `native` (workspace-managed) or `connector`-backed (synced from an external source via an unstructured-data extractor). > Files and libraries moved out of `ai` into the top-level **`content`** domain in CLI ≥ 1.0.19 (`cargo-ai content file …` / `cargo-ai content library …`). The old `ai file …` commands are gone. Everything content-related now lives in [`cargo-content`](../cargo-content/SKILL.md). ### Attaching knowledge to an agent A file or library is inert until attached to an agent via the draft release's `resources` array and deployed. Upload files / build libraries in [`cargo-content`](../cargo-content/SKILL.md), then wire them in here with `release update-draft --resources …` followed by `release deploy-draft`. See [`../cargo-content/references/examples/files.md`](../cargo-content/references/examples/files.md) for the full upload → attach → deploy sequence. ## MCP — two directions, don't mix them up MCP (Model Context Protocol) runs both ways in Cargo, and the two surfaces are unrelated: | | **Publish** — `ai mcp-server` | **Consume** — `ai mcp-client` | |---|---|---| | What it is | A server **your workspace exposes**: the tools, agents, and data you choose to make callable | A connection **to someone else's** MCP server | | Who calls it | Any MCP client — Claude Code, Claude Desktop, Cursor, ChatGPT | Your Cargo agents, during a chat or a workflow run | | Wired via | `cargo-ai mcp --server <uuid>` (stdio bridge, below) | `release update-draft --mcp-clients …` | **Before building one, check whether the platform MCP already covers it.** Cargo now serves a first-party MCP at `https://mcp.getcargo.io/mcp` — every workspace member, nothing to deploy — with a small fixed toolset for operating the workspace (`whoami`, `get_usage`, `search_actions`, `get_action_schema`, `autocomplete_action`, `execute_action`, `execute_action_batch`, `get_run`, `get_batch`, `list_runs`, `list_models`, `describe_model`, `query_models`). Hosted clients (ChatGPT connectors, Claude.ai, Cursor over HTTP) point at that URL and sign in with OAuth; the consent screen picks the workspace when the user belongs to several. `ai mcp-server` is for the other job: a **curated, named** subset — this tool, that agent, this filtered model — for a client that should see exactly that and nothing else. ### Publishing a workspace MCP server ```bash cargo-ai ai mcp-server list cargo-ai ai mcp-server create --name "CRM tools" \ --actions '[{"slug":"<tool-uuid>","kind":"tool","name":null,"description":null,"isBulkAllowed":false,"config":{}}]' \ --resources '[{"kind":"model","slug":"<slug>","name":"Accounts","description":null,"integrationSlug":"hubspot","modelUuid":null,"filter":null,"selectedColumnSlugs":null,"limit":null,"prompt":null,"isReadOnly":true}]' cargo-ai ai mcp-server update --uuid <mcp-server-uuid> --name "Updated name" cargo-ai ai mcp-server remove <mcp-server-uuid> ``` - **Actions** take `kind: "tool"` **or** `kind: "agent"` — an agent can be exposed as a callable MCP tool, not just a tool. `waitUntilFinished` controls whether the call blocks on the run. - **Resources** take `kind: "model"` (a filtered, column-selected view of a model — keep `isReadOnly: true` unless the client is meant to write) or `kind: "file"` (workspace files by UUID, see [`../cargo-content/SKILL.md`](../cargo-content/SKILL.md)). - **Capabilities** (`--capabilities`, CLI ≥ 1.0.86) expose Cargo's own built-in tools on the server, alongside your actions and resources. JSON array of `{slug, config}`: ```bash cargo-ai ai mcp-server create --name "Research" \ --capabilities '[{"slug":"webSearch","config":{}}]' ``` The nine slugs are `sandbox`, `memory`, `context`, `app`, `document`, `webSearch`, `model`, `file`, and `documentationSearch` — the same set an **agent** release takes in its own `--capabilities`, which is why the examples above pass `'[]'` rather than omitting it. In a CDK project the same field accepts a bare slug (`capabilities: ["webSearch"]`). - `update` replaces `--actions` / `--resources` / `--capabilities` wholesale rather than merging — read the current server with `mcp-server list` and pass the full array back. ### Serving it to a coding agent — `cargo-ai mcp` Either server reaches any stdio MCP client through the CLI, using the credentials already on the machine. **No token is copied into client config.** ```bash claude mcp add cargo -- cargo-ai mcp # the platform MCP (no setup) cargo-ai ai mcp-server list # find a curated server's UUID claude mcp add cargo -- cargo-ai mcp --server <uuid> # that curated server instead # Cursor, Windsurf, and other stdio clients: same command as the server entry ``` With no `--server`, the bridge uses `CARGO_MCP_SERVER_UUID` when set, otherwise the platform `/mcp`. **This changed:** older CLIs resolved "the workspace's only MCP server" and failed with `InvalidUsage` when the workspace had none or several — a bare `cargo-ai mcp` now always has something to serve. stdout carries the MCP protocol and all logs go to stderr, so never print anything to stdout around it. **When to reach for this instead of the skills:** the skills give an agent the whole CLI; an MCP surface gives it a bounded set with no shell. Use the bridge for in-conversation lookups and one-off actions, and the CLI for batches, workflows, schema changes, and anything with a cost gate. Full routing rule: [`../cargo/SKILL.md`](../cargo/SKILL.md) → "These skills vs Cargo's MCP surfaces". ### Consuming an external MCP server ```bash cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse cargo-ai ai mcp-client connect --name "My MCP" --url https://mcp.example.com/sse \ --disabled-tool-slugs "dangerous_tool,other_tool" ``` `--authentication` takes `{"issuedAt": "...", "accessToken": "..."}` or `"null"`. Connected clients are attached to an agent through its release: `release update-draft --mcp-clients …`, then `release deploy-draft`. ## Memories Memories are pieces of information an agent stores from conversations for future reference. They can be scoped to a workspace, user, or specific agent. ```bash # List agent memories cargo-ai ai memory list --scope agent --agent-uuid <uuid> # List workspace-wide memories cargo-ai ai memory list --scope workspace # List user-scoped memories cargo-ai ai memory list --scope user # Update a memory cargo-ai ai memory update \ --mem0-id <id> \ --scope agent --agent-uuid <uuid> \ --content "Updated memory content" # Remove a memory cargo-ai ai memory remove \ --mem0-id <id> \ --scope agent --agent-uuid <uuid> ``` ## Help Every command supports `--help`: ```bash cargo-ai ai agent create --help cargo-ai ai release update-draft --help cargo-ai ai mcp-server create --help cargo-ai ai memory list --help ```
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.