Build a Fast, Accurate Overseas Logistics Pricing Assistant Using AI and Serverless
This article presents a detailed case study of how a manufacturing company replaced manual Excel‑based overseas logistics price lookups with an AI‑driven, serverless solution built on Amazon Bedrock AgentCore, Kiro, and Amazon Quick Suite, achieving rapid, precise quotations while eliminating operational overhead.
Business background and pain points – A leading office‑supplies supplier’s international division processes a large volume of weekly overseas‑warehouse logistics price queries across multiple carriers (USPS, FedEx‑HFG, FedEx‑QFG, FedEx‑JFG, GOFO Parcel, GOFO Ground, UNIUNI). The existing Excel‑based workflow requires staff to compare up to seven sheets, manually verify effective dates, and manually assemble reports, leading to days of effort, frequent errors, and difficulty selecting the optimal channel.
Technical solution selection – The team chose a serverless stack comprising Kiro (an AI‑driven integrated development environment), Amazon Bedrock AgentCore (enterprise‑grade AI agent runtime), and Amazon Quick Suite (a fully managed AI assistant). This combination enables rapid code generation, zero infrastructure management, and natural‑language interaction for business users.
SaaS delivery model – Business users interact with the solution through Quick Suite’s chat UI, while the underlying MCP (Model Context Protocol) server is hosted on AgentCore. Kiro automatically generates production‑grade TypeScript code, unit tests, and deployment artifacts, allowing the entire solution to be launched in 3‑5 working days without dedicated IT resources.
Core capabilities – The assistant provides four key functions: (1) Intelligent query – natural‑language input of item dimensions and zone; (2) Automatic comparison – AI traverses all carrier sheets to find the lowest price; (3) Validity check – filters out expired quotations; (4) One‑click report generation – creates a standardized Excel file, uploads it to Amazon S3, and returns a presigned download URL.
System architecture – The solution consists of five components: Amazon Quick Suite (chat interface), Amazon Cognito (OAuth 2.0 token service), Amazon Bedrock AgentCore (serverless runtime), Excel MCP Server (Python service built on excel‑mcp‑server), and Amazon S3 (storage for generated workbooks). The architecture diagram (see images) shows the flow of requests and data between these services.
Request processing flow – 1) The user enters dimensions in Quick Suite; 2) Quick Suite obtains an OAuth 2.0 access token from Cognito (client‑credentials grant); 3) Quick Suite calls the AgentCore MCP endpoint (/invocations) with the token; 4) AgentCore validates the token and invokes the create_workbook_and_upload tool; 5) The tool creates an Excel workbook with openpyxl, uploads it to S3, generates a presigned URL, and returns the URL; 6) The user clicks the link to download the report.
Implementation details – The Python MCP server patches logging.FileHandler to redirect logs from /var/ to /tmp/ (required because AgentCore’s filesystem is read‑only). Environment variables define EXCEL_FILES_PATH, S3_BUCKET, and URL expiry. A FastMCP instance is created with stateless_http=True. Three tools are registered: upload_to_s3_and_get_download_url – uploads an existing file and returns a JSON response with the presigned URL. list_excel_files – enumerates files in the working directory. create_workbook_and_upload – creates a workbook, optionally writes data, uploads it, and returns the download link.
import logging
_original_file_handler_init = logging.FileHandler.__init__
def _patched_file_handler_init(self, filename, mode="a", encoding=None, delay=False, errors=None):
if filename.startswith("/var/"):
filename = "/tmp/" + os.path.basename(filename)
print(f"[PATCH] Redirecting log file to: {filename}", flush=True)
_original_file_handler_init(self, filename, mode, encoding, delay, errors)
logging.FileHandler.__init__ = _patched_file_handler_initThe deployment YAML ( .bedrock_agentcore.yaml) specifies a direct‑code deployment, Python 3.11 runtime, ARM64 platform, Cognito authorizer configuration (using allowedClients instead of allowedAudience), and the necessary IAM role for S3 access.
default_agent: excel_mcp_oauth
agents:
excel_mcp_oauth:
name: excel_mcp_oauth
entrypoint: mcp_server.py
deployment_type: direct_code_deploy
runtime_type: PYTHON_3_11
platform: linux/arm64
aws:
execution_role: arn:aws:iam::***:role/AmazonBedrockAgentCoreSDKRuntime-***
region: us-east-1
authorizer_configuration:
customJWTAuthorizer:
discoveryUrl: https://cognito-idp.us-east-1.amazonaws.com/{user-pool-id}/.well-known/openid-configuration
allowedClients:
- {your-client-id}Best‑practice notes and troubleshooting –
Patch logging before importing third‑party libraries to avoid startup failures.
Combine workbook creation and S3 upload into a single atomic tool to work around AgentCore’s stateless execution model.
Set stateless_http=True when creating the FastMCP instance.
When AgentCore requires OAuth, use curl or a custom HTTP client to set the Authorization header, because the AWS CLI cannot forward a bearer token.
Configure Cognito discovery URL correctly (include .well-known/openid-configuration suffix) and use allowedClients instead of allowedAudience to avoid audience‑validation errors.
Be aware that S3 Content‑Disposition does not support non‑ASCII characters; encode filenames with RFC 5987.
After deploying a new MCP version, refresh Quick Suite’s action list because it caches tool definitions.
Cost analysis – For a scenario with 10 monthly users and 90 MCP invocations, the estimated monthly cost is: Quick Suite subscription ($20 × 10 = $200) + base infrastructure ($250) + AgentCore runtime ($0.11) + Cognito M2M ($0.20), demonstrating a low‑cost, pay‑as‑you‑go model.
Conclusion – By leveraging AI‑driven code generation (Kiro), serverless AI agents (AgentCore), and managed authentication (Cognito), the team transformed a labor‑intensive Excel lookup process into an automated, accurate, and zero‑ops pricing assistant. The methodology showcases how serverless AI can accelerate digital transformation in manufacturing and logistics, delivering rapid time‑to‑value, scalability, and cost efficiency.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Amazon Cloud Developers
Official technical community of Amazon Cloud. Shares practical AI/ML, big data, database, modern app development, IoT content, offers comprehensive learning resources, hosts regular developer events, and continuously empowers developers.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
