remote-mcp-server

CampbellJohn/remote-mcp-server

3.2

If you are the rightful owner of remote-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.

A simple client-server application using the MCP (Model Context Protocol) framework with Docker containerization.

Tools
  1. Hello World

    A simple greeting tool that returns a hello message.

  2. Calculator

    Performs basic arithmetic operations.

Remote MCP Server

A simple client-server application using the MCP (Model Context Protocol) framework with Docker containerization.

Project Overview

This project demonstrates a simple MCP server with client connectivity. The server exposes tools that can be called remotely by the client. The entire application is containerized using Docker for easy deployment and consistent environments.

Features

  • MCP Server: Exposes API endpoints as tools that can be called remotely
  • MCP Client: Connects to the server and calls the available tools
  • Modular Tool Architecture: Server tools are organized in separate files for better maintainability
  • Docker Support: Both client and server are containerized
  • Docker Compose: Easy orchestration of the client and server containers

Example Tools

Hello World

A simple greeting tool that returns a hello message.

Parameters:

  • name (string): The name to greet

Returns:

  • A greeting message string

Calculator

Performs basic arithmetic operations.

Parameters:

  • operation (string): The operation to perform (add, subtract, multiply, divide)
  • a (float): First number
  • b (float): Second number

Returns:

  • A dictionary containing the operation and result

Getting Started

Prerequisites

  • Docker and Docker Compose
  • Python 3.12 (if running locally)

Running with Docker

  1. Clone the repository:

    git clone <repository-url>
    cd remote-mcp-server
    
  2. Build and run the containers:

    docker-compose up --build
    
  3. The server will be available at http://localhost:8000/mcp

Running Locally

Server
  1. Navigate to the server directory:

    cd server
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Run the server:

    python server.py
    
Client
  1. Navigate to the client directory:

    cd client
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Run the client:

    python client.py
    

Adding New Tools

To add a new tool to the server:

  1. Create a new Python file in the server/tools directory
  2. Define a register_tool function that takes a server parameter
  3. Use the server decorator to define your tool
  4. Import and register your tool in server/tools/__init__.py

Example:

# server/tools/new_tool.py
from mcp.server.fastmcp import Context

def register_tool(server):
    @server.tool(
        name="new_tool",
        description="Description of the new tool"
    )
    def new_tool(param1: str, param2: int, ctx: Context) -> dict:
        # Tool implementation
        return {"result": "some result"}

Then update __init__.py:

from . import new_tool

def register_all_tools(server):
    # ... existing tools
    new_tool.register_tool(server)

License

Copyright (c) 2025 John Campbell