MCP 配置文件管理模組提供了一系列工具和資源,用於管理 Nginx 配置文件。這些功能允許 AI 代理和自動化工具執行各種配置文件操作,包括讀取、創建、修改和組織配置文件。
toolnginx_config_base_pathtoolnginx_config_listtoolnginx_config_gettoolnginx_config_addtoolnginx_config_modifytoolnginx_config_renametoolnginx_config_mkdirtoolnginx_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}"
  }
}