A demonstration of using Model Context Protocol (MCP) to expose a restaurant interaction tool that integrates with LangChain.
restaurant_mcp.py– MCP server exposing restaurant-related tools.restaurant_data.py– Mock dataset (restaurant listings and menus).mcp_client.py– Python client to connect and call MCP server tools.requirements.txt– Python dependencies for server & client..env– Environment variables files, will have you OPENAI_API_KEY
-
Clone and install dependencies
git clone https://github.com/pk-pkulkarni/langchain_mcp.git cd langchain_mcp pip install -r requirements.txt -
Run the MCP server Open a terminal and start the server:
python restaurant_mcp.py
restaurant_mcp.py is running as a server in your terminal before proceeding.
- Run the client(For testing)
In a separate terminal, run:
python mcp_client.py- Run FastAPI Server
Run File with uvicorn:
uvicorn mcp_client_api_chatbot:app --reload --port 8000- Open chatbot.html
Examples:
Give me veg menu
Give me all soups