Plugins

What a plugin adds to kcode, where plugins load from, how to add an MCP server, and how to check or remove what is loaded.

A plugin is a folder that adds to kcode: tools for the agent, slash commands, skills, agent kinds, or handlers that run inside the agent loop.

Three kinds

Kind What it is What it adds
Lua A folder with plugin.toml and main.lua. The Lua runtime ships inside kcode. Tools, commands, and handlers that watch, change or refuse steps of the agent loop.
MCP A Model Context Protocol server, declared in a JSON file. The server’s tools.
Content A folder of Markdown with no code. Commands, skills, agent kinds and output styles.

kcode’s own built-in commands and agent kinds load as a content plugin named kcode-essentials.

Where plugins load from

Place Reach
~/.kcode/plugins/<name>/ Every project.
<project>/.kcode/plugins/<name>/ One project, once the project is trusted.
A linked folder Any folder on the Mac, added by its path.

There is no public marketplace. A plugin arrives as a folder, written by hand or cloned from a repository.

Adding a plugin

Settings › Plugins links a plugin folder. The same from a terminal:

kcode plugins install ~/code/my-plugin

The folder stays where it is, and a running kcode loads the plugin into its sessions at once. kcode reviews the capabilities the plugin declares. A plugin with a capability the review flags is shown first and links only with --approve.

MCP servers

kcode reads <project>/.mcp.json, in the format Claude Code uses, and ~/.kcode/mcp.json for servers in every project:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "<your token>" }
    }
  }
}

A remote server is added from a terminal:

kcode mcp add docs https://example.com/mcp
kcode mcp list

Each server connects when a session starts, and its tools appear to the agent as <server>__<tool>. /mcp lists the connected servers, then the ones that are not connected and why.

What is loaded

Command Shows
/plugins Each loaded plugin with its kind, its source, its capabilities and what it adds. A plugin that failed to load is listed with the reason.
/tools Every tool the agent has, grouped by the plugin or server it came from.
kcode plugins list The same list from a terminal, with no session open.

Capabilities

A Lua plugin runs in a sandbox. It reaches files, the network, storage or the agent loop only through the capabilities its plugin.toml declares in [capabilities]. /plugins shows them for each plugin, with the files and hosts each one covers.

Removing a plugin

kcode plugins remove my-plugin

Removing a linked plugin drops the link and keeps the folder. Settings › Plugins does the same and also holds an off switch for each plugin.

A policy for a project

<project>/.kcode/policy.toml is committed with the repository:

[plugins]
blocklist = ["some-plugin"]
required = ["github"]

A plugin on the blocklist never loads in the project. A plugin or MCP server under required that is not loaded is reported in /plugins and in a notification at startup.

Writing a plugin

kcode plugins scaffold <name> writes a working Lua plugin: a manifest, a tool, an event handler, a command and a skill. Build a first plugin walks through one from an empty folder.

A Lua plugin attaches to the agent loop three ways.

Call Effect
kcode.on Watches a point of the loop, such as the end of a turn or a tool call.
kcode.intercept Changes or refuses a step before it happens: the input, the prompt, the request to the model, a tool call, a tool result.
kcode.provide Answers a question kcode asks: the model a turn runs on, whether the turn goes on, the compaction summary.

A plugin also replaces a built-in tool: shadows = ["<tool>"] in its plugin.toml puts the plugin’s tool in its place, and removing the plugin restores the original.

The Extend guides explain each of these, the worked examples give complete plugins, and the plugin reference and the Lua reference list every call.

Product video