Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Example MCP Servercalculate the area of a circle with radius 5"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server with FastMCP v2.0
A Model Control Protocol (MCP) server implementation using FastMCP v2.0, featuring Docker containerization, comprehensive testing, and CI/CD automation.
Features
π Built with FastMCP v2.0
π³ Docker containerization with multi-stage builds
π¦ Modern Python packaging with
uvπ§ͺ Comprehensive test suite with pytest
π GitHub Actions CI/CD pipeline
π‘οΈ Security scanning and dependency management
π Code coverage reporting
π§ Automated code formatting and linting
Related MCP server: FastMCP Boilerplate
Quick Start
Prerequisites
Python 3.10+
uv for dependency management
Docker (optional, for containerization)
Installation
Clone the repository:
git clone <repository-url>
cd nikolas-mcpInstall dependencies using uv:
uv syncRun the server:
uv run python -m mcp_server.mainUsing Docker
Build the Docker image:
docker build -t mcp-server .Run the container:
docker run -p 8000:8000 mcp-serverOr use docker-compose:
docker-compose upAvailable Tools
The MCP server provides the following tools:
calculate
Evaluates mathematical expressions safely.
Parameters:
expression(string): Mathematical expression to evaluate
Example:
{
"tool": "calculate",
"arguments": {
"expression": "2 + 3 * 4"
}
}greet
Generates friendly greeting messages.
Parameters:
name(string): Name of the person to greet
Example:
{
"tool": "greet",
"arguments": {
"name": "World"
}
}Resources
config://settings- Server configuration settingsinfo://server- General server information
Prompts
help- Display help information about available capabilities
Development
Setup Development Environment
# Install development dependencies
uv sync --dev
# Install pre-commit hooks
uv run pre-commit installRunning Tests
# Run all tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=src --cov-report=html
# Run specific test file
uv run pytest tests/test_main.py -vCode Quality
# Format code
uv run ruff format .
# Lint code
uv run ruff check .
# Type checking
uv run mypy src/Project Structure
nikolas-mcp/
βββ src/
β βββ mcp_server/
β βββ __init__.py
β βββ main.py # Main server implementation
β βββ server.py # Server utilities and config
βββ tests/
β βββ __init__.py
β βββ conftest.py # Pytest configuration
β βββ test_main.py # Main functionality tests
β βββ test_server.py # Server utilities tests
β βββ test_integration.py # Integration tests
βββ .github/
β βββ workflows/
β βββ ci.yml # CI/CD pipeline
β βββ dependabot.yml # Dependabot auto-merge
βββ Dockerfile
βββ docker-compose.yml
βββ pyproject.toml # Project configuration
βββ README.mdCI/CD Pipeline
The project includes a comprehensive GitHub Actions pipeline:
Lint and Format: Runs ruff for code formatting and linting
Test Suite: Runs tests across multiple Python versions and OS platforms
Security Scan: Performs security vulnerability scanning
Docker Build: Builds and tests Docker images
Auto-publish: Publishes to PyPI and Docker Hub on release
Required Secrets
For full CI/CD functionality, configure these GitHub secrets:
PYPI_API_TOKEN- PyPI authentication tokenDOCKERHUB_USERNAME- Docker Hub usernameDOCKERHUB_TOKEN- Docker Hub access token
Configuration
Environment Variables
LOG_LEVEL- Logging level (default: INFO)PYTHONPATH- Python path for module resolution
Server Configuration
The server can be configured via the ServerConfig class in src/mcp_server/server.py:
config = ServerConfig()
config.max_connections = 200
config.timeout = 60Docker Configuration
Multi-stage Build
The Dockerfile uses multi-stage builds for optimized image size:
Base stage: Sets up Python and system dependencies
Dependencies stage: Installs Python packages with uv
Runtime stage: Copies application code and runs the server
Health Checks
The container includes health checks to ensure the server is running correctly.
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes
Run tests and ensure they pass
Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions:
Check the Issues page for existing problems
Create a new issue with detailed information
Refer to the FastMCP documentation for FastMCP-specific questions