MCP

Hawa Code supports MCP and can be used with simple configuration.

User-Level Configuration

Configure the mcpServers property in ~/.hcode/hcode.json. User-level MCP configuration is available to all projects. Since it’s configured locally, it won’t be committed to the code repository via git and can be used as personal private configuration.

Local Project Configuration

Configure the mcpServers property in the specified project configuration in ~/.hcode/hcode.json. Local project configuration only takes effect for specific projects. Since it’s configured locally, it won’t be committed to the code repository via git and can be used as personal private configuration.

Project Configuration

Configure in {project_path}/.mcp.json. Project configuration only takes effect in the current project and can be committed to the code repository for shared team configuration.

Configuration Example

Below is a project configuration example. Other configuration formats are the same and can be referenced accordingly.

 { 
"mcpServers": {
"supabase": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@supabase/mcp-server-supabase@latest",
"--access-token",
"<personal-access-token>"
]
}
}
}

Dynamic Parameters

String values in the configuration file support ${...} placeholders for dynamic variables, which are replaced with actual values when the config is loaded. Interpolation happens in memory only and never writes back to the configuration file.

Supported variables:

Variable Description
${env.NAME} Environment variable
${env.NAME:-default} Environment variable, with default used when undefined
${home} User home directory
${cwd} Current project directory
${projectName} Current project name (same naming as the project directory under ~/.hcode/projects)
${globalConfigDir} Global config directory (~/.hcode)
${projectConfigDir} Config directory of the current project (~/.hcode/projects/<project-name>)

Use \${ to output a literal ${. If a variable is undefined and no default is provided, the original text is kept and a warning is logged.

Example configuration:

 {
"mcpServers": {
"sqlite": {
"command": "npx",
"args": [
"-y",
"@dahawa/hawa-sqlite-mcp",
"${projectConfigDir}/data.db"
]
},
"supabase": {
"type": "http",
"url": "https://mcp.supabase.com/mcp",
"headers": {
"Authorization": "Bearer ${env.SUPABASE_TOKEN}"
}
}
}
}

MCP Management

In the terminal, you can manage MCP using the /mcp slash command.
MCP enable and disable states are uniformly saved in the approvedMcprcServers and rejectedMcprcServers properties of the specified project in ~/.hcode/hcode.json. It is recommended to manage these through the /mcp slash command rather than manual modification.