purunep/streamable-http-mcp-server
If you are the rightful owner of streamable-http-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project is a sample MCP server for food recipes, utilizing streamable HTTP transport.
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.
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 file for details.