Skip to main content

MCP

Configuration Location

● Global configuration: ~/.config/costrict/costrict.json

● Project configuration: costrict.json in the project root directory

Configuration Example

The following configures two MCPs, one remote and one local.

{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp",
"headers": {
"CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"
}
},
"mcp_everything": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-everything"],
}
}
}

Configuration description:

● Local

OptionTypeRequiredDescription
typeStringYMCP server connection type, must be "local".
commandArrayYCommand and parameters to run the MCP server.
environmentObjectEnvironment variables to set when running the server.
enabledBooleanEnable or disable the MCP server on startup.
timeoutNumberTimeout for fetching tools from the MCP server (milliseconds). Default is 5000 (5 seconds).

● Remote

OptionTypeRequiredDescription
typeStringYMCP server connection type, must be "remote".
urlStringYURL of the remote MCP server.
enabledBooleanEnable or disable the MCP server on startup.
headersObjectHeaders to send with requests.
oauthObjectOAuth authentication configuration.
timeoutNumberTimeout for fetching tools from the MCP server (milliseconds). Default is 5000 (5 seconds).

OAuth configuration:

OptionTypeDescription
oauthObject | falseOAuth configuration object, or false to disable OAuth auto-detection.
clientIdStringOAuth client ID. If not provided, will attempt dynamic client registration.
clientSecretStringOAuth client secret, required if the authorization server requires it.
scopeStringOAuth permission scope requested during authorization.

Testing

Execute: cs mcp list

img

img