Skip to content

Commit c79a936

Browse files
Update mcp_server.md
1 parent dec5299 commit c79a936

File tree

1 file changed

+64
-11
lines changed

1 file changed

+64
-11
lines changed

docs/user_manual/mcp/mcp_server.md

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77
### 前提条件
88

9-
- Go 1.23.0 或更高版本
10-
- 已有 1Panel
9+
- Go 1.23.0 或更高版本 (二进制使用方式)
10+
- Docker (Docker 使用方式)
11+
- 已安装 1Panel
1112

12-
### 从源代码构建
13+
### 从源代码构建 (二进制)
1314

14-
1. 克隆仓库
15+
1. 克隆代码仓库
1516

1617
```bash
1718
git clone https://github.com/1Panel-dev/mcp-1panel.git
@@ -24,17 +25,23 @@ cd mcp-1panel
2425
make build
2526
```
2627

27-
> ./build/mcp-1panel 移动至系统环境变量
28+
`./build/mcp-1panel` 移动到系统环境变量 PATH 所包含的目录中。
2829

29-
### 使用 go install 安装
30+
### 使用 `go install` 安装
3031

3132
```bash
3233
go install github.com/1Panel-dev/mcp-1panel@latest
3334
```
3435

35-
## 使用方法
36+
## 使用方式
3637

37-
**Cursor****Windsurf** 配置示例:
38+
你可以将 1Panel MCP Server 与 Cursor 和 Windsurf 等工具配合使用。
39+
40+
### stdio 模式
41+
42+
#### 二进制方式
43+
44+
确保已安装 Go 并已构建或安装该二进制文件:
3845

3946
```json
4047
{
@@ -50,7 +57,53 @@ go install github.com/1Panel-dev/mcp-1panel@latest
5057
}
5158
```
5259

53-
> 还可以使用Claude、Windsurf、Cline等MCP客户端。
60+
#### Docker 方式
61+
62+
确保已安装 Docker:
63+
64+
```json
65+
{
66+
"mcpServers": {
67+
"mcp-1panel": {
68+
"command": "docker",
69+
"args": [
70+
"run",
71+
"-i",
72+
"--rm",
73+
"-e",
74+
"PANEL_HOST",
75+
"-e",
76+
"PANEL_ACCESS_TOKEN",
77+
"1panel/1panel-mcp-server"
78+
],
79+
"env": {
80+
"PANEL_HOST": "such as http://localhost:8080",
81+
"PANEL_ACCESS_TOKEN": "<your 1Panel access token>"
82+
}
83+
}
84+
}
85+
}
86+
```
87+
88+
### SSE 模式
89+
90+
使用 SSE 启动 MCP server:
91+
92+
```bash
93+
mcp-1panel -host <your 1Panel access address> -token <your 1Panel access token> -transport sse -addr "http://localhost:8000"
94+
```
95+
96+
Cursor/Windsurf 配置示例:
97+
98+
```json
99+
{
100+
"mcpServers": {
101+
"mcp-1panel": {
102+
"url": "http://localhost:8000/sse"
103+
}
104+
}
105+
}
106+
```
54107

55108
### 命令行选项
56109

@@ -70,7 +123,7 @@ go install github.com/1Panel-dev/mcp-1panel@latest
70123

71124
服务器提供了各种与 1Panel 交互的工具:
72125

73-
| 工具 | 类别 | 描述 |
126+
| 工具 | 类别 | 描述 |
74127
|-----------------------------|------|------------------|
75128
| **get_dashboard_info** | 系统 | 列出概览页状态 |
76129
| **get_system_info** | 系统 | 获取系统信息 |
@@ -82,4 +135,4 @@ go install github.com/1Panel-dev/mcp-1panel@latest
82135
| **install_openresty** | 应用 | 安装 OpenResty |
83136
| **install_mysql** | 应用 | 安装 MySQL |
84137
| **list_databases** | 数据库 | 列出所有数据库 |
85-
| **create_database** | 数据库 | 创建数据库 |
138+
| **create_database** | 数据库 | 创建数据库 |

0 commit comments

Comments
 (0)