mcpField
A
AWS Bedrock MCP Client and Server

AWS Bedrock MCP Client and Server

Local
github.com/sverzeCloud & Infra1Updated 73w ago

About AWS Bedrock MCP Client and Server

This Spring Boot application connects Amazon Bedrock models with MCP tools through a REST API. It is intended for applications that need tool-using model queries and can be deployed as an AWS Lambda function behind API Gateway.

Key features

  1. 01REST API for Amazon Bedrock queries
  2. 02MCP tools for calculations and weather
  3. 03Web page retrieval and Markdown conversion
  4. 04Multi-tool handling for complex queries
  5. 05AWS Lambda deployment behind API Gateway

Use cases

  1. 01Ask Bedrock to calculate values using tools
  2. 02Retrieve weather for a location
  3. 03Summarize a web page through a model query

MCP support

The application includes an MCP client and server: the client uses MCP tools while interacting with Amazon Bedrock, and the server provides calculation, weather, and web page retrieval tools.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

AWS Bedrock MCP Client and Server

A Spring Boot application that serves as a client for the Model Context Protocol (MCP), enabling interaction with Amazon Bedrock AI models with tool-using capabilities.

Application Overview

This application provides a REST API for:

  • Communicating with Amazon Bedrock models
  • Using MCP tools for calculations, weather information, and web page retrieval
  • Handling complex AI queries that might require multiple tools
  • The application runs as an AWS Lambda function behind API Gateway, making it serverless and scalable.

Prerequisites

  • Java 21 or later
  • Maven 3.8+
  • AWS CLI configured with appropriate credentials
  • AWS CDK installed (npm install -g aws-cdk)
  • Weather API key from https://www.weatherapi.com/my/

Environment Setup

Clone the Repository
git clone https://github.com/sverze/aws-bedrock-mcp-client-server
cd aws-bedrock-mcp-client-server
Configure AWS

You will credentials that has priviledges to the following services

  • Lambda
  • API Gateway
  • Bedrock
  • Bedrock Model Anthropic Sonnet 4.0

To configure local credentials run the following command:

aws configure

###Building the Application

The project follows a multi-module Maven structure. To build all modules run this from the parent directory:

mvn clean package install -DWEATHER_API_KEY=<your_api_key_here>

This will build all modules in the correct order:

  • aws-bedrock-mcp-server
  • aws-bedrock-mcp-client
  • aws-bedrock-mcp-client-server-cdk
Deploying to AWS

The AWS deployment is managed using AWS CDK. To deploy the application, run the following commands:

cd aws-bedrock-mcp-client-server-cdk
cdk bootstrap
cdk deploy --context WEATHER_API_KEY=<your_api_key_here>

After deployment completes, CDK will output the API Gateway URL in the terminal. You will need this URL to interact with the API and perform the tests below.

Testing the API

Once deployed, you can test the API endpoints using curl or a tool like Postman:

  1. Test the Hello World endpoint

    curl https://<your-api-id>.execute-api.<region>.amazonaws.com/prod/hello
    

    Expected response: Hello World from MCP Client!

  2. List available tools

    curl https://<your-api-id>.execute-api.<region>.amazonaws.com/prod/tools
    
  3. Perform a calculation

    curl -X POST "https://<your-api-id>.execute-api.<region>.amazonaws.com/prod/calculate?operation=add&a=5&b=3"
    
  4. Get weather information

    curl -X POST "https://<your-api-id>.execute-api.<region>.amazonaws.com/prod/weather?location=New%20York&format=celsius"
    
  5. Convert a web page to markdown

    curl -X POST "https://<your-api-id>.execute-api.<region>.amazonaws.com/prod/webpage?url=https://example.com"
    
  6. Make a complex query - The Weather

    curl -X POST "https://<your-api-id>.execute-api.<region>.amazonaws.com/prod/query?query=What%20is%20the%20weather%20in%20London%20and%20calculate%2045%20divided%20by%209"
    
  7. Make a complex query - Summarise a Webpage

    curl -X POST "https://<your-api-id>.execute-api.<region>.amazonaws.com/prod/query?query=Summarise%20the%20following%20webpage%20https://example.com"
    

Monitoring and Logs

View application logs in CloudWatch Logs:

  • Navigate to AWS CloudWatch console
  • Check the /aws/lambda/McpClientServerFunction log group

Clean Up

To remove all deployed resources:

cd aws-bedrock-mcp-client-server-cdk
cdk destroy

Architecture

This application implements a serverless architecture:

  • API Gateway serves as the HTTP endpoint
  • AWS Lambda runs the Spring Boot application
  • Amazon Bedrock provides the AI model capabilities
  • MCP Server provides tool implementations
  • The AWS CDK stack creates and configures all the necessary AWS resources, including IAM roles with appropriate permissions for accessing Amazon Bedrock.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.