MCP Time Server

by chrishayuk
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Includes component bootstrapping functionality that can be disabled via the NO_BOOTSTRAP environment variable

  • Supports development workflows through Git with contribution guidelines for feature branches and pull requests

  • Utilizes Pydantic for robust input validation using Pydantic models to ensure data integrity for time-related operations

MCP タイムサーバー

概要

MCPタイムサーバーは、異なるタイムゾーン間で高度な時間関連ユーティリティを提供するために設計された、洗練されたPythonベースのマイクロサービスです。現在の時刻の取得や、様々なグローバルタイムゾーン間の時刻変換を行うための堅牢な機能を提供します。

プロジェクトの詳細

  • バージョン: 0.1.1
  • Python 互換性: Python 3.11+

特徴

  • 現在の時刻の取得: 任意の IANA タイムゾーンの現在の時刻を取得します
  • タイムゾーン変換: 異なるタイムゾーン間の時刻を変換します
  • 包括的な検証:Pydanticモデルを使用した堅牢な入力検証
  • 非同期サーバーアーキテクチャ: 効率的なパフォーマンスのために asyncio で構築
  • 柔軟な構成:環境変数と構成ファイルを通じて構成可能

依存関係

コア依存関係:

  • mcp (>=1.6.0)
  • ピダンティック (>=2.11.2)
  • PyYAML (>=6.0.2)
  • pyz (>=0.4.3)

開発依存関係:

  • pytest (>=8.3.5)

インストール

前提条件

  • Python 3.11以上
  • ピップ
  • (オプション)仮想環境を推奨

PyPIからインストール

pip install chuk-mcp-time-server

ソースからインストール

  1. リポジトリをクローンします。
git clone <repository-url> cd chuk-mcp-time-server
  1. 仮想環境を作成します。
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
  1. パッケージをインストールします。
pip install . # Installs the package in editable mode

開発インストール

開発用に設定するには:

pip install .[dev] # Installs package with development dependencies

サーバーの実行

コマンドラインインターフェース

chuk-mcp-time-server

プログラムによる使用

from chuk_mcp_time_server.main import main if __name__ == "__main__": main()

環境変数

  • NO_BOOTSTRAP : コンポーネントのブートストラップを無効にするように設定します
  • その他の設定オプションは設定ファイルで設定できます

利用可能なツール

1. 現在の時刻を取得する

入力:

  • timezone : IANAタイムゾーン名(例: 'America/New_York')

get_current_time('Europe/London')

戻り値:

  • 指定されたタイムゾーンの現在の時刻
  • タイムゾーンの詳細
  • 夏時間(DST)のステータス

2. 時間を変換する

入力:

  • source_timezone : ソースタイムゾーン(IANA形式)
  • time : HH:MM (24時間)形式の時刻
  • target_timezone : ターゲットタイムゾーン(IANA形式)

convert_time('America/New_York', '14:30', 'Europe/Paris')

戻り値:

  • ソース時間の詳細
  • 目標時間の詳細
  • ゾーン間の時差

発達

コードのフォーマット

  • 黒はコードのフォーマットに使用されます
  • isortはインポートソートに使用されます
  • 行の長さは88文字に設定されています

テストの実行

pytest

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成します( git checkout -b feature/AmazingFeature
  3. コードがフォーマットとテストに合格することを確認する
  4. 変更をコミットします( git commit -m 'Add some AmazingFeature'
  5. ブランチにプッシュする ( git push origin feature/AmazingFeature )
  6. プルリクエストを開く

ライセンス

MITライセンス

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

現在の時刻を取得し、堅牢な検証を使用して異なるグローバル タイムゾーン間で変換するためのユーティリティを提供する Python マイクロサービス。

  1. Overview
    1. Project Details
      1. Features
        1. Dependencies
          1. Installation
            1. Prerequisites
            2. Install from PyPI
            3. Install from Source
            4. Development Installation
          2. Running the Server
            1. Command-Line Interface
            2. Programmatic Usage
          3. Environment Variables
            1. Available Tools
              1. 1. Get Current Time
              2. 2. Convert Time
            2. Development
              1. Code Formatting
              2. Running Tests
            3. Contributing
              1. License
                ID: ilrn5h088x