Template MCP Serverのロゴ

Template MCP Server

組織
redhat-data-and-ai

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

公開者redhat-data-and-ai
リポジトリtemplate-mcp-server
言語Python
フォーク
73
スター
66
利用可能なツール
0
通信方式stdio
ライセンスApache-2.0
リンク
  • ツールをAIワークフローに接続

    Template MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには66件のスターと73件のフォークがあります。

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

bash
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

Verify in another terminal:

bash
curl http://localhost:5001/health
bash
# 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

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

bash
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:

bash
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.

bash
# 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のMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Template MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Template MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Template MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "redhat-data-and-ai-template-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてTemplate MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Template MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Template MCP Serverを使ってこのタスクを手伝ってもらえますか?
Template MCP Server
はい、読みました。
Template MCP Serverで調べた結果をお伝えします。

よくある質問

Template MCP Server MCPサーバーは何に使いますか?

Template MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでTemplate MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでTemplate MCP Serverを利用できます。

TypingMindでTemplate MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Template MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Template MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

Template MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでTemplate MCP Server MCPのどのようなツールを利用できますか?

Template MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Template MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Template MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