Bedrock KB Retrieval MCP - Amazon Bedrock Knowledge Base Integration¶
Amazon Bedrock Knowledge Base Retrieval MCP integration with Amazon QuickSuite. This solution creates an MCP integration that enables direct access to Amazon Bedrock Knowledge Bases through QuickSuite using MCP Actions.
Architecture¶

Components:
- AgentCore Gateway: Amazon Bedrock AgentCore Gateway with Lambda target
- Lambda Function: Amazon Bedrock Knowledge Base retrieval handler
- QuickSuite Integration: MCP Actions for conversational AI
- Amazon Bedrock Knowledge Bases: Document retrieval and semantic search
Purpose¶
This MCP integration enables:
- Direct KB Access: Query Amazon Bedrock Knowledge Bases through natural language
- QuickSuite Integration: Integration using MCP Actions
- AgentCore Gateway: Gateway with Lambda target and authentication
- Document Retrieval: Semantic search with reranking and filtering
Project Structure¶
bedrock-kb-retrieval-mcp/
app.py # CDK deployment entry point
cdk.json # CDK configuration
pyproject.toml # Project dependencies
tools/ # Lambda function code
kb_agentcore_lambda.py # AgentCore MCP handler
kb_agentcore_tools.json # MCP tool definitions
requirements.txt # Lambda dependencies
cdk/ # Infrastructure code
bedrock_kb_mcp_stack.py # AgentCore Gateway stack
README.md # CDK deployment guide
README.md # This file
Quick Start¶
1. Clone Repository (Sparse Checkout)¶
# Clone repository with sparse checkout
git clone --filter=blob:none --sparse https://github.com/aws-samples/sample-amazon-quick-suite-knowledge-hub.git
cd sample-amazon-quick-suite-knowledge-hub
# Configure sparse checkout for this integration only
git sparse-checkout set docs/integration/actions/MCP/bedrock-kb-retrieval-mcp
cd docs/integration/actions/MCP/bedrock-kb-retrieval-mcp
2. Deploy AgentCore Gateway¶
npm install -g aws-cdk
uv sync
cdk deploy --require-approval never
3. Get Outputs¶
Option 1: AWS Console (Recommended)
- Go to AWS CloudFormation in the AWS Console
- Find the quicksuite-bedrock-kb-mcp stack
- Click on the Outputs tab
- Copy the required values for Quick Suite integration
Option 2: CLI Commands
aws cloudformation describe-stacks --stack-name quicksuite-bedrock-kb-mcp --query 'Stacks[0].Outputs'
Key outputs for QuickSuite Actions:
GatewayUrl- AgentCore Gateway endpointClientId- OAuth2 client IDClientSecret- OAuth2 client secretCognitoTokenUrl- OAuth2 token endpoint
Available Tools¶
Knowledge Base Tools (kb_agentcore_lambda.py)¶
| Tool | Purpose | Input | Output |
|---|---|---|---|
ListKnowledgeBases |
Discover available Bedrock Knowledge Bases | explanation | knowledge_base_mapping, data_sources |
QueryKnowledgeBases |
Natural language retrieval from Knowledge Bases | query, knowledge_base_id, options | documents, content, scores |
ListKnowledgeBases¶
Purpose: Discover available Bedrock Knowledge Bases and data sources
Input: explanation (string): Brief description of why you're listing knowledge bases
Output: Knowledge base mapping with IDs, names, descriptions, data sources
QueryKnowledgeBases¶
Purpose: Natural language retrieval from Bedrock Knowledge Bases Input:
query(required): Natural language search queryknowledge_base_id(required): Target KB IDnumber_of_results(optional): Result count (default: 10, max: 100)reranking(optional): Enable reranking (default: false)reranking_model_name(optional): Reranking model ("COHERE" or "AMAZON")data_source_ids(optional): Filter by data sources
Output: Newline-separated JSON documents with content, location, score
QuickSuite Integration¶
Complete guide to integrate Bedrock KB Retrieval with Amazon QuickSuite using MCP Actions.
Prerequisites¶
From your CDK deployment, you'll need:
GatewayUrl- AgentCore Gateway endpointClientId- Cognito Client IDClientSecret- Cognito Client SecretCognitoTokenUrl- OAuth2 token endpoint
Configure MCP Action in QuickSuite¶
Step 1: Access Integrations
- Navigate to Integrations in Amazon QuickSuite
- Click on Actions
- Click the + button for Model Context Protocol
Step 2: Configure MCP Server Fill in the MCP configuration:
- Name: Bedrock Knowledge Base Retrieval
- Description: Amazon Bedrock Knowledge Base retrieval with natural language queries
- MCP Server Endpoint: Paste your
GatewayUrlfrom CDK deployment outputs - Click Next
Step 3: Configure Authentication
- For Authentication, select Service Authentication
- Keep Service-to-service OAuth within the Authentication type field
-
Fill in the authentication values from your CDK deployment outputs:
-
Client ID → Paste your
ClientId(ensure no leading/trailing spaces) - Client Secret → Paste your
ClientSecret(ensure no leading/trailing spaces) - Token URL → Paste your
CognitoTokenUrl
Step 4: Complete Setup
- Click Create and Continue
- Select Next
- Select Next
Usage in QuickSuite¶
"List all available knowledge bases"
"Search for AWS Lambda best practices in my knowledge base"
"Find documents about data encryption with reranking enabled"
"Query kb-12345 about compliance requirements"
Troubleshooting¶
MCP Authentication Issues:
- Verify OAuth2 credentials in QuickSuite MCP Actions
- Check Cognito token endpoint configuration
- Ensure client secret is correctly copied
Knowledge Base Access:
- Verify Amazon Bedrock KB exists and is accessible
- Check IAM permissions for Amazon Bedrock services
- Confirm KB indexing is complete
AgentCore Gateway:
- Monitor AgentCore Gateway throttling limits
- Check Lambda timeout and memory settings
- Review CORS configuration for QuickSuite
Documentation¶
- CDK Deployment Guide - Infrastructure details
- MCP Tool Definitions - API specifications
License¶
This library is licensed under the MIT-0 License.