
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A template that provides a production-ready Python Model Context Protocol server scaffold with built-in tools, resources, prompts, Docker support, and testing.
Security-first Python MCP server template is cataloged as an MCP server attributed to aj-geddes. A template that provides a production-ready Python Model Context Protocol server scaffold with built-in tools, resources, prompts, Docker support, and testing. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Security-first Python MCP server template are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
It includes health_check, echo, list_files, read_file, write_file, and run_shell_command tools with security controls.
It supports stdio, HTTP, and SSE transports.
Yes, tools are added in tools/custom_tools.py, which contains a template for tool implementations.
README.md · a8122bcd4074 · Fetched 2026-11-13 13:55:36 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
Create production-ready MCP servers in minutes, not hours
Transform this template into your custom MCP server with our interactive setup wizard. Everything is centralized, documented, and ready for production deployment.
A comprehensive, security-first template for building Model Context Protocol (MCP) servers with Python. Get from zero to production in minutes with built-in Docker support, automated testing, and enterprise-grade CI/CD.
# 1. Clone and enter directory
git clone https://github.com/aj-geddes/python-mcp-server-template.git
cd python-mcp-server-template
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run interactive setup wizard
python quick_setup.py
# 4. Start your custom MCP server!
python mcp_server.py
That's it! 🎉 Your production-ready MCP server is running with:
| Use Case | Example Tools | Setup Time |
|---|---|---|
| 🤖 AI Tool Servers | File processors, calculators, formatters | 2 minutes |
| 🔌 API Integrations | Database queries, web APIs, cloud services | 3 minutes |
| 🛠️ Custom Automation | System commands, workflows, data pipelines | 2 minutes |
| 🏢 Enterprise Solutions | Secure, monitored, compliant MCP servers | 5 minutes |
config.py, not scattered across filestools/custom_tools.py with examplespython quick_setup.py
The wizard will ask you:
config.py - All your settings in one placetools/custom_tools.py - Template for your tool implementationsREADME.md - Updated with your project info# In tools/custom_tools.py
async def my_awesome_tool_impl(param1: str, param2: int) -> Dict[str, Any]:
# Your tool logic here
return {"result": f"Processed {param1} with value {param2}"}
# Local development
python mcp_server.py
# Production with Docker
docker build -t my-mcp-server .
docker run -p 8080:8080 my-mcp-server
# Format code
black .
isort .
# Check types
mypy mcp_server/
# Lint code
flake8 mcp_server/
# Security scan
bandit -r mcp_server/
# Run tests
pytest
# Run tests with coverage
pytest --cov=mcp_server --cov-report=html
| Command | Description |
|---|---|
pytest | Run all tests |
pytest -m unit | Run unit tests only |
pytest -m integration | Run integration tests only |
black . | Format all Python files |
isort . | Sort imports |
mypy mcp_server/ | Type checking |
flake8 mcp_server/ | Code linting |
bandit -r mcp_server/ | Security analysis |
./build.sh | Build and test Docker image |
| Variable | Default | Description |
|---|---|---|
MCP_SERVER_NAME | "template-server" | Server name identifier |
MCP_TRANSPORT | "stdio" | Transport type (stdio, http, sse) |
MCP_HOST | "0.0.0.0" | Host for HTTP transport |
MCP_PORT | "8080" | Port for HTTP transport |
WORKSPACE_PATH | "/workspace" | Base path for file operations |
⚠️ Important Security Notes:
0.0.0.0 binds to all interfaces. For production, use 127.0.0.1 or a specific IPWORKSPACE_PATH directorymcp_server/
├── __init__.py # Main server implementation
├── __main__.py # Module entry point
└── tools/ # Tool implementations (future)
mcp_server.py # Application entry point
tests/ # Comprehensive test suite
docker/ # Docker configurations
scripts/ # Build and utility scripts
| Tool | Description | Security Features |
|---|---|---|
health_check() | Server health status | Read-only operation |
echo(message) | Echo functionality | Input validation |
list_files(directory) | Directory listing | Path validation |
read_file(file_path) | File reading | Size limits, path validation |
write_file(file_path, content) | File writing | Path validation, encoding checks |
run_shell_command(command) | Command execution | Timeout limits, sandboxing |
file://{path} - Secure file resource access with path validationcode_review_prompt(code, language, focus) - Structured code review prompting# Standard build
./build.sh
# Build with version tag
./build.sh v1.0.0
# Alternative builds
docker build -f Dockerfile.alternative -t mcp-server-alt .
docker build -f Dockerfile.fixed -t mcp-server-fixed .
# Run with volume mount
docker run -v /host/workspace:/workspace \
-e MCP_TRANSPORT=http \
-e MCP_PORT=8080 \
-p 8080:8080 \
python-mcp-server-template:latest
# Run with docker-compose
docker-compose up -d
tests/
├── test_mcp_server.py # Comprehensive server tests
├── test_server.py # Additional server tests
└── conftest.py # Test configuration
# All tests
pytest
# With coverage
pytest --cov=mcp_server --cov-report=html
# Specific test types
pytest -m unit
pytest -m integration
pytest -m "not slow"
# Verbose output
pytest -v
# Stop on first failure
pytest -x
# Run security analysis
bandit -r mcp_server/
# Check for known vulnerabilities
safety check
# Generate security report
bandit -r mcp_server/ -f json -o security-report.json
# Check server health
curl http://localhost:8080/health
# Get server status
python -c "from mcp_server import health_check; import asyncio; print(asyncio.run(health_check()))"
# Install pre-commit hooks
pre-commit install
# Run full quality check
./scripts/quality-check.sh
# Create feature branch
git checkout -b feature/new-tool
This project is licensed under the MIT License - see the LICENSE file for details.
| Guide | Description |
|---|---|
| 🚀 Quick Start | Get running in 5 minutes |
| 🔒 Security Guide | A+ security features and best practices |
| 🏗️ API Reference | Complete API documentation |
| 👨💻 Development Setup | Contributing and extending |
| 🐳 Docker Guide | Production Docker deployment |
This template has achieved Dr. Alexandra Chen's production standards:
⭐ Star this repository if it helps you build amazing MCP servers!
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Security-first Python MCP server template from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/python-mcp-server-template-aj-geddes)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.