MCP 配置文件管理模組提供了一系列工具和資源,用於管理 Nginx 配置文件。這些功能允許 AI 代理和自動化工具執行各種配置文件操作,包括讀取、創建、修改和組織配置文件。
tool
nginx_config_base_path
tool
nginx_config_list
tool
nginx_config_get
tool
nginx_config_add
tool
nginx_config_modify
tool
nginx_config_rename
tool
nginx_config_mkdir
tool
nginx_config_history
以下是一些使用 MCP 配置文件管理功能的示例:
{
"tool": "nginx_config_base_path",
"parameters": {}
}
返回結果示例:
{
"base_path": "/etc/nginx"
}
{
"tool": "nginx_config_list",
"parameters": {
"path": "/etc/nginx/conf.d"
}
}
返回結果示例:
{
"files": [
{
"name": "default.conf",
"is_dir": false,
"path": "/etc/nginx/conf.d/default.conf"
},
{
"name": "example.conf",
"is_dir": false,
"path": "/etc/nginx/conf.d/example.conf"
}
]
}
{
"tool": "nginx_config_get",
"parameters": {
"path": "/etc/nginx/conf.d/default.conf"
}
}
{
"tool": "nginx_config_modify",
"parameters": {
"path": "/etc/nginx/conf.d/default.conf",
"content": "server {\n listen 80;\n server_name example.com;\n location / {\n root /usr/share/nginx/html;\n index index.html;\n }\n}"
}
}