MCP on AWS Bedrock
Facilitates interaction with AWS Bedrock-enabled tools by implementing Anthropic's Model Context Protocol for seamless tool integration and communication.
Facilitates interaction with AWS Bedrock-enabled tools by implementing Anthropic's Model Context Protocol for seamless tool integration and communication.
A simple and clear example for implementation and understanding Anthropic MCP (on AWS Bedrock).
This project demonstrates how to implement and use Anthropic's Model Context Protocol (MCP) with AWS Bedrock. It provides a client implementation that can interact with MCP-enabled tools through AWS Bedrock's runtime service.
client_stdio.py
: Main client implementation for interacting with Bedrock and MCP tools using stdio modeclient_sse.py
: Main client implementation for interacting with Bedrock and MCP tools using sse modemcp_simple_tool/
: Directory containing the MCP tool implementationserver.py
: MCP tool server implementation__main__.py
: Entry point for the toolpyproject.toml
: Project dependencies and configurationRun the stdio client with:
uv pip install boto3
uv run client_stdio.py
The client will: 1. Initialize a connection to AWS Bedrock 2. Start the MCP tool server 3. List available tools and convert them to the format required by Bedrock 4. Handle communication between Bedrock and the MCP tools
Run the sse client with:
# server
uv pip install boto3 uvicorn
uv run mcp-simple-tool --transport sse --port 8000
# client
uv run client_sse.py
Feel free to submit issues and pull requests to improve the implementation.
MIT License
[
{
"description": "Fetches a website and returns its content",
"inputSchema": {
"properties": {
"url": {
"description": "URL to fetch",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"name": "fetch"
}
]