Template MCP Server by redhat-data-and-ai

by redhat-data-and-ai• 67•• Scanned•Claim this listing•Request removal
Coding Agentsagentic aifastapifastmcpkubernetesllm tools

Production-ready Python template for building MCP servers with FastMCP, FastAPI, OAuth, and OpenShift deployment.

Template MCP Server is an open-source mcp server by redhat-data-and-ai, written mainly in Python, with 67 GitHub stars and the Apache-2.0 license. Its code was last updated Oct 26, 2026.

Template MCP Server

Python 3.12+ Tests Coverage License: Apache 2.0 Open in GitHub Codespaces

A production-ready template for developing Model Context Protocol (MCP) servers using Python and FastMCP. This server provides a foundation for creating MCP-compliant servers with comprehensive examples of tools, structured logging, configuration management, and containerized deployment.

The template includes three example MCP tools: a multiply calculator, a code review prompt generator, and a Red Hat logo tool. It demonstrates best practices for MCP server development including proper error handling, health checks, multiple transport protocols (HTTP, SSE, streamable-HTTP), SSL support, and comprehensive development tooling.

Features

  • FastMCP + FastAPI with multiple transport protocols (HTTP, SSE, streamable-HTTP)
  • Three example tools: multiply calculator, code review prompt, Red Hat logo
  • Pydantic configuration via environment variables
  • Structured JSON logging with structlog
  • SSL/TLS support for secure deployments
  • Container-ready with Red Hat UBI base image
  • OpenShift deployment manifests included
  • Full CI/CD with GitHub Actions (tests, linting, security, releases)
  • OAuth integration with PostgreSQL token storage

Quick Start

git clone https://github.com/redhat-data-and-ai/template-mcp-server
cd template-mcp-server
make install        # creates venv, installs deps + pre-commit hooks
make local          # starts server on localhost:5001

Pre-commit includes gitleaks (staged changes) and detect-private-key for secret scanning; CI also runs a full-repository Gitleaks scan. Also enable GitHub Secret Scanning and Push Protection on the repository for defense in depth.

Verify in another terminal:

curl http://localhost:5001/health
<details> <summary>Manual setup (without Make)</summary>
# Create venv and install
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
pre-commit install

# Configure and run
cp .env.example .env
template-mcp-server

# Verify
curl http://localhost:5001/health
</details>

How to Use This Template

Option 1: GitHub Template (Recommended)

  1. Click the "Use this template" button at the top of the repository page.
  2. Name your new repository (e.g., my-mcp-server).
  3. Clone your new repository and follow the rename checklist below.

Option 2: Manual Clone

git clone https://github.com/redhat-data-and-ai/template-mcp-server.git my-mcp-server
cd my-mcp-server
rm -rf .git
git init

Rename Checklist

After creating your project, replace all references to template-mcp-server and template_mcp_server with your project name. The following files require updates:

File / DirectoryWhat to Change
template_mcp_server/Rename the package directory (e.g.,my_mcp_server/)
pyproject.tomlname, project.scripts entry, [project.urls], [tool.coverage.run] source
MakefileReferences in lint, local, and deployment targets
ContainerfileCOPY source path and CMD module path
compose.yamlcontainer_name, service name, healthcheck URL
deployment/openshift/App labels, image names, route hostnames in all manifests (deployment.yaml, route.yaml, kustomization.yaml, etc.)
.github/workflows/Workflow names and paths
README.mdTitle, description, clone URL, and all badge URLs (tests, coverage, Codespaces)
.env.exampleAdjust defaults if your server uses a different port or protocol

Verify Rename

Run this to catch any leftover references:

grep -rn "template.mcp" --include="*.py" --include="*.yaml" --include="*.yml" --include="*.toml" --include="*.md" .

The output should be empty (or only match this README section itself).

Configuration

VariableDefaultDescription
MCP_HOSTlocalhostServer bind address
MCP_PORT5001Server port (1024-65535)
MCP_TRANSPORT_PROTOCOLhttpTransport protocol (http, sse, streamable-http)
MCP_SSL_KEYFILENoneSSL private key file path
MCP_SSL_CERTFILENoneSSL certificate file path
ENABLE_AUTHFalse*Enable OAuth authentication (see Auth Guide)
USE_EXTERNAL_BROWSER_AUTHFalseBrowser-based OAuth for local dev
PYTHON_LOG_LEVELINFOLogging level

* ENABLE_AUTH defaults to False in .env.example but True in code. Always copy .env.example to .env to start with auth disabled.

Documentation

GuideDescription
ArchitectureSystem diagrams, code structure, key components, MCP tools
DevelopmentSetup, running locally, testing, code quality
DeploymentPodman, OpenShift, container configuration
CI/CDWorkflows, pipeline features, running CI locally
ContributingDevelopment workflow, commit conventions, PR process
SecurityVulnerability reporting policy
ChangelogRelease history
AuthenticationOAuth setup, auth modes, troubleshooting
TutorialYour First Tool in 5 Minutes
ExamplesFastMCP and LangGraph client examples

Contributing

See CONTRIBUTING.md for detailed guidelines.

# Fork, clone, and set up
git clone https://github.com/<your-username>/template-mcp-server.git
cd template-mcp-server
make install

# Create a branch, make changes, verify
git checkout -b feat/your-feature
make lint && make test && make pre-commit

# Commit and open a PR
git commit -m "feat: your descriptive message"
git push origin feat/your-feature

License

Apache 2.0

Template MCP Server alternatives

View more →

Similar mcp servers in Coding Agents, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.

NameStarsLicenceLast updatedScan
Template MCP Server (this page)
redhat-data-and-ai
67Apache-2.0Oct 26, 2026Scanned, no flagged issues
Context Mode
mksglu
33kNone foundNov 1, 2026Not scanned yet
Serena
oraios
31kNone foundOct 28, 2026Not scanned yet
Fastmcp
PrefectHQ
28kApache-2.0Nov 1, 2026Scanned, no flagged issues
Nuclear
nukeop
19kAGPL-3.0Nov 1, 2026Scanned, no flagged issues
MCP For Beginners
microsoft
18kMITOct 30, 2026Scanned, no flagged issues