Skip to content

Real-time conversational chatbot using Streamable HTTP, Semantic Kernel, and Azure OpenAI to discover and serve food recipes via an MCP server.

License

Notifications You must be signed in to change notification settings

purunep/streamble-http-mcp-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Food Recipe Client

This project is a conversational chatbot that helps users find food recipes, search by ingredients, and get detailed cooking instructions. It leverages Microsoft Semantic Kernel, Azure OpenAI, and a custom MCP (Model Context Protocol) server for food recipes.

This client is designed to work with the streamable-http-mcp-server.


UI Example

You can also build a web-based UI to chat with the MCP server, providing a more interactive experience. The UI can help users:

  • Find recipes by name
  • Suggest recipes based on ingredients
  • Get detailed cooking instructions
  • Show all available recipes

Below is an example of such a UI in action:

Food Recipes UI Example


Features

  • Conversational chatbot interface
  • Uses Azure OpenAI for natural language understanding
  • Integrates with a Food Recipe MCP server via HTTP
  • Supports:
    • Listing all available recipes
    • Searching recipes by ingredients
    • Searching recipes by name
    • Providing user-friendly, formatted responses

Prerequisites

  • Python 3.8+
  • Azure OpenAI resource (API key, endpoint, deployment)
  • Access to a running Food Recipe MCP server

Installation

  1. Clone this repository or copy the project files.
  2. Install dependencies:
    pip install -r requirements.txt

Configuration

Create a .env file in the project directory with the following variables:

AZURE_OPENAI_API_KEY=your-azure-openai-api-key
AZURE_OPENAI_ENDPOINT=your-azure-openai-endpoint
AZURE_OPENAI_DEPLOYMENT_NAME=your-azure-openai-deployment-name
AZURE_OPENAI_API_VERSION=your-azure-openai-api-version
FOOD_MCP_SERVER_URL=http://your-mcp-server-url
  • AZURE_OPENAI_API_KEY: Your Azure OpenAI API key
  • AZURE_OPENAI_ENDPOINT: Your Azure OpenAI endpoint URL
  • AZURE_OPENAI_DEPLOYMENT_NAME: The deployment name for your Azure OpenAI model
  • AZURE_OPENAI_API_VERSION: The API version (e.g., 2024-02-15-preview)
  • FOOD_MCP_SERVER_URL: The URL of your Food Recipe MCP server

Usage

Run the chatbot with:

python foodRecipeClient.py

You will see:

Welcome to the Food Recipe chat bot!
  Type 'exit' to exit.

Type your questions or requests, such as:

  • "Show me all recipes."
  • "What can I cook with chicken and rice?"
  • "Find a recipe called 'Spaghetti Bolognese'."

Type exit to quit the chat.

How It Works

  • The chatbot uses Azure OpenAI to interpret user input and decide when to call MCP tools.
  • The following MCP tools are available:
    1. get_recipes: List all recipes
    2. search_recipe_by_ingredients: Find recipes by ingredients
    3. get_recipe_by_name: Find a recipe by its name
  • The bot always uses these tools for accurate information and never makes up recipes.
  • Responses are formatted for readability, and ingredient matches are explained.

Project Structure

  • foodRecipeClient.py: Main chatbot client
  • requirements.txt: Python dependencies
  • pyproject.toml: Project metadata

Troubleshooting

  • Ensure all environment variables are set in .env.
  • Make sure your Azure OpenAI and MCP server credentials are correct.
  • If you encounter import errors, check that all dependencies are installed.

License

This project is licensed under the MIT License. You are free to use, modify, fork, or improve this project as you wish.

See the LICENSE file for full license text.

About

Real-time conversational chatbot using Streamable HTTP, Semantic Kernel, and Azure OpenAI to discover and serve food recipes via an MCP server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages