CampbellJohn/remote-mcp-server
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.
Hello World
A simple greeting tool that returns a hello message.
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 numberb
(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
-
Clone the repository:
git clone <repository-url> cd remote-mcp-server
-
Build and run the containers:
docker-compose up --build
-
The server will be available at
http://localhost:8000/mcp
Running Locally
Server
-
Navigate to the server directory:
cd server
-
Install dependencies:
pip install -r requirements.txt
-
Run the server:
python server.py
Client
-
Navigate to the client directory:
cd client
-
Install dependencies:
pip install -r requirements.txt
-
Run the client:
python client.py
Adding New Tools
To add a new tool to the server:
- Create a new Python file in the
server/tools
directory - Define a
register_tool
function that takes a server parameter - Use the server decorator to define your tool
- 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