Skip to content

purunep/streamable-http-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streamable HTTP MCP Server

This project is a sample MCP (Model Context Protocol) server for food recipes, using streamable HTTP transport. It provides endpoints to fetch all recipes, search recipes by ingredients, and get a recipe by name.

Prerequisites

  • Python 3.13 or higher
  • pip (Python package manager)

Setup Instructions

1. Clone the Repository

Clone or download this repository and navigate to the project directory:

cd examples/mcp/streamable-http/mcp-server

2. Create and Activate a Virtual Environment

It is recommended to use a virtual environment to manage dependencies:

On Windows (PowerShell):

python -m venv venv
.\venv\Scripts\Activate.ps1

On macOS/Linux:

python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

Install the required packages using pip:

pip install -r requirements.txt

4. Run the Server

Start the MCP server:

python foodRecipeServer.py

The server will start on http://0.0.0.0:8001 using streamable HTTP transport.

Usage

You can interact with the server using HTTP requests or via the MCP protocol. The following tools are available:

  • get_recipes: Get all available food recipes.
  • search_recipe_by_ingredients: Search for recipes by providing a list of ingredients.
  • get_recipe_by_name: Get a specific recipe by its name.

Example Request (using curl)

Get all recipes:

curl -H "Accept: text/event-stream" http://localhost:8001/mcp/tool/get_recipes

Notes

  • Make sure the recipes/FoodRecipes.json file exists and contains valid recipe data.
  • For development, always use a virtual environment to avoid dependency conflicts.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Real-time MCP server using Streamable HTTP for AI-powered chatbots and tools.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages