Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

mcp-agent-langchainjs

> AI 编程
Open source

Serverless AI agent using LangChain.js and Model Context Protocol (MCP) integration to order burgers from a burger restaurant

193 stars0 likes1 views
WebsiteGitHub

About

Serverless AI agent using LangChain.js and Model Context Protocol (MCP) integration to order burgers from a burger restaurant

[!IMPORTANT] Follow the full-length workshop to learn how we built this sample.

Overview

This project demonstrates how to build AI agents that can interact with real-world APIs using the Model Context Protocol (MCP). It features a complete burger ordering system with a serverless API, web interfaces, and an MCP server that enables AI agents to browse menus, place orders, and track order status. The agent uses LangChain.js to handle LLM reasoning and tool calling. The system consists of multiple interconnected services, as detailed in the Architecture section below.

The system is hosted on Azure Static Web Apps (web apps) and Azure Functions (API and MCP servers), with Azure Cosmos DB for NoSQL for data storage. You can use it as a starting point for building your own AI agents.

[!TIP] You can test this application locally without deployment needed or any cloud costs. The MCP server also works with popular AI tools like GitHub Copilot, Claude, and other MCP-compatible clients. Follow the instructions in the Local Development section to get started.

Key features

  • LangChain.js agent with tool calling via MCP (Streamable HTTP transport)
  • Multi-service, end‑to‑end architecture (web UIs, APIs, MCP server)
  • User authentication with sessions history
  • 100% serverless architecture, for cost-effective scaling
  • Single-command deployment using Infrastructure as Code (IaC)

Architecture

Building AI applications can be complex and time-consuming, but using LangChain.js and Azure serverless technologies allows to greatly simplify the process. This application is a AI agent that can be access through different interfaces (web app, CLI) and that can call tools through MCP to interact with a burger ordering API.

The application is made from these main components:

Component Folder Purpose
Agent Web App packages/agent-webapp Chat interface + conversation rendering
Agent API packages/agent-api LangChain.js agent + chat state + MCP client
Burger API packages/burger-api Core burger & order management web API
Burger MCP Server packages/burger-mcp Exposes burger API as MCP tools
Burger Web App packages/burger-webapp Live orders visualization
Infrastructure infra Bicep templates (IaC)

Additionally, these optional and support components are included:

Component Folder Purpose
Beer MCP Server packages/beer-mcp AI-powered beer recommendations via hybrid RAG
Agent CLI packages/agent-cli Command-line interface LangChain.js agent and MCP client
Data generation packages/burger-data Scripts to (re)generate burgers data & images

Getting started

There are multiple ways to get started with this project. The quickest way is to use GitHub Codespaces that provides a preconfigured environment for you. Alternatively, you can set up your local environment following the instructions below.

Use GitHub Codespaces

You can run this project directly in your browser by using GitHub Codespaces, which will open a web-based VS Code: Use a VSCode dev container

A similar option to Codespaces is VS Code Dev Containers, that will open the project in your local VS Code instance using the Dev Containers extension.

You will also need to have Docker installed on your machine to run the container. Use your local environment

You need to install following tools to work on your local machine:

  • Node.js LTS
  • Azure Developer CLI 1.19+
  • Git
  • PowerShell 7+ (for Windows users only)
    • Important: Ensure you can run pwsh.exe from a PowerShell command. If this fails, you likely need to upgrade PowerShell.
    • Instead of Powershell, you can also use Git Bash or WSL to run the Azure Developer CLI commands.

Then you can get the project code:

  1. Fork the project to create your own copy of this repository.

  2. On your forked repository, select the Code button, then the Local tab, and copy the URL of your forked repository.

  3. Open a terminal and run this command to clone the repo: git clone

Deploy to Azure

Prerequisites

  • Azure account: If you're new to Azure, get an Azure account for free to get free Azure credits to get started
  • Azure account permissions: Your Azure account must have Microsoft.Authorization/roleAssignments/write permissions, such as Role Based Access Control Administrator, User Access Administrator, or Owner

