使用Amazon Q Business跨应用索引的MCP服务器
这是Acme公司的MCP(模型上下文提供程序)服务器,它使用Amazon Q Business的跨应用程序索引。
先决条件
将数据上传到S3
上传中存在的文件 synthetic_data 将目录添加到S3,并将其用作您在TVM设置中创建的Q Business APP的数据源。
(代币自动售货机)TVM设置
设置 amzn-q-auth-tvm 来自存储库https://github.com/aws-samples/custom-ui-tvm-amazon-q-business
复制以下内容 cdk-outputs.json 成功部署后生成 amzn-q-auth-tvm 向 tvm_values.json 此存储库的文件。无需配置QUI。
配置
在此模块的根目录下创建.env文件。
touch .env应用程序使用环境变量进行配置。您可以在 .env 文件:
REGION=us-east-1
Q_BUSINESS_APP_NAME=REPLACE_WITH_YOUR_Q_BUSINESS_APP_NAMEUV设置和运行
此项目使用 uv 用于依赖管理,而不是传统的Python venv。
对于Mac,你 必须 跑 brew install uv 以获得流畅的MCP体验。否则,您可能会遇到 ENOENT挑战
brew install uv运行服务器
您可以使用提供的脚本运行服务器:
./run_with_uv.sh此脚本将:
- 如果紫外线环境不存在,则创建一个紫外线环境
- 安装所需的依赖项
- 运行MCP服务器
手动设置
如果您更喜欢手动设置:
# Create and activate uv environment
uv venv .uv
source .uv/bin/activate
# Install dependencies
uv pip install boto3 "mcp[cli]" requests fastmcp httpx python-dotenv
# Run the server
python mcp_server.py所需套餐
- 投票3
- mcp\[cli\]
- 请求:
- fastmcp
- httpx
- python dotenv
测试客户端
python test_mcp_client.py根据门票提出的问题 synthetic_data 目录
What are some of the reasons of keyboard failure?
What are software installation issues caused by?
What is the remediation of password not working?
What do I do if I am unable to access my backup files?
What immediate action did AnyCompany take to improve the Voice receptionist service while discussing the upgrade?
During which hours did Michael Chen notice the most significant delays?安装和配置Claude Desktop
下载并安装 克劳德桌面 对于您的操作系统。 按照以下步骤完成MCP主机设置 适用于Claude桌面用户 导游。
关闭对已同步数据的固定响应的Web搜索。

