Amazon Bedrock Knowledge Base MCP Server
Enables querying Amazon Bedrock Knowledge Bases, including listing knowledge bases and data sources, retrieving semantically relevant passages, and applying metadata filters, reranking, and schema discovery.
Provides OAuth authentication via Auth0 to secure Streamable HTTP connections, including ChatGPT integrations, using Auth0 domain, audience, and resource URL configuration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Amazon Bedrock Knowledge Base MCP Server List my knowledge bases, then search for our refund policy with reranking"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Features
Dual Transport - STDIO for Claude Desktop, Streamable HTTP for ChatGPT
Smart Filtering - Schema-driven
whereconstraints + raw Bedrock filters + implicit filteringReranking - Optional AMAZON or COHERE reranking for improved relevance
Auto Schema Discovery - Automatically infer metadata schemas from retrieval results
OAuth Support - Auth0 integration for secure ChatGPT connections
Read-Only - Safe by design; no write operations to your knowledge bases
Related MCP server: techdocs
Architecture

Quick Start
Claude Desktop (STDIO)
Add to your Claude Desktop config:
Platform | Config Location |
macOS |
|
Windows |
|
{
"mcpServers": {
"bedrock-kb": {
"command": "uvx",
"args": ["amazon-bedrock-knowledge-base-mcp"],
"env": {
"AWS_PROFILE": "your-profile",
"AWS_REGION": "us-west-2"
}
}
}
}ChatGPT (Streamable HTTP)
AWS_PROFILE=your-profile \
AWS_REGION=us-west-2 \
MCP_TRANSPORT=streamable-http \
uvx amazon-bedrock-knowledge-base-mcpThen configure ChatGPT to connect to https://your-domain.example.com/mcp.
Note: ChatGPT requires HTTPS. Use a tunnel (ngrok, Cloudflare Tunnel) for local testing.
Available Tools
Discovery Tools
Tool | Description |
| List available knowledge bases and their data sources. Filters by tag. |
| Show the resolved metadata schema for filtering (static or auto-discovered). |
Query Tools
Tool | Description |
| Retrieve relevant passages. Content-focused, minimal output. |
| Retrieve passages + full metadata. Ideal for exploration and filter tuning. |
Recommended Workflow
List - Call
ListKnowledgeBasesto find available knowledge basesExplore - Use
QueryKnowledgeBasesWithMetadatato discover metadata keys/valuesSchema - Call
DescribeMetadataSchemato see available filter fieldsQuery - Use
QueryKnowledgeBaseswithwherefilters for precise retrieval
Environment Variables
AWS Configuration
Variable | Required | Default | Description |
| Yes* | - | AWS profile name (recommended) |
| Yes* | - | AWS region (e.g., |
*Either AWS_PROFILE or IAM role credentials are required.
Knowledge Base Discovery
Variable | Default | Description |
|
| Only include KBs tagged with |
Retrieval Defaults
Variable | Default | Description |
|
| Enable reranking by default |
|
|
|
Filtering
Variable | Default | Description |
|
| How to combine explicit and implicit filters |
|
| Allow raw Bedrock RetrievalFilter passthrough |
| - | Path to KB ID → schema-path mapping (JSON) |
| - | Default schema file path (JSON) |
| - | Model ARN for implicit filtering |
HTTP Server (Streamable HTTP only)
Variable | Default | Description |
|
| Transport mode: |
|
| HTTP server bind address |
|
| HTTP server port |
|
| Stateless mode (recommended for production) |
| - | Comma-separated allowed CORS origins ( |
| - | Comma-separated allowed Host headers |
OAuth (Auth0)
Variable | Required | Description |
| No | Set to |
| Yes* | Auth0 tenant domain (e.g., |
| Yes* | Auth0 API identifier / audience |
| Yes* | Public URL clients connect to |
*Required when MCP_AUTH_MODE=oauth
Logging
Variable | Default | Description |
|
| Log level ( |
Documentation
Guide | Description |
Claude Desktop and local development | |
HTTP server setup and configuration | |
Deploy to production with nginx and SSL | |
Complete Auth0 OAuth setup for ChatGPT |
Docker
# Build the image
docker build -t amazon-bedrock-knowledge-base-mcp:local .
# Run with AWS credentials
docker run --rm \
-v "$HOME/.aws:/home/app/.aws:ro" \
-e AWS_PROFILE=your-profile \
-e AWS_REGION=us-west-2 \
amazon-bedrock-knowledge-base-mcp:local
# Run as HTTP server
docker run --rm \
-p 8000:8000 \
-v "$HOME/.aws:/home/app/.aws:ro" \
-e AWS_PROFILE=your-profile \
-e AWS_REGION=us-west-2 \
-e MCP_TRANSPORT=streamable-http \
-e MCP_HOST=0.0.0.0 \
amazon-bedrock-knowledge-base-mcp:localHealth Endpoints
Endpoint | Description |
| Basic health check (always returns 200 if running) |
| Readiness check (validates AWS credentials via STS) |
Development
# Clone and install
git clone https://github.com/Zlash65/amazon-bedrock-knowledge-base-mcp.git
cd amazon-bedrock-knowledge-base-mcp
uv sync --group dev
# Run tests
uv run pytest -q
# Type check
uv run pyright
# Lint
uv run ruff check .
# Format
uv run ruff format .Metadata Schema
Schema files define available metadata fields for filtering. See schemas/README.md for examples.
Example schema:
{
"fields": [
{
"key": "x-amz-bedrock-kb-source-uri",
"type": "string",
"description": "Source document URI",
"alias": "source"
},
{
"key": "category",
"type": "string",
"description": "Document category",
"filterable": true
}
]
}Use in queries:
# Using alias
{"where": {"source": "s3://bucket/doc.pdf"}}
# Using direct key
{"where": {"category": ["finance", "legal"]}}Limitations
Results with
IMAGEcontent type are not included in query responsesReranking requires additional IAM permissions and is only available in specific regions
Knowledge bases must be tagged with
KB_INCLUSION_TAG_KEY=trueto be discoverable
License
Available Tools
4 toolsDescribeMetadataSchema
Describe the metadata schema used for filtering.
Returns a JSON string describing the effective schema for a knowledge base. Use this before
applying metadata filters via `where`, `filter`, or implicit filtering.
Inputs: knowledge_base_id (required), metadata_schema_mode, metadata_schema_auto_sample_k, metadata_schema_auto_sample_query. Returns: result
ListKnowledgeBases
List available knowledge bases and their data sources.
Returns a JSON string mapping knowledge base IDs to `{name, description, data_sources}`.
Inputs: no named parameters. Returns: result
QueryKnowledgeBases
Query a knowledge base and return relevant passages.
Returns a newline-separated set of JSON objects (one per retrieval result).
Inputs: query (required), knowledge_base_id (required), where, filter, +11 more. Returns: result
QueryKnowledgeBasesWithMetadata
Query a knowledge base and include metadata in results.
Use this for metadata-driven exploration (discover what keys/values exist) before applying precise filters. Returns newline-separated JSON objects.
Inputs: query (required), knowledge_base_id (required), where, filter, +12 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
MCP server for searching Airweave collections with natural language queries.
Agentic search over your Dewey document collections from any MCP-compatible client.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables MCP-compatible clients to search SignalRank with dense, BM25, or hybrid retrieval and receive ranked evidence with provenance.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to search technical document collections using hybrid BM25 and embedding retrieval, returning cited page-level passages to support grounded, evidence-based answers.MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to query upstream documentation through a single search tool, backed by a bundled sample corpus, Vertex AI Search, or an SSH endpoint, returning cited source passages and refusing when nothing relevant is found.1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients such as Claude Code and Cursor to search a documentation corpus, read specific pages, and locally ask grounded questions with verified citations over stdio or Streamable HTTP.MIT