Skip to content

Latest commit

 

History

History
245 lines (171 loc) · 5.7 KB

File metadata and controls

245 lines (171 loc) · 5.7 KB

Snow CLI User Documentation - MCP Configuration

Welcome to Snow CLI! Agentic coding in your terminal.

MCP Configuration

MCP (Model Context Protocol) is an open protocol that allows AI assistants to integrate with external tools and services. Snow CLI supports configuring and managing MCP services.

What is MCP

MCP (Model Context Protocol) is a standardized protocol for connecting AI assistants with various external tools, data sources, and services. Through MCP, Snow CLI can access local file systems, connect to databases, call external APIs, and more.

View MCP Service Status

Enter the /mcp command in the chat interface to view the status of all MCP services:

Display Content:

  • Service name
  • Connection status (green ● for connected, red ● for failed, gray ● for disabled)
  • Service type (System/External/Disabled)
  • Available tools list

Operations:

  • Up/Down arrows: Navigate through service list
  • Enter key: Reconnect selected service
  • Tab key: Toggle enable/disable for external services (not supported for built-in services)
  • Select "Refresh all services" option to refresh all services

Configure MCP Services

1. Enter Configuration Interface

Select MCP Configuration from the main menu to enter the MCP configuration editor.

2. Automatic Editor Detection

The system will automatically detect and use an appropriate text editor to open the configuration file:

Editor Priority:

  1. Editor specified by VISUAL environment variable
  2. Editor specified by EDITOR environment variable
  3. System default editor

Windows: Detection order: notepad++ > notepad > code > vim > nano

macOS/Linux: Detection order: nano > vim > vi

Set Default Editor:

macOS/Linux:

export EDITOR=nano

Windows:

set EDITOR=notepad

3. Configuration File Format

Configuration file location: ~/.snow/mcp-config.json

Configuration Structure:

{
	"mcpServers": {
		"service-name": {
			"command": "command",
			"args": ["arg1", "arg2"],
			"enabled": true
		}
	}
}

Configuration Options:

  • mcpServers: MCP service configuration object
  • service-name: Custom service name (unique identifier)
  • type: Transport type, optional values are 'stdio', 'local', or 'http' (optional, auto-detected based on url or command by default)
    • 'stdio': Local subprocess communication (STDIO mode)
    • 'local': Alias for 'stdio', functionally identical
    • 'http': HTTP mode for connecting to remote MCP services
  • command: Command to start the MCP service (required for stdio/local type)
  • args: Command argument array (optional)
  • url: MCP service endpoint URL (required for http type)
  • headers: HTTP request headers configuration (optional for http type)
  • enabled: Whether to enable the service (optional, defaults to true)
  • timeout: Tool invocation timeout in milliseconds (optional, defaults to 300000, i.e., 5 minutes)
  • env / environment: Environment variables configuration (optional), environment is an alias for env

Configuration Example:

STDIO/Local Mode Example:

{
	"mcpServers": {
		"filesystem": {
			"type": "stdio",
			"command": "npx",
			"args": [
				"-y",
				"@modelcontextprotocol/server-filesystem",
				"/path/to/files"
			],
			"timeout": 600000
		},
		"github": {
			"type": "local",
			"command": "npx",
			"args": ["-y", "@modelcontextprotocol/server-github"],
			"enabled": true,
			"environment": {
				"GITHUB_TOKEN": "your_token_here"
			}
		}
	}
}

HTTP Mode Example:

{
	"mcpServers": {
		"remote-service": {
			"type": "http",
			"url": "https://api.example.com/mcp",
			"headers": {
				"Authorization": "Bearer ${API_KEY}",
				"X-Custom-Header": "custom-value"
			},
			"env": {
				"API_KEY": "your_api_key_here"
			},
			"timeout": 300000
		}
	}
}

Note: HTTP mode supports reading configuration values from environment variables using the ${VAR_NAME} syntax.

Configuration Validation

After saving the configuration file, the system will automatically validate it:

Success Message:

MCP configuration saved successfully ! Please use `snow` restart!

Error Message:

Invalid JSON format

Using MCP Services

After configuration, restart Snow CLI for changes to take effect:

snow

After startup, use the /mcp command to view service connection status.

Manage MCP Services

Enable/Disable Services

Method 1: Edit Configuration File

Set the enabled field to false to disable a service

Method 2: Use /mcp Command

  1. Enter /mcp to open the service panel
  2. Use up/down arrows to select service
  3. Press Tab key to toggle enable/disable status

Note: Built-in services cannot be disabled

Reconnect Services

In the /mcp panel, select a service and press Enter to reconnect

Troubleshooting

1. Editor Cannot Open

Error Message:

No text editor found! Please set the EDITOR or VISUAL environment variable.

Solution:

Set environment variable or install a text editor:

macOS/Linux:

export EDITOR=nano

Windows:

set EDITOR=notepad

2. Service Connection Failed

Check Items:

  1. Is the command path correct
  2. Are dependencies installed (e.g., Node.js for npx)
  3. Is the parameter format correct
  4. Use /mcp to view specific error messages

3. Configuration Not Taking Effect

Solution:

  1. Confirm configuration file is saved
  2. Restart Snow CLI
  3. Use /mcp to check service status

Related Resources