Deploy with Azure Developer CLI

  1. Open a terminal and navigate to the root of the project
  2. Authenticate with Azure by running azd auth login
  3. Run azd up to deploy the application to Azure. This will provision Azure resources and deploy all services
    • You will be prompted to select a base location for the resources
    • The deployment process will take a few minutes

Once deployment is complete, you'll see the URLs of all deployed services in the terminal.

[!IMPORTANT] If you're using an Azure for Students or Free Trial account that you just created, you need to run the following command before running azd up or else the deployment will fail:

bash
azd env set AZURE_OPENAI_MODEL_CAPACITY 1

This ensures that the resources deployed will fit within the free tier limits. This limitations reduce the capacity for AI models usage, so you'll also have to provide another OpenAI endpoint to use the application properly. To do that, use the following commands to set the OpenAI endpoint, API key and model you want to use:

bash
azd env set AZURE_OPENAI_ALT_ENDPOINT 
azd env set AZURE_OPENAI_API_KEY 
azd env set AZURE_OPENAI_MODEL 

You can for example use the free GitHub Models for this, or any other OpenAI compatible endpoint.

Cost estimation

Pricing varies per region and usage, so it isn't possible to predict exact costs for your usage. However, you can use the Azure pricing calculator with pre-configured estimations to get an idea of the costs: Azure Pricing Calculator.

Clean up resources

To clean up all the Azure resources created by this sample:

bash
azd down --purge

Use Ollama for local development

If you have a machine with enough resources, you can run this sample entirely locally without using any cloud resources. To do that, you first have to install Ollama and then run the following commands to download a model on your machine:

bash
ollama pull qwen3:8b

[!TIP] If you have a powerful machine with enough memory, you can try using gpt-oss:20b instead to get better results.

After that create a .env file in the root of the project with the following content:

env
AZURE_OPENAI_API_ENDPOINT="http://localhost:11434/v1"
AZURE_OPENAI_MODEL="qwen3:8b"
AZURE_OPENAI_API_KEY="__not_used__"

You can now continue to the run locally section to start the application.

[!NOTE] Local models may not work as well as cloud-hosted models, and may even fail to respond for some complex requests. This is a limitation of the local models and not of the application itself.

Run locally

After setting up your environment and either provisioned the Azure resources or set up Ollama, you can run the entire application locally:

bash
# Install dependencies for all services
npm install

# Start all services locally
npm start

Starting the different services may take some time, you need to wait until you see the following message in the terminal: All services ready

This will start:

  • Agent Web App: http://localhost:4280
  • Agent API: http://localhost:7072
  • Burger Web App: http://localhost:5173
  • Burger API: http://localhost:7071
  • Burger MCP Server: http://localhost:3000

[!NOTE] When running locally without having deployed the application, the servers will use in-memory storage, so any data will be lost when you stop the servers. After a successful deployment, the servers will use Azure Cosmos DB for persistent storage.

You can then open the Agent web app and ask things like:

  • What spicy burgers do you have?
  • Order two Classic Cheeseburgers with extra bacon.
  • Show my recent orders

The agent will decide which MCP tool(s) to call, then come up with a response.

Available scripts

This project uses npm workspaces to manage multiple packages in a single repository. You can run scripts from the root folder that will apply to all packages, or you can run scripts for individual packages as indicated in their respective README files.

Common scripts (run from repo root):

Action Command
Start everything npm start
Build all npm run build
Lint npm run lint
Fix lint npm run lint:fix
Format npm run format

MCP tools

The Burger MCP server provides these tools for AI agents:

Tool Name Description
get_burgers Get a list of all burgers in the menu
get_burger_by_id Get a specific burger by its ID
get_toppings Get a list of all toppings in the menu
get_topping_by_id Get a specific topping by its ID
get_topping_categories Get a list of all topping categories
get_orders Get a list of all orders in the system

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptagentaiapiazd

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.