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.
An MCP server's transport protocol is specified with the
MCP servers are configured under the
MCP servers can be configured at multiple levels:
Servers with the same name override in this order (later overrides earlier): user → project
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 (
Use the
Transports
An MCP server's transport protocol is specified with the type field:
| Type | Description |
|---|---|
stdio (default) | Start a child process and interact over stdin/stdout. |
sse | Connect over Server-Sent Events HTTP. |
http / streamable-http | Connect over HTTP (JSON-RPC + optional streaming). |
ws | Connect over WebSocket / TCP. |
sdk | A 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:
stdio type
| Field | Type | Description |
|---|---|---|
command | string | The command that starts the server. |
args | string[] | Arguments passed to the command. |
env | object | Environment variables passed to the child process. |
cwd | string | The child process's working directory. |
sse type
| Field | Type | Description |
|---|---|---|
url | string | The SSE endpoint URL. |
type | "sse" | The transport type identifier. |
headers | object | HTTP request headers (may include authentication). |
http / streamable-http type
| Field | Type | Description |
|---|---|---|
url | string | The HTTP endpoint URL. |
type | "http" | The transport type identifier. |
headers | object | HTTP request headers. |
ws type (TCP)
| Field | Type | Description |
|---|---|---|
tcp | object | TCP connection parameters (host/port). |
type | "ws" | The transport type identifier. |
Common optional fields
| Field | Type | Description |
|---|---|---|
timeout | number | Connection/request timeout (milliseconds). |
type | string | Explicit transport type. |
description | string | Server description, shown in the management view. |
trust | boolean | Trust this server, skipping confirmation when its tools are called. |
includeTools | string[] | Register only the listed tools. |
excludeTools | string[] | Exclude the listed tools. |
disabled | boolean | Disable the server (keeps the configuration without deleting it). |
alwaysAllow | string[] | Tool names always allowed without confirmation. |
oauth | object | OAuth authorization configuration (fields include enabled, clientId, clientSecret, authorizationUrl, tokenUrl, scopes, callbackPort, etc.). |
Configuration scopes
MCP servers can be configured at multiple levels:
| Level | Location | Description |
|---|---|---|
| User | ~/.qoder-cn/settings.json → mcpServers | Available to all projects. |
| Project | <project>/.qoder/settings.json → mcpServers | Usable after approval (for security). |
| Project | <project>/.mcp.json | Requires a top-level mcpServers key; usable after approval. |
| Local | <project>/.qoder/settings.local.json → mcpServers | This 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 directory | Loaded when the plugin is installed. |
| CLI flags | --mcp-config <path>, --settings | Effective for the current session only. |
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.
mcp group in settings.json (restart required after changes):
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
autoorbypass_permissionsmode). --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.
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.
qodercn mcp --help.
Next steps
- Extend tools via MCP: Tools.
- The full settings table: Settings, Environment Variables, and File Paths.
- Extension troubleshooting: Hooks, MCP, and Plugin Issues.