MCP Server
A production-ready Model Context Protocol server built with Python and FastMCP, featuring modular architecture, centralized tool registration, Docker support, and a suite of utility tools for AI applications.
README
<div align="center">
๐ MCP Server
Production-Ready Model Context Protocol Server Built with Python & FastMCP
<p align="center">
A clean, modular, scalable, and Docker-ready implementation of the Model Context Protocol (MCP), designed for AI applications and developer productivity.
</p>
<p align="center">
<img src="https://img.shields.io/badge/Python-3.11+-3776AB?style=for-the-badge&logo=python&logoColor=white"/>
<img src="https://img.shields.io/badge/FastMCP-Latest-009688?style=for-the-badge"/>
<img src="https://img.shields.io/badge/Docker-Ready-2496ED?style=for-the-badge&logo=docker&logoColor=white"/>
<img src="https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge"/>
<img src="https://img.shields.io/badge/Status-Production%20Ready-success?style=for-the-badge"/>
</p>
<p align="center">
<img src="https://img.shields.io/github/stars/golam74/MCP_SERVER?style=social"/>
<img src="https://img.shields.io/github/forks/golam74/MCP_SERVER?style=social"/>
<img src="https://img.shields.io/github/watchers/golam74/MCP_SERVER?style=social"/>
</p>
</div>
๐ 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
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
- [x] FastMCP Server
- [x] Tool Registration System
- [x] Modular Architecture
- [x] Logging System
- [x] Docker Support
- [x] 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:
- Fork the repository.
- Create a new feature branch.
git checkout -b feature/awesome-feature
- Commit your changes.
git commit -m "Add awesome feature"
- Push your branch.
git push origin feature/awesome-feature
- 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
- GitHub: https://github.com/golam74
- LinkedIn: (Add your LinkedIn profile here)
๐ 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.
<div align="center">
๐ Happy Coding!
Build โข Learn โข Share โข Grow
Made with โค๏ธ by Golam Israil
</div>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.