dockerized-mcp-server-template

dockerized-mcp-server-template

3.2

If you are the rightful owner of dockerized-mcp-server-template 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.

This repository provides a reusable template for a Python server implementing the Model Context Protocol (MCP), running in a Docker container and utilizing Streamable HTTP for real-time communication.

The Dockerized MCP Server Template is designed to facilitate the deployment of a Model Context Protocol (MCP) server within a Docker container. This template leverages the Python implementation of MCP to enable seamless integration with Large Language Models (LLMs). By utilizing Streamable HTTP, the server supports real-time communication in a stateless manner, making it suitable for serverless architectures and standard web infrastructure. The template includes a simple project structure with a Dockerfile, requirements.txt, and server.py script, along with a docker-compose.yml file for easy setup. Users can choose to run the server either within a Docker container or directly using Python, providing flexibility in deployment. The template also includes an example MCP tool function, demonstrating how to expose functionality to LLM applications securely and efficiently.

Features

  • Dockerized Deployment: Easily deploy the MCP server using Docker for consistent and isolated environments.
  • Streamable HTTP: Utilizes stateless Streamable HTTP for real-time communication, enhancing compatibility with serverless architectures.
  • Python MCP Implementation: Built on the Python implementation of MCP, ensuring easy integration with LLMs.
  • Flexible Setup: Offers both Docker and direct Python execution options for versatile deployment.
  • Example MCP Tool: Includes a sample tool function to demonstrate MCP client requests.

Tools

  1. add tool

    An example tool for calculating the sum of two numbers