MCP server definitions live in the mcpServers object in settings and in extension manifests. The runtime types are in packages/core/src/config/config.ts; client logic is in mcp-client.ts.
Server fields
| Field | Purpose |
|---|---|
command | Executable for stdio transport. |
args | Argument array for stdio. |
env | Environment variables for the server. |
cwd | Working directory for stdio. |
url | HTTP/SSE endpoint. |
httpUrl | Deprecated HTTP/SSE endpoint. |
type | sse or http transport hint in core; settings schema also documents stdio. |
headers | HTTP headers for remote servers. |
tcp | WebSocket target. |
timeout | Operation timeout in milliseconds. |
trust | Whether the server is trusted. |
description | Human-readable description. |
includeTools / excludeTools | Tool filters. |
oauth | OAuth configuration object. |
authProviderType, targetAudience, targetServiceAccount | Advanced auth fields. |
Examples
json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"timeout": 30000
},
"remote": {
"url": "https://example.com/mcp",
"type": "http",
"headers": {"X-Example": "value"}
}
}
}Transports and defaults
httpUrltakes priority when present (deprecated; a warning is emitted if bothhttpUrlandurlare set).urlwithtype: httportype: sseselects that transport;urlwithout a type uses Streamable HTTP and falls back to SSE on HTTP 404.- Stdio requires a trusted folder. Environment values are sanitized and
${...}references are expanded from the sanitized environment. - The default timeout is 10 minutes for connect, call, and list operations.
- OAuth supports explicit
authorizationUrlandtokenUrl, or discovery viaWWW-Authenticateand OAuth metadata.
Merge and precedence
- Settings
mcpServersis a shallow-merged object across scopes. - Admin allowlists filter servers and clear
serverCommand; admin-required servers are injected afterward. - When an extension and a user configuration define the same server, the user configuration is the override.
includeToolsis intersected across definitions;excludeToolsis unioned;envobjects are merged.- Two extensions defining the same server name are skipped to avoid ambiguity.
- Session enablement files and
mcp.allowed/mcp.excludedcan disable a server.--allowed-mcp-server-namesrestricts servers for one invocation.
Management
bash
m31a mcp add <name> <commandOrUrl> [args...]
m31a mcp list
m31a mcp enable <name>
m31a mcp disable <name>
m31a mcp remove <name>In the TUI: /mcp auth, list, desc, schema, reload, enable, disable.
Next steps
See MCP, MCP tutorial, and Policy format.