
sontallive/mcp-server-python-template
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
このテンプレートは、Pythonのモデルコンテキストプロトコル(MCP)サーバーの構築のための合理化された基盤を提供します。 MCPツールのAI支援開発をより簡単かつ効率的にするように設計されています.
概要
このテンプレートは、Pythonのモデルコンテキストプロトコル(MCP)サーバーの構築のための合理化された基盤を提供します。 MCPツールのAI支援開発をより簡単かつ効率的にするように設計されています。 - Ready-to-use MCP サーバーの実装 - 設定可能なトランスポートモード(stdio、SSE) - 気象サービス統合(NWS API) - クリーンで文書化されたコード構造 - 最小限の依存関係 - 改善されたAIツールの理解のため このプロジェクトでは、Awesome Cursor規則のパターンで、AIのコーディング支援を強化するためのCursor規則を使用しています。 - : 組み込みのクリーンコードルールは、一貫性と品質を維持するのに役立ちます - : ルールは、AIアシスタントがより良いコードを生成するのに役立つコンテキストを提供します - : MCPサーバーの実装のための確立されたベストプラクティスに従ってください Cursorのルールは、AIのコーディングアシスタントと人間開発者の両方が、高いコード品質基準を維持し、ベストプラクティスに従うのに役立ちます。 このテンプレートは、プロジェクト内で直接包括的なMCP文書を含みます。 - (protocals/mcp).
概要(AI 翻訳)
MCP公式チュートリアルに触発
概要
このテンプレートは、Pythonのモデルコンテキストプロトコル(MCP)サーバーの構築のための合理化された基盤を提供します。 MCPツールのAI支援開発をより簡単かつ効率的にするように設計されています。
##特徴
- Ready-to-use MCP サーバーの実装
- 構成可能な輸送モード(stdio、SSE)
- 気象サービス統合例(NWS API)
- きれいで、よく文書化されたコード構造
- 最小限の依存関係 -強化されたMCP仕様と文書により、AIツールの理解が向上
カーソルのルールの統合
このプロジェクトでは、Awesome Cursor規則のパターンで、AIのコーディング支援を強化するためのCursor規則を使用しています。
- クリーンコードガイドライン: 組み込みのクリーンコードルールは、一貫性と品質を維持するのに役立ちます
- AIの理解の強化: ルールは、AIアシスタントがより良いコードを生成するのに役立つコンテキストを提供します
- 標準パターン:MCPサーバーの実装のためのベストプラクティスを確立する
Cursorのルールは、AIのコーディングアシスタントと人間開発者の両方が、高いコード品質基準を維持し、ベストプラクティスに従うのに役立ちます。
統合MCPドキュメント
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
MCP Server template for better AI Coding
Inspired by MCP Official Tutorial
Overview
This template provides a streamlined foundation for building Model Context Protocol (MCP) servers in Python. It’s designed to make AI-assisted development of MCP tools easier and more efficient.
Features
- Ready-to-use MCP server implementation
- Configurable transport modes (stdio, SSE)
- Example weather service integration (NWS API)
- Clean, well-documented code structure
- Minimal dependencies
- Embedded MCP specifications and documentation for improved AI tool understanding
Cursor Rules Integration
This project uses Cursor Rules for improved AI coding assistance, with patterns from Awesome Cursor Rules.
- Clean Code Guidelines: Built-in clean code rules help maintain consistency and quality
- Enhanced AI Understanding: Rules provide context that helps AI assistants generate better code
- Standardized Patterns: Follow established best practices for MCP server implementation
Cursor Rules help both AI coding assistants and human developers maintain high code quality standards and follow best practices.
Integrated MCP Documentation
This template includes comprehensive MCP documentation directly in the project:
-
Complete MCP Specification (
protocals/mcp.md): The full Model Context Protocol specification that defines how AI models can interact with external tools and resources. This helps AI assistants understand MCP concepts and implementation details without requiring external references. -
Python SDK Guide (
protocals/sdk.md): Detailed documentation for the MCP Python SDK, making it easier for AI tools to provide accurate code suggestions and understand the library’s capabilities. -
Example Implementation (
protocals/example_weather.py): A practical weather service implementation demonstrating real-world MCP server patterns and best practices.
Having these resources embedded in the project enables AI coding assistants to better understand MCP concepts and provide more accurate, contextually relevant suggestions during development.
Requirements
- Python 3.12+
- Dependencies:
mcp>=1.4.1httpx>=0.28.1starlette>=0.46.1uvicorn>=0.34.0
Getting Started
Installation
-
Clone this repository:
git clone https://github.com/yourusername/mcp-server-python-template.git cd mcp-server-python-template -
Create a virtual environment and install dependencies:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -e .
Running the Example Server
The template includes a weather service example that demonstrates how to build MCP tools:
# Run with stdio transport (for CLI tools)
python server.py --transport stdio
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →