Skip to main content
Glama
golam74

MCP Server

by golam74

๐Ÿš€ MCP Server

Production-Ready Model Context Protocol Server Built with Python & FastMCP

A clean, modular, scalable, and Docker-ready implementation of the Model Context Protocol (MCP), designed for AI applications and developer productivity.


๐Ÿ“‘ Table of Contents

  • ๐Ÿ“– Overview

  • โœจ Features

  • ๐Ÿ— Architecture

  • ๐Ÿ“‚ Project Structure

  • ๐Ÿ›  Tech Stack

  • ๐Ÿš€ Getting Started

  • ๐Ÿณ Docker

  • โš™ Configuration

  • ๐Ÿงฉ Available Tools

  • ๐Ÿ“œ Logging

  • ๐Ÿ“Š Roadmap

  • ๐Ÿค Contributing

  • ๐Ÿ“„ License


๐Ÿ“– Overview

The MCP Server is a production-ready implementation of the Model Context Protocol (MCP) using Python and FastMCP.

This project demonstrates how to build scalable, modular, and maintainable MCP servers that can expose reusable tools for AI assistants and MCP-compatible clients.

Unlike simple examples, this repository follows a production-oriented architecture with centralized tool registration, structured logging, Docker support, and a clean project layout.

It serves as both:

  • ๐Ÿ“š A learning resource for developers exploring MCP.

  • ๐Ÿ— A solid foundation for building real-world AI tool servers.


โœจ Features

Feature

Status

FastMCP Server

โœ…

Modular Architecture

โœ…

Central Tool Registry

โœ…

Professional Logging

โœ…

Tool Execution Logs

โœ…

Docker Support

โœ…

Docker Compose

โœ…

Environment Configuration

โœ…

Easy Tool Registration

โœ…

Production Ready Structure

โœ…

Extensible Design

โœ…


๐ŸŽฏ Why This Project?

Most MCP examples available online are intentionally minimal.

This project goes beyond the basics by demonstrating:

  • Clean architecture

  • Separation of concerns

  • Modular tool development

  • Production-grade logging

  • Dockerized deployment

  • Reusable project structure

  • Scalable code organization

It is intended to be a strong starting point for developers building AI-powered applications with MCP.


๐Ÿ— Architecture

The project follows a modular architecture to keep the codebase clean, maintainable, and easy to extend.

flowchart TD

    Client["MCP Client"]
    Server["FastMCP Server"]
    Registry["Tool Registry"]
    Calculator["Calculator Tools"]
    Time["Time Tools"]
    File["File Tools"]
    System["System Tools"]
    Math["Math Tools"]
    Text["Text Tools"]
    Utility["Utility Tools"]
    Logger["Logging System"]
    Logs["Log Files"]

    Client --> Server
    Server --> Registry

    Registry --> Calculator
    Registry --> Time
    Registry --> File
    Registry --> System
    Registry --> Math
    Registry --> Text
    Registry --> Utility

    Calculator --> Logger
    Time --> Logger
    File --> Logger
    System --> Logger
    Math --> Logger
    Text --> Logger
    Utility --> Logger

    Logger --> Logs

๐Ÿ“‚ Project Structure

MCP_SERVER/
โ”‚
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ ci.yml
โ”‚
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ tools/
โ”‚   โ”‚   โ”œโ”€โ”€ math_tool.py
โ”‚   โ”‚   โ”œโ”€โ”€ text_tools.py
โ”‚   โ”‚   โ””โ”€โ”€ utility_tools.py
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ calculator.py
โ”‚   โ”œโ”€โ”€ datetime_tool.py
โ”‚   โ”œโ”€โ”€ file_reader.py
โ”‚   โ”œโ”€โ”€ logger.py
โ”‚   โ”œโ”€โ”€ log_decorator.py
โ”‚   โ”œโ”€โ”€ registry.py
โ”‚   โ”œโ”€โ”€ system_info.py
โ”‚   โ””โ”€โ”€ time_tool.py
โ”‚
โ”œโ”€โ”€ logs/
โ”‚   โ”œโ”€โ”€ error.log
โ”‚   โ””โ”€โ”€ mcp.log
โ”‚
โ”œโ”€โ”€ .dockerignore
โ”œโ”€โ”€ .env
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ CHANGELOG.md
โ”œโ”€โ”€ config.py
โ”œโ”€โ”€ CONTRIBUTING.md
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ pytest.ini
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ server.py

โš™ Project Workflow

Start Server
      โ”‚
      โ–ผ
Create FastMCP Instance
      โ”‚
      โ–ผ
Register All Tools
      โ”‚
      โ–ผ
Wait For MCP Client
      โ”‚
      โ–ผ
Receive Tool Request
      โ”‚
      โ–ผ
Execute Tool
      โ”‚
      โ–ผ
Write Logs
      โ”‚
      โ–ผ
Return Response

๐Ÿ›  Tech Stack

Technology

Purpose

๐Ÿ Python 3.11+

Programming Language

โšก FastMCP

MCP Framework

๐Ÿค– Model Context Protocol

AI Tool Communication

๐Ÿณ Docker

Containerization

