From 6fc1e6b44ee7c05044d49478b7b3278cfa943b85 Mon Sep 17 00:00:00 2001 From: Josh Lambert Date: Wed, 25 Feb 2026 20:50:58 -0500 Subject: [PATCH 1/6] Fix CLI MCP docs --- .../pages/automate/mcp/using-in-cli.md | 235 +++++++++++------- 1 file changed, 152 insertions(+), 83 deletions(-) diff --git a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md index 17c8f0d567f..a6c3f0e28d5 100644 --- a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md +++ b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md @@ -1,109 +1,178 @@ --- title: "Using MCP in CLI" -description: "How to use MCP servers in the CLI" +description: "How to configure and use MCP servers in the Kilo CLI" --- # Using MCP in the CLI -The Kilo Code CLI supports MCP servers, but uses a **different configuration path** than the VS Code extension. +The Kilo CLI supports both local and remote MCP servers. Once added, MCP tools are automatically available to the LLM alongside built-in tools. + +:::tip +MCP servers add to your context, so be careful with which ones you enable. Certain MCP servers with many tools can quickly add up and exceed the context limit. +::: ## Configuration Location -| Environment | MCP Settings Path | -| ----------- | --------------------------------------------------- | -| **CLI** | `~/.kilocode/cli/global/settings/mcp_settings.json` | -| **VS Code** | VS Code's global storage directory | +| Scope | Config Path | +| ----------- | ------------------------------------- | +| **Global** | `~/.config/kilo/config.json` | +| **Project** | `./.kilocode/config.json` | + +Project-level configuration takes precedence over global settings. MCP servers configured in VS Code are **not** automatically available in the CLI. You must configure them separately. ## Configuration Format -Edit `~/.kilocode/cli/global/settings/mcp_settings.json`: +Add MCP servers under the `mcp` key in your config file. Each server has a unique name that you can reference in prompts. ```json { - "mcpServers": { - "server-name": { - "command": "node", - "args": ["/path/to/server.js"], - "env": { - "API_KEY": "your_api_key" - }, - "alwaysAllow": ["tool1", "tool2"], - "disabled": false - } - } -} -``` - -## Transport Types - -### STDIO (Local Servers) - -```json -{ - "mcpServers": { - "local-server": { - "command": "node", - "args": ["/path/to/server.js"], - "env": {} - } - } -} -``` - -### Streamable HTTP (Remote Servers) - -```json -{ - "mcpServers": { - "remote-server": { - "type": "streamable-http", - "url": "https://your-server.com/mcp", - "headers": { - "Authorization": "Bearer token" - } - } - } -} -``` - -## Project-Level Configuration - -You can define MCP servers per-project by creating `.kilocode/mcp.json` in your project root. Project-level servers take precedence over global settings. - -## Configuration Options - -| Option | Description | -| ------------- | ----------------------------------------------------------- | -| `command` | Executable to run (STDIO) | -| `args` | Command arguments (STDIO) | -| `env` | Environment variables | -| `type` | Transport type: `stdio` (default), `streamable-http`, `sse` | -| `url` | Server URL (HTTP transports) | -| `headers` | HTTP headers (HTTP transports) | -| `alwaysAllow` | Array of tool names to auto-approve | -| `disabled` | Set `true` to disable without removing | -| `timeout` | Request timeout in seconds (default: 60) | - -## Auto-Approval - -MCP auto-approval is controlled via CLI config (`kilocode config`): - -```json -{ - "autoApproval": { - "mcp": { + "mcp": { + "my-server": { + "type": "local", + "command": ["npx", "-y", "my-mcp-command"], "enabled": true } } } ``` -Or via environment variable: +You can disable a server by setting `enabled` to `false` without removing it from your config. -```bash -export KILO_AUTO_APPROVAL_MCP_ENABLED=true +## Transport Types + +### Local Servers + +Local MCP servers run on your machine and communicate via standard input/output. Set `type` to `"local"`. + +```json +{ + "mcp": { + "my-local-server": { + "type": "local", + "command": ["npx", "-y", "my-mcp-command"], + "enabled": true, + "environment": { + "API_KEY": "your_api_key" + } + } + } +} ``` -Per-tool auto-approval uses the `alwaysAllow` array in the server configuration. +#### Local Server Options + +| Option | Type | Required | Description | +| ------------- | ------- | -------- | -------------------------------------------------------------------- | +| `type` | String | Yes | Must be `"local"`. | +| `command` | Array | Yes | Command and arguments to run the MCP server. | +| `environment` | Object | No | Environment variables to set when running the server. | +| `enabled` | Boolean | No | Enable or disable the MCP server on startup. | +| `timeout` | Number | No | Timeout in ms for fetching tools from the MCP server. Default: 5000. | + +### Remote Servers + +Remote MCP servers are accessed over HTTP/HTTPS. Set `type` to `"remote"`. + +```json +{ + "mcp": { + "my-remote-server": { + "type": "remote", + "url": "https://my-mcp-server.com/mcp", + "enabled": true, + "headers": { + "Authorization": "Bearer MY_API_KEY" + } + } + } +} +``` + +#### Remote Server Options + +| Option | Type | Required | Description | +| --------- | ------- | -------- | -------------------------------------------------------------------- | +| `type` | String | Yes | Must be `"remote"`. | +| `url` | String | Yes | URL of the remote MCP server. | +| `enabled` | Boolean | No | Enable or disable the MCP server on startup. | +| `headers` | Object | No | HTTP headers to send with requests. | +| `timeout` | Number | No | Timeout in ms for fetching tools from the MCP server. Default: 5000. | + +## Managing MCP Servers + +You can manage MCP servers from the CLI: + +| Command | Description | +| -------------------- | ------------------------------------ | +| `kilo mcp list` | List all configured MCP servers | +| `kilo mcp add` | Add an MCP server | +| `kilo mcp auth` | Authenticate with an MCP server | + +Inside the interactive TUI, use the `/mcps` slash command to toggle MCP servers on or off. + +## Examples + +### Figma Desktop + +Connect to the Figma Desktop app's local MCP server: + +```json +{ + "mcp": { + "Figma Desktop": { + "type": "remote", + "url": "http://127.0.0.1:3845/mcp" + } + } +} +``` + +### Context7 + +Add the [Context7](https://github.com/upstash/context7) MCP server for documentation search: + +```json +{ + "mcp": { + "context7": { + "type": "remote", + "url": "https://mcp.context7.com/mcp" + } + } +} +``` + +### Everything Test Server + +Add the test MCP server for development: + +```json +{ + "mcp": { + "mcp_everything": { + "type": "local", + "command": ["npx", "-y", "@modelcontextprotocol/server-everything"] + } + } +} +``` + +## Environment Variables + +Use `{env:VARIABLE_NAME}` syntax in config files to reference environment variables: + +```json +{ + "mcp": { + "my-server": { + "type": "remote", + "url": "https://mcp.example.com/mcp", + "headers": { + "Authorization": "Bearer {env:MY_API_KEY}" + } + } + } +} +``` From ff1da1bf17ebfb257ed3381524df44b99ef631bc Mon Sep 17 00:00:00 2001 From: Josh Lambert Date: Wed, 25 Feb 2026 21:24:05 -0500 Subject: [PATCH 2/6] Fix paths --- .../kilo-docs/pages/automate/mcp/using-in-cli.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md index a6c3f0e28d5..0284fb86f73 100644 --- a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md +++ b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md @@ -13,12 +13,14 @@ MCP servers add to your context, so be careful with which ones you enable. Certa ## Configuration Location -| Scope | Config Path | -| ----------- | ------------------------------------- | -| **Global** | `~/.config/kilo/config.json` | -| **Project** | `./.kilocode/config.json` | +The CLI accepts several config filenames. The recommended file is `kilo.json`: -Project-level configuration takes precedence over global settings. +| Scope | Recommended Path | Also supported | +| ----------- | ------------------------------------- | ----------------------------------------------------- | +| **Global** | `~/.config/kilo/kilo.json` | `kilo.jsonc`, `config.json` | +| **Project** | `./kilo.json` or `./.kilo/kilo.json` | `kilo.jsonc` | + +Project-level configuration takes precedence over global settings. The CLI walks up from the project directory to the git worktree root, so config files in parent directories are also loaded. MCP servers configured in VS Code are **not** automatically available in the CLI. You must configure them separately. @@ -176,3 +178,7 @@ Use `{env:VARIABLE_NAME}` syntax in config files to reference environment variab } } ``` + +## Finding MCP Servers + +Browse community-contributed MCP server configurations and agent skills in the [Kilo Marketplace](https://github.com/Kilo-Org/kilo-marketplace). The marketplace includes ready-to-use configs for popular tools like Figma, Sentry, and more. From 251f0ac5d1bd4602e235a8cc812cabce3b8dcefd Mon Sep 17 00:00:00 2001 From: Joshua Lambert <25085430+lambertjosh@users.noreply.github.com> Date: Wed, 25 Feb 2026 22:15:51 -0500 Subject: [PATCH 3/6] Update packages/kilo-docs/pages/automate/mcp/using-in-cli.md --- packages/kilo-docs/pages/automate/mcp/using-in-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md index 0284fb86f73..52c75255ea3 100644 --- a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md +++ b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md @@ -118,7 +118,7 @@ Inside the interactive TUI, use the `/mcps` slash command to toggle MCP servers ### Figma Desktop -Connect to the Figma Desktop app's local MCP server: +Connect to the Figma Desktop app's MCP server: ```json { From f7bd5c7af13b0ba74bde261efc3a824037cae9c2 Mon Sep 17 00:00:00 2001 From: Joshua Lambert <25085430+lambertjosh@users.noreply.github.com> Date: Thu, 26 Feb 2026 09:26:16 -0500 Subject: [PATCH 4/6] Apply suggestion from @lambertjosh --- packages/kilo-docs/pages/automate/mcp/using-in-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md index 52c75255ea3..7daac1e1fca 100644 --- a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md +++ b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md @@ -20,7 +20,7 @@ The CLI accepts several config filenames. The recommended file is `kilo.json`: | **Global** | `~/.config/kilo/kilo.json` | `kilo.jsonc`, `config.json` | | **Project** | `./kilo.json` or `./.kilo/kilo.json` | `kilo.jsonc` | -Project-level configuration takes precedence over global settings. The CLI walks up from the project directory to the git worktree root, so config files in parent directories are also loaded. +Project-level configuration takes precedence over global settings. MCP servers configured in VS Code are **not** automatically available in the CLI. You must configure them separately. From 45e696086865af144dd47ab919233e54d90c3177 Mon Sep 17 00:00:00 2001 From: Josh Lambert Date: Thu, 26 Feb 2026 10:34:25 -0500 Subject: [PATCH 5/6] Swap to markdoc formatting --- .../pages/automate/mcp/using-in-cli.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md index 7daac1e1fca..f8c0be1a6ff 100644 --- a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md +++ b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md @@ -7,18 +7,18 @@ description: "How to configure and use MCP servers in the Kilo CLI" The Kilo CLI supports both local and remote MCP servers. Once added, MCP tools are automatically available to the LLM alongside built-in tools. -:::tip +{% callout type="tip" %} MCP servers add to your context, so be careful with which ones you enable. Certain MCP servers with many tools can quickly add up and exceed the context limit. -::: +{% /callout %} ## Configuration Location The CLI accepts several config filenames. The recommended file is `kilo.json`: -| Scope | Recommended Path | Also supported | -| ----------- | ------------------------------------- | ----------------------------------------------------- | -| **Global** | `~/.config/kilo/kilo.json` | `kilo.jsonc`, `config.json` | -| **Project** | `./kilo.json` or `./.kilo/kilo.json` | `kilo.jsonc` | +| Scope | Recommended Path | Also supported | +| ----------- | ------------------------------------ | --------------------------- | +| **Global** | `~/.config/kilo/kilo.json` | `kilo.jsonc`, `config.json` | +| **Project** | `./kilo.json` or `./.kilo/kilo.json` | `kilo.jsonc` | Project-level configuration takes precedence over global settings. @@ -106,11 +106,11 @@ Remote MCP servers are accessed over HTTP/HTTPS. Set `type` to `"remote"`. You can manage MCP servers from the CLI: -| Command | Description | -| -------------------- | ------------------------------------ | -| `kilo mcp list` | List all configured MCP servers | -| `kilo mcp add` | Add an MCP server | -| `kilo mcp auth` | Authenticate with an MCP server | +| Command | Description | +| --------------- | ------------------------------- | +| `kilo mcp list` | List all configured MCP servers | +| `kilo mcp add` | Add an MCP server | +| `kilo mcp auth` | Authenticate with an MCP server | Inside the interactive TUI, use the `/mcps` slash command to toggle MCP servers on or off. From 51f181a892481986809b13e287f83b2b650c6a86 Mon Sep 17 00:00:00 2001 From: Josh Lambert Date: Thu, 26 Feb 2026 10:36:36 -0500 Subject: [PATCH 6/6] Remove incorrect line about vscode --- packages/kilo-docs/pages/automate/mcp/using-in-cli.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md index f8c0be1a6ff..e2689999b89 100644 --- a/packages/kilo-docs/pages/automate/mcp/using-in-cli.md +++ b/packages/kilo-docs/pages/automate/mcp/using-in-cli.md @@ -22,8 +22,6 @@ The CLI accepts several config filenames. The recommended file is `kilo.json`: Project-level configuration takes precedence over global settings. -MCP servers configured in VS Code are **not** automatically available in the CLI. You must configure them separately. - ## Configuration Format Add MCP servers under the `mcp` key in your config file. Each server has a unique name that you can reference in prompts.