To demonstrate the power of Model Context Protocol (MCP) in real-world enterprise AI, I recently ran a loan underwriting pipeline that combines:
- MCP for tool-style interaction between LLMs and services
- LangGraph to orchestrate multi-step workflows
- Amazon SageMaker to securely host the LLM
- FastAPI to serve agents with modular endpoints
What Is LangGraph?
LangGraph is a framework for orchestrating multi-step, stateful workflows across LLM-powered agents.
๐ Graph-based execution engine: It lets you define agent workflows as nodes in a graph, enabling branching, retries, and memory โ perfect for multi-agent AI systems.
๐ Seamless tool and state handling: It maintains structured state across steps, making it easy to pass outputs between agents like Loan Officer โ Credit Analyst โ Risk Manager.
Each agent doesnโt run in isolation โ theyโre stitched together with LangGraph, a framework that lets you:
โ Define multi-agent workflows
โ Handle flow control, retries, state transitions
โ Pass structured data from one agent to the next
Hereโs how it works โ and why itโs a powerful architectural pattern for decision automation
๐งพ The Use Case: AI-Driven Loan Underwriting
Loan underwriting typically involves:
- Reviewing applicant details
- Evaluating creditworthiness
- Making a final approval or denial decision
In this architecture, each role is performed by a dedicated AI agent:
- Loan Officerโ Summarizes application details
- Credit Analystโ Assesses financial risk
- Risk Manager โ Makes the final decision
๐งฑ Architecture Overview
This workflow is powered by a centralized LLM, hosted on Amazon SageMaker, with each agent deployed as an **MCP server on EC2 and orchestrated via LangGraph:
Workflow Steps:
- User submits loan details (e.g., name, income, credit score)
- MCP client routes the request to the Loan Officer MCP server
- Output is forwarded to the Credit Analyst MCP server
- Result is passed to the Risk Manager MCP server
- A final prompt is generated, processed by the LLM on SageMaker, and sent back to the user
I have used below model for the execution
- Model:
Qwen/Qwen2.5-1.5B-Instruct
- Source: Hugging Face
- Hosted on: Amazon SageMaker (Hugging Face LLM Inference Container)
Image credit: "AWS"
๐ Want to Try It?
- ๐ Official AWS Blog
Top comments (0)