Skip to main content
Glama

MCP MCPO Demo Server

by mkamranr

MCP with MCPO Demo

This repository demonstrates how to build and run MCP (Model Context Protocol) tools using MCPO.
We'll cover everything from setup to creating sample tools and running the MCP server.


What is MCP?

MCP (Model Context Protocol) is a standard protocol that allows LLMs (like GPT, Claude, etc.) to interact with external tools, databases, and APIs efficiently.


What is MCPO?

MCPO is the official MCP Orchestrator, which manages your MCP servers and tools.
It allows your LLM to auto-discover available tools and decide when to call them.


1. Prerequisites

  • Python 3.11+
  • uv (Recommended for virtual environment management)
  • Git

2. Setup Instructions

Step 1 — Clone the Repository

git clone https://github.com/mkamranr/mcp-mcpo.git cd mcp-mcpo

Step 2 — Create Virtual Environment

uv venv --python 3.11

Activate the environment:

Linux / Mac:

source .venv/bin/activate

Windows (PowerShell):

.venv\Scripts\activate

Step 3 — Install Dependencies

uv pip install fastmcp mcpo

Or:

uv pip install -r requirements.txt

3. Project Structure

MCP-MCPO/ ├── tools/ │ ├── hello_world.py │ ├── reverse_string.py ├── server.py ├── requirements.txt ├── .gitignore └── README.md

4. MCP Tools

4.1 Hello World Tool (tools/hello_world.py)

from fastmcp import tool @tool() def hello_world(): """Simple Hello World tool.""" return {"message": "Hello World from MCP!"}

4.2 Reverse String Tool (tools/reverse_string.py)

from fastmcp import tool @tool() def reverse_string(text: str): """Takes a string and returns its reverse.""" return {"reversed": text[::-1]}

5. MCP Server (server.py)

from fastmcp import FastMCP from tools.hello_world import hello_world from tools.reverse_string import reverse_string mcp_server = FastMCP("mcp-demo-server") mcp_server.tool()(hello_world) mcp_server.tool()(reverse_string)

6. Running the Server

mcpo --host 0.0.0.0 --port 8000 -- fastmcp run server.py:mcp_server

If you want to run mcpo on https

mcpo --host 0.0.0.0 --port 8000 --ssl-keyfile /path/to/key.key --ssl-certfile /path/to/cert.crt -- fastmcp run server.py:mcp_server

7. Testing Tools

Hello World:

curl -X POST http://127.0.0.1:8000/tools/hello_world

Response:

{ "message": "Hello World from MCP!" }

Reverse String:

curl -X POST http://127.0.0.1:8000/tools/reverse_string -H "Content-Type: application/json" -d '{"text":"MCP Demo"}'

Response:

{ "reversed": "omeD PCM" }

License

MIT License © 2025

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

A demonstration MCP server that provides basic utility tools including hello world functionality and string reversal operations. Shows how to build and deploy MCP tools using the MCPO orchestrator framework.

  1. What is MCP?
    1. What is MCPO?
      1. 1. Prerequisites
        1. 2. Setup Instructions
          1. Step 1 — Clone the Repository
          2. Step 2 — Create Virtual Environment
          3. Step 3 — Install Dependencies
        2. 3. Project Structure
          1. 4. MCP Tools
            1. 4.1 Hello World Tool (tools/hello_world.py)
            2. 4.2 Reverse String Tool (tools/reverse_string.py)
          2. 5. MCP Server (server.py)
            1. 6. Running the Server
              1. 7. Testing Tools
                1. Hello World:
                2. Reverse String:
              2. License

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/mkamranr/mcp-mcpo'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server