mcp-streaming-msk-bedrock
Integrates with Amazon MSK and Bedrock Agents to enable real-time streaming of log events and AI-driven analysis.
Click on "Install 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., "@mcp-streaming-msk-bedrockanalyze recent log stream for error spikes and suggest remediation"
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.
MCP Streaming Demo — Amazon MSK + Bedrock Agents
A working demo of Streaming MCP (Model Context Protocol) on AWS — pushing real-time context to a Bedrock-powered AI agent using Amazon MSK, WebSockets, and IAM authorization.
Based on mcp-streaming-demo, adapted to use managed AWS services.
Architecture
log_simulator.py → Amazon MSK (app-logs) → streaming_mcp_server.py → bedrock_agent.py
↕ WebSocket ↕
subscribe / get_anomalies Bedrock Claude
(invoke_model)
Lambda (Action Group) ← Bedrock Agent (managed) → MSKRelated MCP server: KafkaIQ
Components
File | Description |
| Core server — MSK consumer (IAM auth) + WebSocket push |
| AI agent — subscribes to stream, invokes Bedrock for analysis |
| Produces realistic log events to MSK |
| Patches for local dev without IAM auth |
| Bedrock Agent Action Group Lambda |
| OpenAPI schema for action group |
| CloudFormation — MSK Serverless + Bedrock Agent + Lambda |
| Local Kafka for development |
Prerequisites
Python 3.9+
AWS account with Bedrock model access (Claude 3 Sonnet)
AWS CLI configured with appropriate credentials
Docker (for local development)
Quick Start (Local Dev)
# 1. Start local Kafka
docker compose up -d
# 2. Install dependencies
pip install -r requirements.txt
# 3. Start server (local mode)
MSK_BOOTSTRAP=localhost:9092 python src/streaming_mcp_server.py
# 4. Start log simulator (separate terminal)
MSK_BOOTSTRAP=localhost:9092 python src/log_simulator.py
# 5. Start Bedrock agent (separate terminal)
python src/bedrock_agent.pyDeploy to AWS
# 1. Deploy infrastructure
aws cloudformation deploy \
--template-file infra/template.yaml \
--stack-name mcp-streaming-demo \
--parameter-overrides VpcId=vpc-xxx SubnetIds=subnet-aaa,subnet-bbb \
--capabilities CAPABILITY_NAMED_IAM
# 2. Get MSK bootstrap servers
aws kafka get-bootstrap-brokers --cluster-arn <ClusterArn from outputs>
# 3. Store bootstrap in SSM (used by Lambda)
aws ssm put-parameter --name /mcp-demo/msk-bootstrap --value "<bootstrap-servers>" --type String
# 4. Run server and simulator with MSK endpoint
export MSK_BOOTSTRAP="<bootstrap-servers>"
python src/streaming_mcp_server.py
python src/log_simulator.py
python src/bedrock_agent.pyKey Differences from Original
Original | This Version |
Local Kafka (Docker) | Amazon MSK Serverless |
Custom Python agent | Bedrock Agent + direct |
No auth | IAM OAUTHBEARER (MSK) + IAM roles (Bedrock) |
Manual remediation mapping | Claude-powered root cause analysis |
docker-compose only | CloudFormation IaC |
What You'll See
Normal log traffic flowing through the agent in real-time
Every ~30 seconds, an error spike hits
The agent detects the spike (>30% error rate in sliding window)
Bedrock Claude analyzes the errors and provides root cause + remediation
Teardown
# Local
docker compose down -v
# AWS
aws cloudformation delete-stack --stack-name mcp-streaming-demoThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hakohli/mcp-streaming-msk-bedrock'
If you have feedback or need assistance with the MCP directory API, please join our Discord server