Skip to main content
Reference

MCP Reference

MCP server transports, configuration fields, scopes, and permissions

MCP (Model Context Protocol) lets Qoder CLI CN connect third-party tools and services. This page is the complete reference for MCP server configuration.

Transports

An MCP server's transport protocol is specified with the type field:
TypeDescription
stdio (default)Start a child process and interact over stdin/stdout.
sseConnect over Server-Sent Events HTTP.
http / streamable-httpConnect over HTTP (JSON-RPC + optional streaming).
wsConnect over WebSocket / TCP.
sdkA built-in SDK-level server (in-process).

Configuration fields

MCP servers are configured under the mcpServers field of settings.json, with each key being a server name:
{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["./mcp-server.js"],
      "env": { "API_KEY": "..." },
      "cwd": "/path/to/dir"
    }
  }
}

stdio type

FieldTypeDescription
commandstringThe command that starts the server.
argsstring[]Arguments passed to the command.
envobjectEnvironment variables passed to the child process.
cwdstringThe child process's working directory.

sse type

FieldTypeDescription
urlstringThe SSE endpoint URL.
type"sse"The transport type identifier.
headersobjectHTTP request headers (may include authentication).

http / streamable-http type

FieldTypeDescription
urlstringThe HTTP endpoint URL.
type"http"The transport type identifier.
headersobjectHTTP request headers.

ws type (TCP)

FieldTypeDescription
tcpobjectTCP connection parameters (host/port).
type"ws"The transport type identifier.

Common optional fields

FieldTypeDescription
timeoutnumberConnection/request timeout (milliseconds).
typestringExplicit transport type.
descriptionstringServer description, shown in the management view.
trustbooleanTrust this server, skipping confirmation when its tools are called.
includeToolsstring[]Register only the listed tools.
excludeToolsstring[]Exclude the listed tools.
disabledbooleanDisable the server (keeps the configuration without deleting it).
alwaysAllowstring[]Tool names always allowed without confirmation.
oauthobjectOAuth authorization configuration (fields include enabled, clientId, clientSecret, authorizationUrl, tokenUrl, scopes, callbackPort, etc.).

Configuration scopes

MCP servers can be configured at multiple levels:
LevelLocationDescription
User~/.qoder-cn/settings.jsonmcpServersAvailable to all projects.
Project<project>/.qoder/settings.jsonmcpServersUsable after approval (for security).
Project<project>/.mcp.jsonRequires a top-level mcpServers key; usable after approval.
Local<project>/.qoder/settings.local.jsonmcpServersThis machine and project only; the default scope for -s, loaded only when the directory is trusted.
Plugin.mcp.json or mcp.json in the plugin directoryLoaded when the plugin is installed.
CLI flags--mcp-config <path>, --settingsEffective for the current session only.
Servers with the same name override in this order (later overrides earlier): user → project settings.json → project .mcp.json → local → CLI flags. Project-level MCP servers require per-server approval by default. This can be skipped via:
  • mcp.enableAllProjectMcpServers: true: auto-approve all project-level servers.
  • mcp.enabledProjectMcpServers: an allowlist approving servers by name.
Both live under the mcp group in settings.json (restart required after changes):
{
  "mcp": {
    "enableAllProjectMcpServers": true,
    "enabledProjectMcpServers": ["playwright", "context7"]
  }
}

Permissions and security

  • MCP tools are governed by the permission system just like built-in tools — user confirmation is required before calls (unless using the auto or bypass_permissions mode).
  • --allowed-mcp-server-names: restrict loading to MCP servers with the given names only.
  • --strict-mcp-config: strict mode, loading only the servers from the file specified by --mcp-config.
  • mcp.allowed / mcp.excluded: control the allowed or excluded server lists in configuration.

Lazy loading

With multiple MCP servers connected, all tool schemas are registered at startup by default, which can consume a lot of first-turn prompt tokens. With lazy loading enabled (mcp.lazyLoad: true or QODER_MCP_LAZY=1), the CLI exposes only three meta tools (mcp_list / mcp_get / mcp_call) and loads actual tools on demand, saving token overhead.

Management commands

Use the /mcp slash command in interactive sessions to manage MCP servers:
  • /mcp — view the list and status of connected servers.
  • /mcp reload (alias /mcp refresh) — rediscover MCP servers and tools, useful after adding or modifying configuration.
Use the qodercn mcp subcommand for non-interactive management on the command line:
  • qodercn mcp add <name> -- <command> — add a stdio server.
  • qodercn mcp list — list the configured servers.
  • qodercn mcp remove <name> — remove a server.
The full parameters of each subcommand are available via qodercn mcp --help.

Next steps