Using MCP in the 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

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

The CLI accepts several config filenames. The recommended file is kilo.json:

ScopeRecommended PathAlso supported
Global~/.config/kilo/kilo.jsonkilo.jsonc, config.json
Project./kilo.json or ./.kilo/kilo.jsonkilo.jsonc

Project-level configuration takes precedence over global settings.

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.

{
  "mcp": {
    "my-server": {
      "type": "local",
      "command": ["npx", "-y", "my-mcp-command"],
      "enabled": true
    }
  }
}

You can disable a server by setting enabled to false without removing it from your config.

Transport Types

Local Servers

Local MCP servers run on your machine and communicate via standard input/output. Set type to "local".

{
  "mcp": {
    "my-local-server": {
      "type": "local",
      "command": ["npx", "-y", "my-mcp-command"],
      "enabled": true,
      "environment": {
        "API_KEY": "your_api_key"
      }
    }
  }
}

Local Server Options

OptionTypeRequiredDescription
typeStringYesMust be "local".
commandArrayYesCommand and arguments to run the MCP server.
environmentObjectNoEnvironment variables to set when running the server.
enabledBooleanNoEnable or disable the MCP server on startup.
timeoutNumberNoTimeout 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".

{
  "mcp": {
    "my-remote-server": {
      "type": "remote",
      "url": "https://my-mcp-server.com/mcp",
      "enabled": true,
      "headers": {
        "Authorization": "Bearer MY_API_KEY"
      }
    }
  }
}

Remote Server Options

OptionTypeRequiredDescription
typeStringYesMust be "remote".
urlStringYesURL of the remote MCP server.
enabledBooleanNoEnable or disable the MCP server on startup.
headersObjectNoHTTP headers to send with requests.
timeoutNumberNoTimeout in ms for fetching tools from the MCP server. Default: 5000.

Managing MCP Servers

You can manage MCP servers from the CLI:

CommandDescription
kilo mcp listList all configured MCP servers
kilo mcp addAdd an MCP server
kilo mcp authAuthenticate 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 MCP server:

{
  "mcp": {
    "Figma Desktop": {
      "type": "remote",
      "url": "http://127.0.0.1:3845/mcp"
    }
  }
}

Context7

Add the Context7 MCP server for documentation search:

{
  "mcp": {
    "context7": {
      "type": "remote",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

Everything Test Server

Add the test MCP server for development:

{
  "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:

{
  "mcp": {
    "my-server": {
      "type": "remote",
      "url": "https://mcp.example.com/mcp",
      "headers": {
        "Authorization": "Bearer {env:MY_API_KEY}"
      }
    }
  }
}

Finding MCP Servers

Browse community-contributed MCP server configurations and agent skills in the Kilo Marketplace. The marketplace includes ready-to-use configs for popular tools like Figma, Sentry, and more.