MCP Servers

cast supports Model Context Protocol servers — local (stdio) or remote (streamable HTTP). Their tools appear alongside the built-in ones, no special syntax needed to call them.

Configuration

MCP servers are configured in JSON files using the common mcpServers shape:

LocationScopeTrust
~/.cast/mcp.jsonGlobal (all projects)Always loaded
.cast/mcp.jsonProject-localTrust-gated

Local Server (stdio)

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "@my-org/mcp-server"],
      "env": {
        "API_KEY": "optional-env-var"
      }
    }
  }
}

Remote Server (streamable HTTP)

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "X-API-KEY": "your-api-key"
      }
    }
  }
}

Config Fields

stdio (local):

FieldDescription
commandExecutable to run
argsCommand arguments
envEnvironment variables (optional)
cwdWorking directory (optional)

Stdio servers inherit cast's full environment, with the config's env winning on conflicts — an API key exported in your shell reaches the server without duplicating it in the config. (The MCP SDK's default is a minimal whitelist; cast overrides it because a server that works when launched by hand should work identically under cast.)

remote (url):

FieldDescription
urlServer endpoint URL

Remote servers are connected over Streamable HTTP first; if the server rejects it (legacy servers answer the initialize POST with an HTTP error), cast retries once over the deprecated HTTP+SSE transport — so old /sse endpoints (e.g. Cloudflare's docs server) work with the same one-line config. Timeouts are not retried: a hung endpoint is hung on either transport. | headers | HTTP headers for auth (static header/token only) |

Each server needs either command (local) or url (remote), not both.

Tool Naming

MCP tools are namespaced as mcp_<server>_<tool>:

Non-alphanumeric characters in names are replaced with _.

Connection

Servers connect in parallel during startup. Each gets a 30-second timeout — enough for npx -y cold cache resolution (~12s) without leaving a hung server unnoticed.

Failed connections produce a diagnostic message but don't block other servers or prevent cast from starting.

CLI Flags

FlagDescription
--mcp <path>Load an extra MCP config file (repeatable)
--no-mcpSkip global/project MCP server discovery
cast --mcp ./custom-mcp.json
cast --no-mcp --mcp ~/.cast/mcp.json

Extra paths (--mcp) work even with --no-mcp.

Commands

CommandDescription
/mcpToggle MCP servers on/off (multi-select picker)
/mcp listRead-only list (origin + tools/status)
/mcp enable / disable <name>Toggle one server without the picker
/mcp uninstallRemove a server from global/project mcp.json (picker + confirm, or typed name)
/mcp helpCheat sheet
/reloadReconnect MCP servers (re-reads config files)

/mcp uninstall edits the owning config file (project wins over global for the same name). CLI --mcp paths are not removable here.

Hot-reload

/mcp toggle / enable / disable / uninstall reconnect servers in the current session — no /reload, no restart.

Use /reload after editing ~/.cast/mcp.json or .cast/mcp.json by hand (or adding a new server entry outside /mcp). See Interactive commands.

Toggling Servers

/mcp opens an interactive multi-select picker showing all configured servers (global + project). Use up/down to navigate, Space to toggle a server on/off, and Enter to confirm.

Disabled servers:

The picker shows all servers from all config sources, regardless of connection status:

Limitations