MCP基岩知识库服务器
使用模型上下文协议(MCP)将您的AI助手(Q CLI、Q Developer)连接到AWS基岩知识库。
🎯 学习目标
- 了解MCP服务器基础知识
- 将MCP服务器连接到AWS基岩知识库
- 与AI助手(Q CLI、Q Developer)集成
- 创建全面的文档和测试
🚀 快速开始
现在想使用MCP服务器吗?
👉 转到第3阶段快速入门说明 👈
这将使您的MCP服务器在几分钟内与Q CLI和Q Developer一起运行。
______________________________________________________________________
📚 学习路径(建立自己的)
想了解MCP服务器的工作原理吗? 本项目将逐步教您:
📚 选择你的学习路径
路径A:示例文件夹(建议初学者使用)
最适合:新程序员,那些不熟悉git的人
# Clone the repository
git clone
cd mcp-bedrock-kb
# Start with Phase 1
cd examples/phase-1-foundation
# Follow the README in that folder优势:
- 不需要git知识
- 完整的工作示例
- 不能意外破坏以前的工作
- 易于并排比较相位
路径B:Git标签(建议中级+)
最适合:熟悉git的开发人员,希望看到进展
# Clone the repository
git clone
cd mcp-bedrock-kb
# Start with Phase 1
git checkout phase-1-complete
# Follow lessons/01-mcp-basics.md
# Later, move to Phase 2
git checkout phase-2-complete优势:
- 学习专业的git工作流程
- 查看阶段之间的确切代码更改
- 了解发展进程
- 练习版本控制
📖 学习阶段
第一阶段:基础✅
状态:完成
- 基本MCP服务器结构
- 工具登记和处理
- 测试方法
- 全面的文件
文件: examples/phase-1-foundation/ 或 git checkout phase-1-complete
第二阶段:AWS集成✅
状态:完成
- 连接到基岩知识库
- 真实查询实现
- 响应格式
- AWS身份验证
文件: examples/phase-2-aws-integration/ 或 git checkout phase-2-complete
第3阶段:Q CLI集成✅
状态:完成
- 为Q CLI配置MCP服务器
- 虚拟环境依赖性管理
- 集成测试和验证
- 常见问题排查
文件: examples/phase-3-q-cli-integration/ 或 git checkout phase-3-complete
第四阶段:Q开发人员集成🔄
状态:发展中
- 为Q Developer(IDE)配置MCP服务器
- VS代码集成设置
- 开发工作流程增强
- 高级IDE功能
文件: examples/phase-4-q-developer-integration/ 或 git checkout phase-4-complete
🛠️ 先决条件
- Python 3.8+
- AWS CLI已配置凭据
- AWS基岩知识库(可选-我们将帮助您创建一个)
🚀 快速入门(任一路径)
- 在上面选择你的学习路径
- 按照所选起点中的README进行操作
- 按顺序完成课程
- 实验并修改代码!
📋 项目结构
mcp-bedrock-kb/
├── examples/ # Complete phase examples
│ ├── phase-1-foundation/ # Standalone working example
│ ├── phase-2-aws-integration/ # AWS Bedrock KB integration
│ └── phase-3-q-cli-integration/ # Q CLI MCP server setup
├── src/ # Current development
├── lessons/ # Step-by-step tutorials
│ ├── 01-mcp-basics.md
│ ├── 02-testing-basics.md
│ └── 03-aws-integration.md
├── explanations/ # Detailed code explanations
│ ├── server-explained.md
│ ├── test-explained.md
│ └── aws-integration-explained.md
├── tests/ # Test files
│ ├── test_basic.py # Phase 1 reference
│ ├── test_mcp_protocol.py # Current working test
│ ├── test_q_cli_integration.py # Q CLI integration test
│ └── comparative-testing/ # Knowledge base value demonstration
│ ├── development-task-test.md
│ ├── implementation_with_kb.py
│ ├── implementation_without_kb.py
│ └── comparative-analysis.md
├── README.md # This file
└── implementation-plan.md # Development roadmap🎓 教育特色
- 逐行解释:为新程序员解释每一行代码
- 为什么要集中学习:了解每个决定背后的推理
- 真实世界测试:学习正确测试MCP服务器
- 专业实践:Git工作流、文档、错误处理
🤝 贡献
这是一个教育项目。请随意:
- 对解释提出改进建议
- 报告文件不清楚
- 分享你的学习经历
- 提出其他示例
______________________________________________________________________
快乐学习! 🎉
*选择上面的路径,开始构建MCP服务器,用自己的知识库增强AI助手。*
