MCP Hello World Example
by wubbyweb
This project demonstrates a simple implementation of the Model Context Protocol (MCP) using a Flask server and OpenAI integration. It showcases how to create an MCP server with a number addition function and a client that uses it through OpenAI's function calling.
Last updated: N/A
What is MCP Hello World Example?
This is a demonstration of the Model Context Protocol (MCP) using a Flask server and OpenAI. It includes a server that provides a simple addition function and a client that interacts with the server through OpenAI's function calling capabilities.
How to use MCP Hello World Example?
- Clone the repository. 2. Install dependencies using
pip install -r requirements.txt
. 3. Set your OpenAI API key:export OPENAI_API_KEY="your-api-key-here"
. 4. Start the MCP server:python server.py
. 5. In a separate terminal, run the client:python client.py
.
Key features of MCP Hello World Example
Flask-based MCP server
OpenAI integration
Function listing and execution
JSON schema definition
Client for function calling
Use cases of MCP Hello World Example
Demonstrating MCP implementation
Integrating with OpenAI function calling
Creating custom functions for AI models
Building AI-powered applications
Learning about server-client architecture
FAQ from MCP Hello World Example
What is MCP?
What is MCP?
MCP stands for Model Context Protocol. It's a protocol for allowing AI models to access and use external functions.
What is the purpose of this project?
What is the purpose of this project?
This project demonstrates a basic implementation of MCP using Flask and OpenAI.
What are the prerequisites for running this project?
What are the prerequisites for running this project?
You need Python 3.x and an OpenAI API key.
How do I install the dependencies?
How do I install the dependencies?
Run pip install -r requirements.txt
.
How do I run the server and client?
How do I run the server and client?
Start the server with python server.py
and the client with python client.py
in separate terminals.