๐Ÿ“ฆ Docker Compose

Local Deployment

๐Ÿ“ Logging

Monitoring & Debugging

โš™ python-dotenv

Environment Variables

๐Ÿงช Pytest

Future Testing

๐Ÿ”„ GitHub Actions

Future CI/CD


๐ŸŽฏ Design Principles

The project is built around a few core engineering principles:

  • Modular architecture

  • Single Responsibility Principle (SRP)

  • Separation of Concerns

  • Easy extensibility

  • Centralized tool registration

  • Consistent logging

  • Docker-first deployment

  • Clean project organization


๐Ÿ“ Core Modules

Module

Responsibility

server.py

Starts the MCP server

registry.py

Registers all available tools

logger.py

Configures application logging

log_decorator.py

Logs tool execution automatically

config.py

Central application configuration

calculator.py

Calculator-related tools

time_tool.py

Time and date utilities

file_reader.py

File reading tools

system_info.py

System information tools

app/tools/

Additional utility modules


๐Ÿš€ Request Lifecycle

MCP Client
     โ”‚
     โ–ผ
FastMCP Server
     โ”‚
     โ–ผ
Registry
     โ”‚
     โ–ผ
Requested Tool
     โ”‚
     โ–ผ
Execute Function
     โ”‚
     โ–ผ
Log Request
     โ”‚
     โ–ผ
Return Result

๐Ÿ“Œ Key Advantages

  • Clean folder structure

  • Easy to maintain

  • Easy to test

  • Easy to extend

  • Production-ready layout

  • Reusable architecture

  • Docker support

  • Consistent logging

  • Beginner friendly

  • Open-source friendly


๐Ÿš€ Getting Started

Follow the steps below to set up the project on your local machine.


๐Ÿ“‹ Prerequisites

Before running the project, ensure the following software is installed:

Software

Version

Python

3.11+

Git

Latest

Docker (Optional)

Latest

Docker Compose (Optional)

Latest

Verify your installation:

python --version
git --version
docker --version

๐Ÿ“ฅ Clone the Repository

git clone https://github.com/golam74/MCP_SERVER.git

Navigate to the project directory:

cd MCP_SERVER

๐Ÿ Create a Virtual Environment

Windows

python -m venv venv

Activate it:

venv\Scripts\activate

Linux / macOS

python3 -m venv venv

Activate it:

source venv/bin/activate

๐Ÿ“ฆ Install Dependencies

Upgrade pip:

python -m pip install --upgrade pip

Install project dependencies:

pip install -r requirements.txt

โš™ Environment Variables

Create a .env file in the project root.

Example:

APP_NAME=MCP Server
LOG_LEVEL=INFO

You can add additional configuration values as your project grows.


โ–ถ Run the Server

Start the MCP server:

python server.py

Expected output:

============================================================
MCP Server started successfully.
============================================================

๐Ÿณ Docker Support

Build the Docker image:

docker build -t mcp-server .

Run the container:

docker run --rm mcp-server

๐Ÿณ Docker Compose

Start the project:

docker compose up --build

Stop the project:

docker compose down

โœ… Verify Installation

Everything is configured correctly if:

  • โœ… Virtual environment is activated

  • โœ… Dependencies install successfully

  • โœ… Server starts without errors

  • โœ… Log files are created

  • โœ… Docker image builds successfully

  • โœ… Docker Compose starts correctly


๐Ÿ“„ Configuration Files

File

Description

server.py

Application entry point

config.py

Application configuration

.env

Environment variables

requirements.txt

Python dependencies

Dockerfile

Docker image

docker-compose.yml

Docker Compose configuration

README.md

Project documentation


๐Ÿ“ Logging

The server automatically creates log files inside the logs/ directory.

logs/
โ”œโ”€โ”€ mcp.log
โ””โ”€โ”€ error.log

Each tool execution is logged with:

  • Timestamp

  • Tool Name

  • Arguments

  • Result

  • Exceptions (if any)

Example:

2026-07-18 05:38:43 | INFO | Tool Started : add_numbers
2026-07-18 05:38:43 | INFO | Arguments : (10, 20)
2026-07-18 05:38:43 | INFO | Result : 30
2026-07-18 05:38:43 | INFO | Tool Finished : add_numbers

๐Ÿงฉ Available MCP Tools

The server is organized into independent tool modules, making it easy to maintain and extend.

Category

Description

โž• Calculator Tools

Basic arithmetic operations

๐Ÿ•’ Time Tools

Current date and time utilities

๐Ÿ“„ File Reader

Read text files safely

๐Ÿ’ป System Information

Operating system and hardware details

๐Ÿ”ข Math Tools

Advanced mathematical utilities

๐Ÿ“ Text Tools

String manipulation and formatting

โš™ Utility Tools

General-purpose helper utilities


๐Ÿš€ Adding a New Tool

Adding a new tool to the server requires only three simple steps.

Step 1

Create your tool inside the appropriate module.

Example:

@mcp.tool
def square(number: int) -> int:
    return number * number

Related MCP server: FastAPI MCP Server

Step 2

Register the tool inside the module.

def register_math_tools(mcp):
    ...

