使用cline集成aws的mcp服务和搜索功能

参考资料

在vscode中安装cline后,为了避免高额模型费用和兼容性问题,通过litellm封装了自部署模型,并配置在cline中

复制代码
http://litellm.example.com:4000

TLDR

日常万能配置如下

json 复制代码
{
  "mcpServers": {
    "awslabs.aws-api-mcp-server": {
      "disabled": true,
      "timeout": 60,
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "AWS_REGION=cn-north-1",
        "--volume",
        "/home/ec2-user/.aws:/app/.aws",
        "public.ecr.aws/awslabs-mcp/awslabs/aws-api-mcp-server:latest"
      ],
      "env": {}
    },
    "awslabs.aws-documentation-mcp-server": {
      "autoApprove": [
        "read_documentation",
        "search_documentation",
        "recommend",
        "get_available_services"
      ],
      "disabled": true,
      "timeout": 60,
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "FASTMCP_LOG_LEVEL=ERROR",
        "--env",
        "AWS_DOCUMENTATION_PARTITION=aws-cn",
        "mcp/aws-documentation:latest"
      ],
      "env": {}
    },
    "aws-knowledge-mcp-server": {
      "autoApprove": [
        "aws___search_documentation",
        "aws___read_documentation",
        "aws___recommend"
      ],
      "disabled": true,
      "timeout": 60,
      "type": "stdio",
      "command": "uvx",
      "args": [
        "fastmcp",
        "run",
        "https://knowledge-mcp.global.api.aws"
      ]
    },
    "github.com/tavily-ai/tavily-mcp": {
      "autoApprove": [],
      "disabled": true,
      "timeout": 60,
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "tavily-mcp@latest"
      ],
      "env": {
        "TAVILY_API_KEY": "tvly-dev-ecexxxxxxxxxxK"
      }
    },
    "web-search": {
      "timeout": 60,
      "type": "streamableHttp",
      "url": "http://localhost:3000/mcp",
      "autoApprove": [
        "search"
      ]
    },
    "web-search-sse": {
      "timeout": 60,
      "type": "sse",
      "url": "http://localhost:3000/sse",
      "autoApprove": [
        "search"
      ]
    }
  }
}

在线文档助手

使用如下mcp server配置,kb文档查询,document文档查询的功能,可以满足服务特性的答疑和总结功能。

json 复制代码
{
  "mcpServers": {
    "awslabs.aws-documentation-mcp-server": {
      "autoApprove": [
        "read_documentation",
        "search_documentation",
        "recommend",
        "get_available_services"
      ],
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "FASTMCP_LOG_LEVEL=ERROR",
        "--env",
        "AWS_DOCUMENTATION_PARTITION=aws-cn",
        "mcp/aws-documentation:latest"
      ],
      "env": {}
    },
    "aws-knowledge-mcp-server": {
      "autoApprove": [
        "aws___search_documentation",
        "aws___read_documentation",
        "aws___recommend"
      ],
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "uvx",
      "args": [
        "fastmcp",
        "run",
        "https://knowledge-mcp.global.api.aws"
      ]
    }
  }
}

资源检索工具

如果需要查询账户资源,可以集成api mcp,cline会使用awscli工具查询具体的资源

json 复制代码
{
  "mcpServers": {
    "awslabs.aws-api-mcp-server": {
      "timeout": 60,
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "AWS_REGION=cn-north-1",
        "--volume",
        "/home/ec2-user/.aws:/app/.aws",
        "public.ecr.aws/awslabs-mcp/awslabs/aws-api-mcp-server:latest"
      ],
      "env": {},
      "disabled": true
    }
}

成本和定价助手

比较常用的是查看账户中钱花在哪了

json 复制代码
{
  "mcpServers": {
    "awslabs.billing-cost-management-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "FASTMCP_LOG_LEVEL=ERROR",
        "awslabs/billing-cost-management-mcp-server:latest"
      ],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
  }
}

特定领域工具

个人习惯还是倾向于手动维护资源,类似cdk等mcp操作过于繁琐不容易理解具体的内容,后续的trouble shooting反而费事。

对于一些重复性的但是比较简单的服务,可以考虑类似如下的iam-mcp-server,用来分析现有用户策略,进行安全性测试很方便

json 复制代码
{
  "mcpServers": {
    "awslabs.iam-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.iam-mcp-server@latest","--readonly"],
      "env": {
        "AWS_PROFILE": "default",
        "AWS_REGION": "cn-north-1",
        "FASTMCP_LOG_LEVEL": "ERROR"
      }
    }
  }
}

使用support_mcp_server来更方便获取支持

json 复制代码
{
   "mcpServers": {
      "awslabs_support_mcp_server": {
         "command": "uvx",
         "args": [
            "-m", "awslabs.aws-support-mcp-server@latest",
            "--debug",
            "--log-file",
            "./logs/mcp_support_server.log"
         ],
         "env": {
            "AWS_PROFILE": "default"
         }
      }
   }
}

搜索功能

tavily需要申请apikey,一个月1000次免费额度

复制代码
"github.com/tavily-ai/tavily-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "tavily-mcp@latest"
      ],
      "env": {
        "TAVILY_API_KEY": "tvly-xxxxxxxxxxx"
      },
      "disabled": false,
      "autoApprove": []
    }

自行部署open-web-search

复制代码
docker run -d --name web-search -p 3000:3000 \
  -e ENABLE_CORS=true \
  -e CORS_ORIGIN=* \
  ghcr.io/aas-ee/open-web-search:latest

mcp配置如下

json 复制代码
"web-search": {
  "timeout": 60,
  "type": "streamableHttp",
  "url": "http://localhost:3000/mcp",
  "autoApprove": [
    "search"
  ]
},
"web-search-sse": {
  "timeout": 60,
  "type": "sse",
  "url": "http://localhost:3000/sse",
  "autoApprove": [
    "search"
  ]
}
相关推荐
蓝队云计算16 小时前
蓝队云部署OpenClaw深度指南:避坑、优化与安全配置,从能用做到好用
运维·安全·云计算
珠海西格17 小时前
1MW光伏项目“四可”装置改造:逆变器兼容性评估方法详解
大数据·运维·服务器·云计算·能源
翼龙云_cloud1 天前
阿里云渠道商:阿里云弹性伸缩如何助力海量数据采集?
服务器·阿里云·云计算
深圳市恒讯科技1 天前
2026新加坡服务器硬件防火墙配置推荐
运维·服务器·云计算
JiL 奥1 天前
简易的 AWS SAM + GitHub Actions 项目
云计算·github·aws
China_Yanhy1 天前
入职 Web3 运维日记 · 第 6 日:触碰红线 —— 私钥托管与 AWS KMS 的博弈
运维·web3·aws
主机哥哥1 天前
阿里云OpenClaw(原Clawdbot/Moltbot)一键秒级部署教程
阿里云·云计算
打码人的日常分享1 天前
智能制造数字化工厂解决方案
数据库·安全·web安全·云计算·制造
70asunflower2 天前
阿里云无影云电脑 Docker 使用完全指南
阿里云·docker·云计算
主机哥哥2 天前
零基础入门:阿里云OpenClaw部署全流程详解(图文版)
阿里云·云计算