About Bootstrap python service
A Python application template for building services with Clean Architecture and SOLID principles. It suits teams starting a service that needs APIs, background jobs, database access, authentication, and observability.
Key features
- 01FastAPI and AsyncAPI documentation
- 02Dramatiq async task execution
- 03Socket.io WebSocket application
- 04SQLAlchemy repositories and Alembic migrations
- 05ORY-based authentication
- 06OpenTelemetry metrics, traces, and logs
Use cases
- 01Starting a Python service with separated domain and storage layers
- 02Building an API with background task processing
- 03Adding database migrations and fixtures
- 04Setting up service observability
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEBootstrap python service
This is an example implementation of a python application applying concepts from Clean Architecture and SOLID principles.
- The repository classes are isolated behind interfaces, enforcing the Interface Segregation principle and the Inversion of Control design pattern
- The application frameworks are decoupled from the domain logic
- The storage layer is decoupled from the domain logic
This template provides out of the box some commonly used functionalities:
- Sync and Async API Documentation using FastAPI and AsyncAPI
- Async tasks execution using Dramatiq
- Websocket application using Socket.io
- Repository pattern for databases using SQLAlchemy and SQLAlchemy bind manager
- Database migrations using Alembic (configured supporting both sync and async SQLAlchemy engines)
- Database fixtures support using customized Alembic configuration
- Authentication and Identity Provider using ORY Zero Trust architecture
- Full observability setup using OpenTelemetry (Metrics, Traces and Logs)
- Example CI/CD deployment pipeline for GitLab (The focus for this repository is still GitHub but, in case you want to use GitLab 🤷)
- [TODO] Producer and consumer to emit and consume events using CloudEvents format using HTTP, to be used with Knative Eventing
Documentation
The detailed documentation is available:
- Online on GitHub pages
- Offline by running
make docsafter installing dependencies withmake dev-dependencies
How to use
Create your GitHub repository using this template (The big green Use this template button).
Optionally tweak name and authors in the pyproject.toml file, however the metadata
are not used when building the application, nor are referenced anywhere in the code.
Before running any commands, install uv and Docker:
- You can install
uvon Mac usingbrew:brew install uv - Download and install Docker: https://www.docker.com/products/docker-desktop/
Using Docker:
make containers: Build containersdocker compose up dev-http: Run HTTP application with hot reloaddocker compose up dev-socketio: Run HTTP application with hot reloaddocker compose up dramatiq-worker: Run the dramatiq workerdocker compose run --rm test: Run test suitedocker compose run --rm migrate: Run database migrationsdocker compose run --rm autogenerate-migration: Generate a new migration file
Using Make (you still need Docker for most of them):
make install-dependencies: Install requirementsmake dev-dependencies: Install dev requirementsmake update-dependencies: Updates requirementsmake dev-http: Run HTTP application with hot reloadmake dev-socketio: Run HTTP application with hot reloadmake test: Run test suitemake migrate: Run database migrationsmake autogenerate-migration: Generate a new migration file
Other commands for development
make check: Run tests, code style and lint checksmake fix: Run tests, code style and lint checks with automatic fixes (where possible)
Multistage dockerfile configuration
Python docker image tend to become large after installing the application requirements (the slim base is ~150 MB uncompressed), therefore it's important to spend efforts to minimise the image size, even if it produces a slightly more complex multistage Dockerfile.
The following setup makes sure the production image will keep to a minimal size ("only" 360MB):
- 150MB base image
- 210MB python installed dependencies
Using the following pipeline the "test" image is instead ~850MB, more than 400MB that would end up as a cost in traffic on each image pull.

Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.