MCP.so
Sign In

MCP Hello World Example

@wubbyweb

Basic information

Category

Developer Tools

Last updated

Transports

stdio

Author

wubbyweb

About MCP Hello World Example

A template project to create MCP server and client projects

MCP Hello World Example config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "MCP-template": {
      "command": "python",
      "args": [
        "server.py"
      ]
    }
  }
}

MCP Hello World Example tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is MCP Hello World Example?

MCP Hello World Example is a simple implementation of the Model Context Protocol (MCP) using a Flask server and OpenAI integration. It demonstrates how to create an MCP server that provides a number addition function and a client that can use this function through OpenAI's function calling capabilities.

How to use MCP Hello World Example?

Set your OpenAI API key, then start the MCP server with python server.py and run the client with python client.py in separate terminals. The client fetches available functions from the server, converts them to OpenAI function specifications, and demonstrates function calling by adding two numbers.

Key features of MCP Hello World Example

  • Flask-based MCP server with addition function
  • MCP protocol endpoints for function listing and execution
  • JSON schema definition for the addition function
  • Client integrates with OpenAI's chat completions API
  • Converts MCP functions to OpenAI function specifications
  • Demonstrates function calling with example output

Use cases of MCP Hello World Example

  • Learning how to implement the Model Context Protocol
  • Prototyping function calling between an MCP server and OpenAI
  • Testing basic MCP server-client communication locally
  • Demonstrating JSON schema-driven tool definition

Frequently asked questions

1

What does the server do?

The server runs on `http://localhost:8080` and provides a single `add_numbers` function via MCP protocol endpoints.

2

What are the prerequisites?

Python 3.x and an OpenAI API key are required.

3

How do I install and run it?

Clone the repository, install dependencies with `pip install -r requirements.txt`, set the `OPENAI_API_KEY` environment variable, then start the server and client.

4

What happens when I run the client?

The client connects to the MCP server, fetches available functions, starts a conversation with OpenAI's model, demonstrates function calling by adding 42 and 17, and displays the results.

5

What dependencies are used?

The project uses `python-dotenv`, `openai`, `flask`, and `requests`.

Comments

More Developer Tools MCP servers