Skip to main content
Reference

MCP reference

Transport methods, configuration fields, scope, and permissions for MCP servers

The Model Context Protocol (MCP) allows Qoder CLI to integrate with third-party tools and services. This page provides a complete reference for MCP server configuration. For a usage guide, see MCP Servers.

Transport Methods

MCP servers specify the transport protocol via the type field:
TypeDescription
stdio (default)Spawns a subprocess and interacts via stdin/stdout.
sseConnects via Server-Sent Events over HTTP.
http / streamable-httpConnects via HTTP (JSON-RPC + optional streaming).
wsConnects via WebSocket / TCP.
sdkBuilt-in SDK-level server (in-process).

Configuration Fields

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

stdio Type

FieldTypeDescription
commandstringThe command to start the server.
argsstring[]Arguments passed to the command.
envobjectEnvironment variables passed to the subprocess.
cwdstringThe working directory for the subprocess.

sse Type

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

http / streamable-http Type

FieldTypeDescription
urlstringThe HTTP endpoint URL.
type"http"Transport type identifier.
headersobjectHTTP headers.

ws Type (TCP)

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

Common Optional Fields

FieldTypeDescription
timeoutnumberConnection/request timeout (in milliseconds).
typestringExplicitly specifies the transport type.
descriptionstringServer description, displayed in the management view.
trustbooleanTrusts the server, skipping confirmation when its tools are called.
includeToolsstring[]Registers only the listed tools.
excludeToolsstring[]Excludes the listed tools.
disabledbooleanDisables the server (keeps the configuration without deleting it).
alwaysAllowstring[]List of tool names that are always allowed without confirmation.
oauthobjectOAuth authorization configuration (fields include enabled, clientId, clientSecret, authorizationUrl, tokenUrl, scopes, callbackPort, etc.).

Configuration Scope

MCP servers can be configured at multiple levels:
LevelLocationDescription
User Level~/.qoder/settings.jsonmcpServersAvailable to all projects.
Project-Level<project>/.qoder/settings.jsonmcpServersRequires approval before use (for security reasons).
Project-Level<project>/.mcp.jsonRequires a top-level mcpServers key; requires approval before use.
Local Level<project>/.qoder/settings.local.jsonmcpServersLocal to the current project on this machine; the default scope for -s, loaded only when the directory is trusted.
Plugin.mcp.json or mcp.json in the plugin directoryLoaded upon plugin installation.
CLI argument--mcp-config <path>, --settingsValid for this session only.
Servers with the same name are overridden in the following order (later overrides earlier): User Level → Project-Level settings.json → Project-Level .mcp.json → Local Level → CLI argument. Project-level MCP servers require individual approval by default. This can be bypassed using the following methods:
  • mcp.enableAllProjectMcpServers: true: Automatically approves all project-level servers.
  • mcp.enabledProjectMcpServers: Allowlist, approves by name.
Both settings are placed under the mcp group in settings.json (a restart is required after modification):
{
  "mcp": {
    "enableAllProjectMcpServers": true,
    "enabledProjectMcpServers": ["playwright", "context7"]
  }
}

Permissions and Security

  • MCP tools are managed by the Permissions System just like built-in tools—user confirmation is required before invocation (unless using auto or bypass_permissions mode).
  • --allowed-mcp-server-names: Restricts loading to only MCP servers with specified names.
  • --strict-mcp-config: Strict mode, loads only servers from the file specified by --mcp-config.
  • mcp.allowed / mcp.excluded: Controls the allowlist or blocklist of servers in the configuration.

Lazy Loading Mode

When multiple MCP servers are connected, all tool schemas are registered at startup by default, which may consume a significant number of Prompt Tokens in the first turn. When lazy loading is enabled (mcp.lazyLoad: true or QODER_MCP_LAZY=1), the CLI exposes only three Meta Tools (mcp_list / mcp_get / mcp_call) and loads the actual tools on demand, saving token overhead.

Management Commands

Use the /mcp Slash Command to manage MCP servers in an interactive session:
  • /mcp — View the list and status of connected servers.
  • /mcp reload (alias /mcp refresh) — Rediscover MCP servers and tools, useful after adding or modifying configurations.
Use the qodercli mcp subcommand in the command line for non-interactive management:
  • qodercli mcp add <name> -- <command> — Add a stdio server.
  • qodercli mcp list — List configured servers.
  • qodercli mcp remove <name> — Remove a server.
For arguments and examples for each subcommand, see MCP Servers.

Next Steps