CLI Reference: MCP
Commands for registering and managing MCP (Model Context Protocol) server definitions and attachments.
See MCP Overview for background on how MCP integration works.
ash mcp add
Register an MCP server definition in agentd.
ash mcp add <name> <transport> \
[--command <path>] \
[--args <csv>] \
[--url <url>] \
[--description <text>]
| Argument/Flag | Required | Description |
|---|---|---|
name | Yes | Unique server name; tools namespaced as mcp.<name>.<tool> |
transport | Yes | stdio or http |
--command | Stdio only | Absolute path to the executable |
--args | No | Comma-separated arguments passed to the command |
--url | HTTP only | Base URL; agentd POSTs to <url>/message |
--description | No | Human-readable description |
Examples:
# Stdio server
ash mcp add github stdio \
--command /usr/local/bin/github-mcp \
--args "--read-only,--timeout,30" \
--description "GitHub read-only tools"
# HTTP server
ash mcp add analytics http \
--url https://mcp.analytics.internal/api \
--description "Analytics query server"
ash mcp list / ash mcp ls
List all registered MCP server definitions.
ash mcp list
Output: name, transport, command/URL, description. Secret values in env_template are never shown; only key names are listed.
ash mcp remove
Remove a registered MCP server definition.
ash mcp remove <name>
Does not affect currently attached sessions. Detach from running agents first if desired.
ash mcp attach
Dynamically attach an MCP server to a running agent.
ash mcp attach <agent-id> <mcp-name> [--operator <token>]
| Argument/Flag | Description |
|---|---|
agent-id | UUID of the target agent |
mcp-name | Name of a registered MCP server |
--operator | Operator token; bypasses agent capability check |
On success, prints the list of tools added under mcp.<name>.*.
ash mcp detach
Detach an MCP server from a running agent.
ash mcp detach <agent-id> <mcp-name>
Closes the MCP session and unregisters all mcp.<name>.* tools from the agent's tool registry.