MCP-template

MCP-template

0

This project provides a simple example of the Model Context Protocol (MCP) using a Flask server and OpenAI integration. It demonstrates the creation of an MCP server with an addition function and how a client can utilize OpenAI to call this function.

MCP Hello World Example

This project demonstrates a simple implementation of the Model Context Protocol (MCP) using a Flask server and OpenAI integration. It features a basic MCP server that provides an addition function and a client that utilizes OpenAI's function calling capabilities to demonstrate operations.

Components

  • Server: A Flask-based MCP server implementing a basic addition function and MCP endpoints.
  • Client: Integrates with OpenAI's API and demonstrates using MCP functions through chat completions.

Prerequisites

  • Python 3.x
  • OpenAI API key

Installation

  1. Clone the repository
  2. Install dependencies

Configuration

Set the OpenAI API key.

Usage

  1. Start the MCP server.
  2. Run the client in a separate terminal and witness the addition function in action.

Dependencies

  • python-dotenv
  • openai
  • flask
  • requests

Project Structure

  • README.md
  • requirements.txt
  • server.py
  • client.py

Example Output

  • Lists available MCP functions and demonstrates function execution results through OpenAI.