---
url: /zh/ai/mcp-server.md
---
CNB 支持 MCP 协议的 MCP Server

## 使用方法

### Streamable (推荐)

```json
{
  "mcpServers": {
    "cnb": {
      "url": "https://mcp.cnb.build/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}
```

### SSE

```json
{
  "mcpServers": {
    "cnb": {
      "url": "https://mcp.cnb.build/sse",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}
```

### STDIO

```json
{
  "mcpServers": {
    "cnb": {
      "command": "npx",
      "args": ["-y", "-p", "@cnbcool/mcp-server", "cnb-mcp-stdio"],
      "env": {
        "API_BASE_URL": "https://api.cnb.build",
        "API_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}
```

* `API_BASE_URL` 可选，默认值为 `https://api.cnb.cool`。