Step 3

Import the registration function into:

app/registry.py

and register it:

register_math_tools(mcp)

That's it!

No changes are required in server.py.


๐Ÿ’ป Example Usage

Calculator

add_numbers(10, 20)

# Output
30

Time Tool

get_current_time()

Output

10:45:23

File Reader

read_file("example.txt")

Output

Hello World

System Information

get_system_info()

Example Output

Operating System : Windows
Python Version   : 3.11
Machine          : AMD64

๐Ÿ“œ Logging

Every tool execution is automatically logged.

Logged information includes:

  • Tool Name

  • Arguments

  • Return Value

  • Exceptions

  • Timestamp

Example

2026-07-18 05:38:43 | INFO | Tool Started : add_numbers
2026-07-18 05:38:43 | INFO | Arguments : (10, 20)
2026-07-18 05:38:43 | INFO | Result : 30
2026-07-18 05:38:43 | INFO | Tool Finished : add_numbers

๐Ÿ“Š Project Status

Feature

Status

FastMCP Server

โœ…

Tool Registry

โœ…

Professional Logging

โœ…

Docker Support

โœ…

Docker Compose

โœ…

Environment Configuration

โœ…

Modular Architecture

โœ…

GitHub Repository

โœ…

Unit Tests

๐Ÿšง

GitHub Actions

๐Ÿšง


๐Ÿ—บ Roadmap

Version 1.0

  • FastMCP Server

  • Tool Registration System

  • Modular Architecture

  • Logging System

  • Docker Support

  • Docker Compose


Version 1.1

  • Unit Testing

  • GitHub Actions

  • Code Coverage

  • Better Error Handling


Version 1.2

  • Async Tools

  • More Utility Tools

  • Performance Optimization


Version 2.0

  • Authentication

  • Database Support

  • Monitoring Dashboard

  • Plugin Architecture


๐Ÿค Contributing

Contributions are always welcome!

If you'd like to improve this project, please follow these steps:

  1. Fork the repository.

  2. Create a new feature branch.

git checkout -b feature/awesome-feature
  1. Commit your changes.

git commit -m "Add awesome feature"
  1. Push your branch.

git push origin feature/awesome-feature
  1. Open a Pull Request.

Please make sure your code follows the existing project structure and coding style.


๐Ÿงช Future Improvements

The following features are planned for future releases:

  • Async MCP Tools

  • Unit & Integration Tests

  • GitHub Actions (CI/CD)

  • Code Coverage Reports

  • Performance Benchmarking

  • Authentication & Authorization

  • Database Integration

  • Plugin Architecture

  • Monitoring Dashboard

  • API Documentation


๐Ÿ“ˆ Project Goals

This repository is designed to serve as:

  • ๐Ÿ“š A learning resource for developers exploring MCP.

  • ๐Ÿ— A production-ready starter template.

  • ๐Ÿค– A foundation for AI tool development.

  • ๐Ÿš€ A portfolio-quality open-source project.


๐Ÿค Support

If you find this project useful:

  • โญ Star the repository

  • ๐Ÿด Fork the project

  • ๐Ÿ› Report bugs

  • ๐Ÿ’ก Suggest new features

  • ๐Ÿ”ฅ Contribute improvements

Your support helps make the project better for everyone.


๐Ÿ“„ License

This project is licensed under the MIT License.

See the LICENSE file for more details.


๐Ÿ‘จโ€๐Ÿ’ป Author

Golam Israil

AI Engineer | Python Developer | AI Automation Enthusiast

Connect with Me


๐Ÿ™ Acknowledgements

Special thanks to the amazing open-source community and the technologies that made this project possible.

  • Python

  • FastMCP

  • Model Context Protocol (MCP)

  • Docker

  • GitHub

  • Open Source Community


๐ŸŒŸ If You Like This Project

If this repository helped you learn something new or saved you time:

โญ Give it a Star

๐Ÿด Fork it

๐Ÿ“ข Share it with others

Every contribution and every star motivates further development.


๐Ÿš€ Happy Coding!

Build โ€ข Learn โ€ข Share โ€ข Grow

Made with โค๏ธ by Golam Israil

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A high-performance Model Context Protocol (MCP) server designed for large language models, enabling real-time communication between AI models and applications with support for session management and intelligent tool registration.
    Last updated
    2
    MIT
  • A
    license
    -
    quality
    -
    maintenance
    A standardized MCP server implementation that provides AI models with dynamic tool discovery, execution, and context management capabilities. Built with FastAPI, it offers a modular architecture for easily adding new tools and managing AI application interactions through the Model Context Protocol.
    Last updated
    13
  • F
    license
    -
    quality
    D
    maintenance
    A Model Context Protocol server built with FastMCP that features dynamic tool loading and modular management via a dedicated tool directory. It supports both stdio and HTTP transport modes, enabling efficient development and deployment of custom MCP tools.
    Last updated

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoโ€ฆ

  • MCP (Model Context Protocol) server for Appwrite

  • A Model Context Protocol server for Wix AI tools

View all MCP Connectors

Latest Blog Posts

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/golam74/MCP_SERVER'

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