Agent Plugins
Command Code supports Agent Plugins, an open standard for packaging Agent Skills and MCP servers into one portable directory. A plugin written once works in every compatible agent.
An Agent Plugin is a directory with a plugin.json manifest and optional components in fixed locations:
The manifest must sit at the plugin root. A Claude Code plugin keeps it in .claude-plugin/plugin.json instead, so cmd plugins add says so rather than installing it.
A minimal plugin.json:
An mcp.json with a bundled stdio server and a remote server:
Install a plugin and check what it loaded
Installed plugins live in ~/.commandcode/plugins/<name>/ (plugins in ~/.agents/plugins/ load too) and are picked up by every new session.
To try a plugin for a single session without installing it:
--plugin-dir is repeatable and also accepts a directory that holds several plugins.
| Command | What it does |
|---|---|
cmd plugins add <path> | Install the plugin at <path> into ~/.commandcode/plugins/<name>/. Re-running it updates the plugin, including a copy you placed in ~/.commandcode/plugins by hand under another directory name. It never replaces anything else: a folder or file already at ~/.commandcode/plugins/<name> that is not that plugin is left alone and the install is refused. It warns about symbolic links that no longer resolve in the installed copy (a relative link out of the plugin, like bin -> ../shared/bin), and about a plugin whose name changed since you last installed it from the same directory (the old one stays installed until you remove it; this works for plugins installed with this version or later). |
cmd plugins list | List plugins with their skills, MCP servers (with the server name cmd mcp auth takes and the tool prefix), and every problem found while loading them. Accepts --plugin-dir and --no-plugins to show what a session with those flags would load (with --no-plugins it says how many installed plugins are skipped). Add --json for machine-readable output. A plugin skill that loses to another skill of the same name is listed as shadowed, not as one of its skills, and a second copy of an already loaded plugin is listed under Shadowed, not as rejected. Exits 1 when any plugin is rejected, so a CI step can gate on it. |
cmd plugins remove <name> | Uninstall a plugin from ~/.commandcode/plugins by its manifest name (or by its directory name when its plugin.json no longer parses). A directory without a plugin.json is never deleted. Its data directory is kept. One add or remove runs at a time: a second one waits for the first to finish (up to a minute), and when a command was killed mid-way (say kill -9 during a copy), the next add, remove or list deletes the lock and partial copies it left and prints one line saying so. |
cmd --plugin-dir <path> | Load a plugin (or a directory of plugins) for this session only. |
cmd --no-plugins | Skip installed plugins (skills and MCP servers) for this session. --plugin-dir plugins still load. Both flags apply to every command that starts a session, including cmd acp. |
cmd --safe-mode | Load no plugins at all for this session: no installed plugins and no --plugin-dir plugins, so no plugin MCP server starts and no plugin skill loads (safe mode also skips installed mods). Use it when a broken plugin keeps a session from working. |
cmd plugins list --json prints one object: plugins (each with name, version, description, root, dataDir, source (user or flag), skills, shadowedSkills, servers (each with id, name, toolPrefix, maxToolNameLength, transport) and warnings), rejected (each with path and reason), shadowed (each with path, name, and by, the root of the copy that loaded), and, under --no-plugins, disabledInstalled (the installed plugin directories skipped). Paths in it are absolute.
Plugin MCP servers also appear in cmd mcp list, and cmd mcp auth <name> authorizes a plugin's Streamable HTTP server like any other (legacy sse and stdio plugin servers have no OAuth sign-in). cmd mcp get and cmd mcp remove point you to the owning plugin instead. cmd mcp list, get, remove and auth honor --plugin-dir and --no-plugins, so cmd --plugin-dir ./my-plugin mcp auth <name> reaches a plugin you only load for a session.
Skills. Each immediate child of skills/ that contains a file named exactly SKILL.md is one skill. Plugin skills join your skill catalog and / menu like any other skill, and /skills lists them under Plugin skills with the plugin's name (/status counts them separately). Project, user, --skill and built-in skills with the same name take precedence, and the shadowed plugin skill is reported.
MCP servers. Each server is registered as <plugin>_<server> (dots in the plugin name become _), so its tools appear as mcp__<plugin>_<server>__<tool>. Long names are shortened to <plugin>_-<server>-<hash> so tool names stay within the 64-character limit, and server keys that aren't plain words (letters, digits, -) are replaced by a hash. cmd plugins list prints each server's exact name and tool prefix; use the prefix in permission rules. A plugin server whose prefix would clash with one of your own servers or another plugin's is skipped and reported. Stdio servers start in the plugin root unless cwd says otherwise.
Plugin variables. Stdio servers receive PLUGIN_ROOT (the plugin directory) and PLUGIN_DATA (a persistent, writable directory at ~/.commandcode/plugin-data/<name>/ that survives plugin updates). ${PLUGIN_ROOT} and ${PLUGIN_DATA} expand in args, env values, and cwd. Nothing else expands: ${OTHER} text (${HOME}, ${TOKEN}) is passed through unchanged, and command, url and headers are always literal (${PLUGIN_ROOT} included). Because that is rarely what an author meant, each such variable is reported as an advisory.
Remote servers. streamable-http and legacy sse transports are both supported. Plain http:// is only allowed for localhost and loopback addresses. Configured headers are never sent to a different origin through a redirect or an SSE endpoint event.
Safety. Installing a plugin is trusting it. Every plugin in ~/.commandcode/plugins, in ~/.agents/plugins (a directory other agents also install into), or passed with --plugin-dir has its stdio MCP servers started when a session starts, without a prompt. They run as you, with your environment (including any API keys it holds), and remote plugin servers are contacted at the same time. Use --no-plugins to start a session without installed plugins, and cmd plugins list (or /plugins inside a session) to see what would load. When the agent asks to call a plugin's MCP tool, the permission prompt names the plugin and shows the call's arguments.
Every path a plugin supplies (a ./ command, skills, mcp.json) must stay inside the plugin directory after symlinks are resolved, and a cwd must stay inside the plugin directory or its PLUGIN_DATA directory. A bare command such as node or npx is looked up on your PATH like any program. Command Code does not auto-load plugins from a project folder, so opening a repository never starts plugin MCP servers on its own.
Failures stay contained. A broken mcp.json disables only that plugin's MCP servers, an invalid server entry skips only that server, and a malformed skill skips only that skill. A plugin.json that is invalid rejects the whole plugin. Files Agent Plugins do not read are reported rather than ignored: a .mcp.json (the name is mcp.json, no leading dot) and a skill nested below a grouping directory (skills/group/inner/SKILL.md; only skills/<name>/SKILL.md is read).
Problems are reported. When any plugin has a problem (a rejected plugin, a skipped skill or server, a server that failed to connect), a session starts with one line saying how many plugins have problems (on stderr with cmd -p, never in the --output-format json result). The details are in /plugins inside a session and in cmd plugins list, each problem once. /plugins also shows each plugin server's live state in the session: connected, failed (with the error), connecting, or not in this session (installed after it started; /reload loads it). cmd plugins list shows what loading finds without starting anything, so connection failures only show up in /plugins. The agent gets every problem, grouped by what happened, so it can explain a missing tool.
The messages use a few terms:
- not loaded (never started): the server or skill was left out while reading the plugin's files, usually because its configuration is invalid. Nothing was started or contacted for it, so it is not a startup failure. Fix the configuration it names.
- failed to start or connect: the server was started (stdio) or contacted (remote) and did not come up. The message carries the error.
- advisory: something about the server looks wrong (for example its
./command is missing or not executable, an argument goes through a symbolic link that no longer resolves, or a${VAR}is passed literally). The server is still started, and may not work as its author intended. Advisories are listed in/pluginsandcmd plugins listbut do not count toward the startup line; a server that then fails to start does.
Windows. Stdio plugin servers start through cmd.exe (so npx and other .cmd shims work), with the command and each argument quoted as one token. An argument containing ", %, ! or a line break can't be passed safely that way, so that server is skipped and reported. Plugin support on Windows has not been verified end to end yet.
Command Code implements the Agent Plugins conformance suite checks for specification 1.0.0, covering skills, stdio MCP, Streamable HTTP, legacy HTTP+SSE, and filesystem containment. To run it yourself, install the suite's four plugins with cmd plugins add, start its HTTP fixture, and ask Command Code to run the run-conformance skill. A few checks are about servers that must fail to connect (a refused cross-origin redirect, for example). Command Code tells the agent why those servers are missing, so the agent can report them; the suite scores them from that report.