MCP CodePipeline 服务端添加福利群:解决AI开发者的「MCP实战痛点」这是一个与 AWS CodePipeline 集成的 Model Context Protocol (MCP) 服务器,允许您通过 Windsurf 和 Cascade 管理您的管道。该服务器提供了一个标准化的接口,用于与 AWS CodePipeline 服务进行交互。
作者: Cuong T Nguyen
git clone https://github.com/cuongdev/mcp-codepipeline-server.git
cd mcp-codepipeline-server

npm install
.env.example 模板创建一个 .env 文件:cp .env.example .env

.env 文件:AWS_REGION=us-east-1 AWS_ACCESS_KEY_ID=your_access_key_id AWS_SECRET_ACCESS_KEY=your_secret_access_key PORT=3000
注意: 为了安全起见,请勿将
.env文件提交到版本控制中。
npm run build
npm start
对于带有自动重启的开发环境:
npm run dev
此 MCP 服务器设计为与 Windsurf 一起使用,允许 Cascade 通过自然语言请求与 AWS CodePipeline 进行交互。
npm start
~/.codeium/windsurf/mcp_config.json 中:{
"mcpServers": {
"codepipeline": {
"command": "npx",
"args": [
"-y",
"path/to/mcp-codepipeline-server/dist/index.js"
],
"env": {
"AWS_REGION": "us-east-1",
"AWS_ACCESS_KEY_ID": "your_access_key_id",
"AWS_SECRET_ACCESS_KEY": "your_secret_access_key"
}
}
}
}

mkdir -p ~/.codeium/windsurf
touch ~/.codeium/windsurf/mcp_config.json

配置完成后,您可以使用自然语言在 Windsurf 中与 AWS CodePipeline 进行交互。例如:
Cascade 会将这些请求转换为适当的 MCP 工具调用。
| 工具名称 | 描述 | 参数 |
|---|---|---|
list_pipelines |
列出所有 CodePipeline 管道 | 无 |
get_pipeline_state |
获取特定管道的状态 | pipelineName: 管道名称 |
list_pipeline_executions |
列出特定管道的执行 | pipelineName: 管道名称 |
trigger_pipeline |
触发管道执行 | pipelineName: 管道名称 |
stop_pipeline_execution |
停止管道执行 | pipelineName: 管道名称executionId: 执行 IDreason: 可选的停止原因 |
| 工具名称 | 描述 | 参数 |
|---|---|---|
get_pipeline_details |
获取管道的完整定义 | pipelineName: 管道名称 |
get_pipeline_execution_logs |
获取管道执行的日志 | pipelineName: 管道名称executionId: 执行ID |
get_pipeline_metrics |
获取管道的性能指标 | pipelineName: 管道名称period: 可选的指标周期(秒)startTime: 指标的可选开始时间endTime: 指标的可选结束时间 |
| 工具名称 | 描述 | 参数 |
|---|---|---|
approve_action |
批准或拒绝手动批准操作 | pipelineName: 管道名称stageName: 阶段名称actionName: 操作名称token: 批准令牌approved: 表示批准或拒绝的布尔值comments: 可选评论 |
retry_stage |
重试失败阶段 | pipelineName: 管道名称stageName: 阶段名称pipelineExecutionId: 执行ID |
tag_pipeline_resource |
为管道资源添加或更新标签 | pipelineName: 管道名称tags: 用于标记的键值对数组 |
create_pipeline_webhook |
为管道创建webhook | pipelineName: 管道名称webhookName: webhook名称targetAction: webhook的目标动作authentication: 认证类型authenticationConfiguration: 可选认证配置filters: 可选事件过滤器 |
连接被拒绝错误:
AWS凭据错误:
.env文件中验证您的AWS凭据Windsurf未检测到MCP服务器:
mcp_config.json文件格式服务器将信息记录到控制台。检查这些日志以进行故障排除:
# Run with more verbose logging
DEBUG=* npm start

{
"pipelineName": "my-pipeline",
"webhookName": "github-webhook",
"targetAction": "Source",
"authentication": "GITHUB_HMAC",
"authenticationConfiguration": {
"SecretToken": "my-secret-token"
},
"filters": [
{
"jsonPath": "$.ref",
"matchEquals": "refs/heads/main"
}
]
}

{
"pipelineName": "my-pipeline",
"period": 86400,
"startTime": "2025-03-10T00:00:00Z",
"endTime": "2025-03-17T23:59:59Z"
}

ISC